FEAP User Forum
FEAP => Programming => Topic started by: sg on July 25, 2024, 10:57:53 AM
-
I have a question regarding the use of STRE, NODE command in FEAP v8.6
In my parent user element, subroutines for isw = 3 and isw = 8 are called. Each isw returns array s and p. However, sizes of these arrays differ for both the cases. In isw = 3, s = (nst,*), while for isw=8, s = (nen,*).
Since array s is declared once at the start of parent element, how can it be declared again with a different size before calling either of the subroutines (isw=3 or isw=8) to accommodate size difference in each one of them? Fortran does not allow 2D assumed-size arrays.
Attached here is the user element for reference.
-
The pointer is changed between calls 3 & 8
-
I have a user subroutine that computes quantities for nodal projections. In ver 8.4, I write projected values using hr(np(58)+(i-1) + j*numnp) array where i is the counter over number of nodal points and j is the counter over projected quantities. It is giving me correct values.
In ver 8.6, I change the array to hr(npnp+numnm+(i-1)*istv+j) where i goes from 1 to numnm. But it is writing all zeros. Am I pointing to correct position in the history variable?
-
This looks incorrect.
The base location is correct hr(npnp+numnm). But from a look at program/p_paraview.f it looks like the layout is that the stresses are to be thought of as being in a NUMNM by ISTV two dimensional array. Which I think says you should think of i=1:numnm and j=1:istv and then you can use hr(npnp+numnm + (j-1)*numnm + i).
Hopefully I got this correct. I find it helpful to use the version of comblk.h that has the target attribute
!-----[--+---------+---------+---------+---------+---------+---------+-]
! Modification log Date(dd/mm/year)
! 1. Increase dimension to 1024 to force loops on 03/10/2011
! long arrays
real (kind=8), target:: hr
integer , target:: mr
common /comblk/ hr(1024),mr(1024)
Then you can more convieniently index into hr( ) with code like
real (kind=8), pointer :: sig(:,:)
sig(1:numnm,1:istv) => hr(npnp+numnm : npnp+numnm+numnum*istv-1)
If you do this then the indexing is just sig(node , projected_component).
-
Thank you, Prof Govindjee.
I checked my output file and I see that STREss,node,#,# command is giving 'All values zero'. This is strange since the code and user subroutine for nodal projections are the same that give correct values for v8.4. Could you please help me identify what might be going wrong here? Attached here are my input and output files.
-
There is not nearly enough information given to be able to help you. I suggest you follow the model used by the example element given in the programmer's manual or other posted elements on the internet. Attached is a simple element for ver8.6 that solves the elastic torsion problem.
-
Attachment is here.
-
Starting in ver 8.6 the stresses are not projected across element interfaces, thus. you should do the projections into the local arrays in the elements (usually passed as P & S). Otherwise you will have problems with what you were doing before.
-
I made the following changes to make the stress nodal projections of ver 8.4 to work in ver 8.6:
1. Defined 'pstyp = ndm' under isw=1. Without this variable, element projection arrays are not assembled into global array in 'passble.f' and projection command returns zero values.
2. The projected values are written using hr(npnp+numnm+(i-1)*numnm+j-1) where i is the counter from 1 to istv and j is the counter from 1 to numnm.
Thank you Prof. Govindjee and Prof. Taylor for your help.
-
Good.
Sometimes it is useful to look at the user stubs given in user/ for example user/elmt01.f even if you are experienced with FEAP. The element stubs, for example, have the following lines
elseif(isw.eq.1) then ! Input material set data
! pstyp = ??? ! Sets plot dimension (1,2,3)
! If set to zero not plotted