Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with reading constraints forces after each analysis with API

Status
Not open for further replies.

George21

Marine/Ocean
Dec 31, 2013
4
Hello,

I wrote a script in Femap using API. In this script there is running a static linear analysis for many times. After each analysis i need to read from model the T3 Constraint force on 2 nodes.

To read the Constraint Force i used the following script:

rc = App.feAppGetActiveView( viewID )
rc = feView.Get( viewID )
outSetID = feView.OutputSet
ouVec1.SetID = outSetID
rc = ouVec1.Get( 54 ) 'T3 Constraint Force
Dim feNode As femap.Node
Set feNode = App.feNode
While feNode.Next
If feNode.ID = NDpp Then
RT3pp = ouVec1.Value(feNode.ID)
Msg = " NDpp = " + Str$(RT3pp)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
If feNode.ID = NDpv Then
RT3pv = ouVec1.Value(feNode.ID)
Msg = " NDpv = " + Str$(RT3pv)
rc = App.feAppMessage( FCM_NORMAL, Msg )
End If
Wend

This works fine if i have the output cases.

But here is the problem. I have a loop where i change the load case at each iteration (changing the value of pressure). I run analysis from API and after the analysis is complete the FEMAP doesn't create the output data and goes for the next analysis.

This is the script part for running analysis:

ldSetID = ldset.NextEmptyID
ldset.Put (ldSetID)
App.Info_ActiveID( FT_LOAD_DIR ) = ldSetID

elLoad.SetID = ldSetID

elID = elSet.First()
While elID <> FE_FAIL
el.Get( elID )

pval = (dsw- elZ) * dens * 9.81

If pval >0 Then
elLoad.meshID = elID
elLoad.type = FLT_EPRESSURE
elLoad.LoadValue = pval
elLoad.FaceNumber = 1
rc = elLoad.Put(elLoad.NextEmptyID)
End If

elID = elSet.Next()
Wend

am.Get (1)
am.BCSet (2) = ldSetID
am.Put(1)
am.Analyze (1)

While App.feFileProgramRunning()= FE_OK
Wait(5)
Wend


Can you please help me with a method and / or tips how to read the Constraint Forces on nodes after each analysis.

Thank you very much! And I hope, that my description is clear enough.
George
 
Replies continue below

Recommended for you

I don't use API ... how about putting the two nodes into a group, and printing the f06 (output constraint forces for that 1 group only) ?

curious ... you're pulling off Fz at two nodes ... how redundant is the model?

Quando Omni Flunkus Moritati
 
I need to make a procedure for static equilibration of the ship in still water. That means I need to find the water depth in order to determine the equilibrium between hydrostatic pressure and the gravity force ( mass of the model * gravity acceleration).

If the two reaction forces from aft end and fore end of the ship are almost zero then i can say that i found the equilibrium.


UPDATE: I divided the API script in two loops. on for applying loads and running analysis. and one for reading results.
After the program finish one step from first loop i get the output set and I can continue my job.

Now the problem is how can I put gravity acceleration (body load) from API.

Thanks.
 
So, now i have to chose from two methods.
1. I need to delete the pressure loads from a load set.
2. Or I need to create a body load (gravity acceleration) on a new load set.

Can anybody help me with a method for first / second solution.

Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor