// File: 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
subq $0x50, %rsp
callq 0x4930
leaq 0x2270c(%rip), %rdi     # 0x262b0
callq 0x4490
movq %rax, -0x8(%rbp)
leaq 0x226fc(%rip), %rdi     # 0x262b0
callq 0x44c0
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x3bd3
jmp 0x3e6c
leaq -0x8(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x3e5c
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x3e4c
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3e3c
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x1d349(%rip), %xmm1    # 0x21010
subsd %xmm1, %xmm0
movsd -0x38(%rbp), %xmm2
movsd 0x1d338(%rip), %xmm1    # 0x21010
subsd %xmm1, %xmm2
movsd -0x40(%rbp), %xmm1
movsd 0x1d327(%rip), %xmm3    # 0x21010
subsd %xmm3, %xmm1
movsd -0x40(%rbp), %xmm3
movsd 0x1d316(%rip), %xmm4    # 0x21010
subsd %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x1d2f6(%rip), %xmm1    # 0x21008
ucomisd %xmm1, %xmm0
jb 0x3d50
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq %rcx, %rsi
shlq $0x3, %rsi
movq %rax, %rdx
addq %rsi, %rdx
movsd 0x1d2c7(%rip), %xmm0    # 0x21010
movsd %xmm0, (%rax,%rcx,8)
jmp 0x3d86
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movq %rcx, %rsi
shlq $0x3, %rsi
movq %rax, %rdx
addq %rsi, %rdx
movsd 0x1d297(%rip), %xmm0    # 0x21018
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movsd -0x40(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x1d266(%rip), %xmm0    # 0x21010
ucomisd %xmm1, %xmm0
jb 0x3dd9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd 0x1d24c(%rip), %xmm0    # 0x21020
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movsd -0x38(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x1d22b(%rip), %xmm1    # 0x21028
ucomisd %xmm1, %xmm0
jb 0x3e2c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd 0x1d1f1(%rip), %xmm0    # 0x21018
movsd %xmm0, (%rax,%rcx,8)
jmp 0x3e2e
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3c38
jmp 0x3e3e
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3c21
jmp 0x3e4e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3c0b
jmp 0x3e5e
leaq -0x8(%rbp), %rdi
callq 0x4550
jmp 0x3bbd
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)