// File: /workspace/github_c_makefile_star2_O0/markpeerdeman[P]mbemm/src/emath/post.c
// Function: write_contact_force
void write_contact_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 midx, midy, midz;
  int cnodes;
  /* double force1, force2; */

  printf("\n{---------------------------------------------------------------}\n");
  printf("{ POST output of the contact element forces.\n");
  printf("  format:\n");
  printf("  element_label force_x force_y force_z elementarea midx midy midz cnodes\n");
  printf("}\n");
  printf("contact_element_forces\n");
  fxt=0.0; fyt=0.0; fzt=0.0;
  midx=0.0; midy=0.0; midz=0.0;

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

  printf("end_contact_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 $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
leaq 0x14c0a(%rip), %rdi     # 0x19460
movb $0x0, %al
callq 0x1070
leaq 0x14f4b(%rip), %rdi     # 0x197af
movb $0x0, %al
callq 0x1070
leaq 0x14c5e(%rip), %rdi     # 0x194d0
movb $0x0, %al
callq 0x1070
leaq 0x14f5d(%rip), %rdi     # 0x197dd
movb $0x0, %al
callq 0x1070
leaq 0x14c13(%rip), %rdi     # 0x194a1
movb $0x0, %al
callq 0x1070
leaq 0x14fca(%rip), %rdi     # 0x19866
movb $0x0, %al
callq 0x1070
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x14570
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x4d14
movl $0x0, 0xc(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
movl 0x18(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
cmpl $0xf, 0x14(%rax)
jne 0x494e
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
movl 0x1c(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
cmpl $0xf, 0x14(%rax)
jne 0x4a0a
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x20(%rax), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x28(%rax), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x30(%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
movl 0x20(%rax), %edx
movl $0x2, %esi
callq 0x175c0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
cmpl $0xf, 0x14(%rax)
jne 0x4ad2
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x20(%rax), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x28(%rax), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movsd 0x30(%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x98(%rsp), %xmm1
addsd 0x80(%rsp), %xmm1
addsd 0x68(%rsp), %xmm1
movsd 0x148aa(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0xa0(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0xb0(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x90(%rsp), %xmm1
addsd 0x78(%rsp), %xmm1
addsd 0x60(%rsp), %xmm1
movsd 0x14866(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0xa0(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0xb0(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x88(%rsp), %xmm1
addsd 0x70(%rsp), %xmm1
addsd 0x58(%rsp), %xmm1
movsd 0x14822(%rip), %xmm0    # 0x19420
mulsd %xmm1, %xmm0
movq 0xa0(%rsp), %rax
mulsd 0xb8(%rax), %xmm0
movq 0xb0(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x147f5(%rip), %xmm1    # 0x19428
divsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x147dd(%rip), %xmm1    # 0x19428
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x147c5(%rip), %xmm1    # 0x19428
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x50(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x48(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x40(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0x4cfb
movq 0xa0(%rsp), %rax
movl 0x14(%rax), %esi
movsd 0x50(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movq 0xa0(%rsp), %rax
movsd 0xb8(%rax), %xmm3
movsd 0x20(%rsp), %xmm4
movsd 0x18(%rsp), %xmm5
movsd 0x10(%rsp), %xmm6
movl 0xc(%rsp), %edx
leaq 0x14b34(%rip), %rdi     # 0x19828
movb $0x7, %al
callq 0x1070
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x48f6
leaq 0x14b47(%rip), %rdi     # 0x19862
movb $0x0, %al
callq 0x1070
leaq 0x14737(%rip), %rdi     # 0x19460
movb $0x0, %al
callq 0x1070
leaq 0x14a1e(%rip), %rdi     # 0x19755
movb $0x0, %al
callq 0x1070
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
leaq 0x14a2c(%rip), %rdi     # 0x19783
movb $0x3, %al
callq 0x1070
movsd 0x38(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x30(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
movsd 0x28(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x1150
leaq 0x14a00(%rip), %rdi     # 0x1979e
movb $0x1, %al
callq 0x1070
addq $0xb8, %rsp
retq
nopl (%rax)