June 3, 2021 at 9:20 am

teoman

Subscriber

Hi Rob

I hooked the udf without any error message except the one.

But it is not working.Because , when Thread*tf=DT_THREAD(dt); is not implemented.

begin_f_loop(f,tf) command is not working. I guess ,the cause is that "tf" not defined.

I have put a Message line in UDF and it shows that time stepping is ok .But when I put it into begin_f_loop no message apperars on the screen.

I am desperately needing your help.

Regards

Teoman

#include"udf.h"

DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)

{

Thread*tf=DT_THREAD(dt);

face_tf;

intn;

Node*v;

real dy;

dy=5*sin(25*time);

/*getthethreadpointerforwhichthismotionisdefined*/

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

Message("time=%f,dy=%f\n",time,dy);

begin_f_loop(f,tf)

{

f_node_loop(f,tf,n)

{

v=F_NODE(f,tf,n);

if(NODE_X(v)>50.0&&NODE_POS_NEED_UPDATE(v))

{

NODE_POS_UPDATED(v);

NODE_Y(v)=NODE_Y(v)+NODE_X(v)*dy;

}

}

}

end_f_loop(f,tf);

}

I hooked the udf without any error message except the one.

But it is not working.Because , when Thread*tf=DT_THREAD(dt); is not implemented.

begin_f_loop(f,tf) command is not working. I guess ,the cause is that "tf" not defined.

I have put a Message line in UDF and it shows that time stepping is ok .But when I put it into begin_f_loop no message apperars on the screen.

I am desperately needing your help.

Regards

Teoman

#include"udf.h"

DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)

{

Thread*tf=DT_THREAD(dt);

face_tf;

intn;

Node*v;

real dy;

dy=5*sin(25*time);

/*getthethreadpointerforwhichthismotionisdefined*/

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

Message("time=%f,dy=%f\n",time,dy);

begin_f_loop(f,tf)

{

f_node_loop(f,tf,n)

{

v=F_NODE(f,tf,n);

if(NODE_X(v)>50.0&&NODE_POS_NEED_UPDATE(v))

{

NODE_POS_UPDATED(v);

NODE_Y(v)=NODE_Y(v)+NODE_X(v)*dy;

}

}

}

end_f_loop(f,tf);

}