// File: /workspace/github_c_makefile_star2_O0/markpeerdeman[P]mbemm/src/emath/post.c
// Function: write_force
void write_force(mesh theMesh)
{ point p;
  element e;
  double t1x, t1y, t1z, t2x, t2y, t2z, t3x, t3y, t3z;
  double fx, fy, fz;
  double fxt, fyt, fzt;
  /* double force1, force2; */

  printf("\n{---------------------------------------------------------------}\n");
  printf("{ POST output of the elemental forces.\n");
  printf("  format:\n");
  printf("  element_label force_x force_y force_z\n");
  printf("}\n");
  printf("element_forces\n");
  fxt=0.0; fyt=0.0; fzt=0.0;

  /* the calculated tractions: */
  e = (element)element_dll(theMesh->mesh_e,START,0);
  while (e!=(element)NULL)
  {  
    /* get the traction forces at the three nodes of the element: */ 
	/* NODE 1: */
	p=(point)point_dll(theMesh->mesh_p,SEARCH,e->p1);
	t1x=p->fx; t1y=p->fy; t1z=p->fz;
	/* NODE 2: */
	p=(point)point_dll(theMesh->mesh_p,SEARCH,e->p2);
	t2x=p->fx; t2y=p->fy; t2z=p->fz;
	/* NODE 3: */
	p=(point)point_dll(theMesh->mesh_p,SEARCH,e->p3);
	t3x=p->fx; t3y=p->fy; t3z=p->fz;
  
	fx= 1.0/3.0*(t1x+t2x+t3x)*e->area*theMesh->G_SCALE;
	fy= 1.0/3.0*(t1y+t2y+t3y)*e->area*theMesh->G_SCALE;
	fz= 1.0/3.0*(t1z+t2z+t3z)*e->area*theMesh->G_SCALE;
	fxt+=fx; fyt+=fy; fzt+=fz;
	printf("%4d % 8.8E % 8.8E % 8.8E\n", e->label,fx,fy,fz);
	e=e->NEXT;
  }

  printf("end_element_forces\n");

  printf("\n{---------------------------------------------------------------}\n");
  printf("{ POST output of the resulting force vector.\n");
  printf(" Force: %5.8E %5.8E %5.8E\n",fxt,fyt,fzt);
  printf(" Modulus: %5.8E\n",sqrt((double)(fxt*fxt+fyt*fyt+fzt*fzt)));

}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
leaq 0x14fba(%rip), %rdi     # 0x19460
movb $0x0, %al
callq 0x1070
leaq 0x15222(%rip), %rdi     # 0x196d6
movb $0x0, %al
callq 0x1070
leaq 0x1500e(%rip), %rdi     # 0x194d0
movb $0x0, %al
callq 0x1070
leaq 0x1522e(%rip), %rdi     # 0x196fe
movb $0x0, %al
callq 0x1070
leaq 0x14fc3(%rip), %rdi     # 0x194a1
movb $0x0, %al
callq 0x1070
leaq 0x15259(%rip), %rdi     # 0x19745
movb $0x0, %al
callq 0x1070
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x14570
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x479a
movq 0x90(%rsp), %rax
movq (%rax), %rdi
movq 0x80(%rsp), %rax
movl 0x18(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x88(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x88(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x90(%rsp), %rax
movq (%rax), %rdi
movq 0x80(%rsp), %rax
movl 0x1c(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x88(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x88(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq (%rax), %rdi
movq 0x80(%rsp), %rax
movl 0x20(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x88(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x88(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x78(%rsp), %xmm1
addsd 0x60(%rsp), %xmm1
addsd 0x48(%rsp), %xmm1
movsd 0x14da9(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0x80(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0x90(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x70(%rsp), %xmm1
addsd 0x58(%rsp), %xmm1
addsd 0x40(%rsp), %xmm1
movsd 0x14d68(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0x80(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0x90(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x68(%rsp), %xmm1
addsd 0x50(%rsp), %xmm1
addsd 0x38(%rsp), %xmm1
movsd 0x14d27(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0x80(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0x90(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x30(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x80(%rsp), %rax
movl 0x14(%rax), %esi
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
leaq 0x14fad(%rip), %rdi     # 0x19727
movb $0x3, %al
callq 0x1070
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x452b
leaq 0x14fa0(%rip), %rdi     # 0x19741
movb $0x0, %al
callq 0x1070
leaq 0x14cb1(%rip), %rdi     # 0x19460
movb $0x0, %al
callq 0x1070
leaq 0x14f98(%rip), %rdi     # 0x19755
movb $0x0, %al
callq 0x1070
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
leaq 0x14fa6(%rip), %rdi     # 0x19783
movb $0x3, %al
callq 0x1070
movsd 0x18(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x1150
leaq 0x14f7a(%rip), %rdi     # 0x1979e
movb $0x1, %al
callq 0x1070
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)