// File: /workspace/github_cpp_makefile_star2_O1/suhasjains[P]AMR-Solver/src/amrsolver.cpp
// Function: amrsolver::set_initial_field()
void set_initial_field() {

	myOctree::create_list_of_leaf_nodes();

    	for (std::list<Octree*>::iterator i = myOctree::leaf_nodes.begin(), end = myOctree::leaf_nodes.end(); i != end; ++i) {

   		Field* field = (*i)->get_block_data()->field;
   		VecField* location = (*i)->get_block_data()->mesh;
	
		for(int i=0;i<field->Nx;i++) {
                	for(int j=0;j<field->Ny;j++) {
                        	for(int k=0;k<field->Nz;k++) {
                                	
					double x = location->x[i][j][k];
					double y = location->y[i][j][k];
					double z = location->z[i][j][k];
 					
					((x-1.0)*(x-1.0) + (y-1.0)*(y-1.0) >= 0.5625)?(field->val[i][j][k] = 1.0):(field->val[i][j][k] = 100.0);		

//					((x-1.0)*(x-1.0) + (y-1.0)*(y-1.0) + (z-1.0)*(z-1.0) >= 0.421875)?(field->val[i][j][k] = 1.0):(field->val[i][j][k] = 100.0);		
					//((x-1.0)*(x-1.0) + (y-1.0)*(y-1.0) >= 0.5625)?(field->val[i][j][k] = 1.0):(field->val[i][j][k] = 100.0);		
				//	(x*x + y*y >= 1.0)?(field->val[i][j][k] = 1.0):(field->val[i][j][k] = 100.0);		
					if(x*x + y*y <= 1.0)	{field->val[i][j][k] = 0.1; }		
					if(x*x + y*y >= 3.0)	{field->val[i][j][k] = 100.0; }		
                        	}
                	}
        	}
    	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x2f28
leaq 0x128f7(%rip), %rax     # 0x15220
movq (%rax), %r14
cmpq %rax, %r14
je 0x2a89
leaq 0xe6ec(%rip), %r15      # 0x11028
movabsq $0x4059000000000000, %r12 # imm = 0x4059000000000000
movabsq $0x3fb999999999999a, %r13 # imm = 0x3FB999999999999A
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x8(%rax), %rbx
movq %r14, -0x30(%rbp)
movq 0x10(%r14), %rdi
callq 0x4064
movsd 0xe6ae(%rip), %xmm7     # 0x11020
movsd 0xe69e(%rip), %xmm6     # 0x11018
movsd 0xe68e(%rip), %xmm5     # 0x11010
movsd 0xe67e(%rip), %xmm4     # 0x11008
movslq (%rbx), %rcx
movq %rcx, -0x38(%rbp)
testq %rcx, %rcx
jle 0x2a75
movq (%rax), %rax
movl 0x4(%rbx), %edx
xorl %esi, %esi
testl %edx, %edx
jle 0x2a68
movl 0x8(%rbx), %edi
xorl %r8d, %r8d
testl %edi, %edi
jle 0x2a5c
movq 0x10(%rax), %r9
movq 0x18(%rax), %r10
movq (%r9,%rsi,8), %r9
movq (%r9,%r8,8), %r9
movq (%r10,%rsi,8), %r10
movq (%r10,%r8,8), %r10
movq 0x10(%rbx), %r11
movq (%r11,%rsi,8), %r11
movq (%r11,%r8,8), %r11
xorl %r14d, %r14d
movsd (%r9,%r14,8), %xmm0
movsd (%r10,%r14,8), %xmm1
movapd %xmm0, %xmm2
addsd %xmm4, %xmm2
movapd %xmm1, %xmm3
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm2
addsd %xmm3, %xmm2
xorl %ecx, %ecx
ucomisd %xmm5, %xmm2
setb %cl
movsd (%r15,%rcx,8), %xmm2
movsd %xmm2, (%r11,%r14,8)
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm6
jb 0x2a3e
movq 0x10(%rbx), %rcx
movq (%rcx,%rsi,8), %rcx
movq (%rcx,%r8,8), %rcx
movq %r13, (%rcx,%r14,8)
ucomisd %xmm7, %xmm0
jb 0x2a54
movq 0x10(%rbx), %rcx
movq (%rcx,%rsi,8), %rcx
movq (%rcx,%r8,8), %rcx
movq %r12, (%rcx,%r14,8)
incq %r14
cmpq %r14, %rdi
jne 0x29df
incq %r8
cmpq %rdx, %r8
jne 0x29b0
incq %rsi
cmpq -0x38(%rbp), %rsi
jne 0x29a2
movq -0x30(%rbp), %r14
movq (%r14), %r14
cmpq 0x1252d(%rip), %r14     # 0x14fb0
jne 0x2950
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq