DEFINE_EXECUTE_AT_END(force)
{
Thread *t ;
face_t f;
real x[ND_ND];
real f_glob[ND_ND],m_glob[ND_ND],x_cg[ND_ND];
real total_f[ND_ND];
real time = RP_Get_Real("flow-time");
int i;
FILE *file = fopen("force.txt", "a+");
if(time>1100.0)
{
Domain *d=Get_Domain(1);
t=Lookup_Thread(d,ID);
if (!Data_Valid_P ())
return;
NV_S(f_glob, =, 0.0);
NV_S(m_glob, =, 0.0);
NV_S(x_cg, =, 0.0);
NV_S(total_f, =, 0.0);
for(i=0;i<=ND_ND;i++)
x_cg = 0.0;
Compute_Force_And_Moment (d,t,x_cg,f_glob,m_glob,TRUE); |