Hi there
I'm working on a user defined function I developed for using in a boundary condition segment. I need the displacement of a particular node (with global number of 3421) that does not belong to the target boundary associated to this UDF. How can I inquire displacement of this node?
Thanks,
Diana Carlson
Inquiring displacement of a node
-
- Posts: 24
- Joined: 21 Oct 2009, 09:49
Re: Inquiring displacement of a node
I tried too many possibilities (VariableGet, GetScalarLocalSolution, GetVectorLocalSolution, GetReal , .......) with different modifications in the SIF file, but none of them were successful and I'm not that expert to find the reason. I'm really sick and tired of this trial and error and will be extremely grateful if someone can help me.
Thanks, Diana
Thanks, Diana
-
- Site Admin
- Posts: 4832
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Inquiring displacement of a node
There isn't a default routine for getting data on one point. The Get*LocalSolution routines fetch info an all elements. The following might work. The Visited stuff is just for marginal saving of time. Didn't check it though.
Code: Select all
TYPE(Variable_t), POINTER :: DispVar
LOGICAL :: Visited = .FALSE.
INTEGER :: ind,i
INTEGER, POINTER :: DispPerm(:)
REAL(KIND=dp), POINTER :: DispValues(:)
REAL(KIND=dp) :: PointDisp(3)
SAVE Visited, Dofs, DispPerm, DispField, ind
IF(.NOT. Visited ) THEN
DispVar => VariableGet( Model % Variables,'Displacement')
Dofs = DispVar % Dofs
DispPerm => DispVar % Perm
DispField => DispVar % Values
Visited = .TRUE.
ind = GetInteger(Model % Simulation,'my special node')
END IF
DO i=1,Dofs
PointDisp(i) = DispField(Dofs*(DispPerm(ind)-1)+i)
END DO
-
- Posts: 24
- Joined: 21 Oct 2009, 09:49
Re: Inquiring displacement of a node
Oh Peter it worked. I'm crying tears of happiness! Thanks a billion. .