storing state variables in newElement

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
johnnyontheweb
Posts: 48
Joined: Sat Oct 08, 2011 6:28 am

storing state variables in newElement

Post by johnnyontheweb »

I'm trying to write a new element in Fortran starting from the example I found in PACKAGE directory. My element is a non-linear spring, and I have to store state variables during the analysis (basically, the code has to read at each increment the state variables saved in the previous step). Can I do that? If so, how?

I'm not very confident with OOP but I think I can use eleObj:
c Allocate the element state

eleObj%tag = tag
eleObj%nnode = 2
eleObj%ndof = 4
eleObj%nparam = 4
eleObj%nstate = 0
eleObj%nmat = 1

If so, is it possible to store and entire array with one line?
Thanks
johnnyontheweb
Posts: 48
Joined: Sat Oct 08, 2011 6:28 am

Re: storing state variables in newElement

Post by johnnyontheweb »

Ok, I discovered I can use thecState array in the Fortran example.

It is still not clear to me if I can implement a new element with zero lenght and what code I havo tu supply in ISW_COMMIT and ISW_REVERT_TO_START part (I'm not using the material in my code, the springs act in a phenomenological way).

I followed completely the example code provided for truss element (truss.f) but I cannot figure out why I always obtain these errors:

WARNING BandSPDLinLapackSolver::solve() - the LAPACK routines returned 2
WARNING Linear::solveCurrentStep() -the LinearSOE failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 1 with domain at load factor 2
OpenSees > analyze failed, returned: -3 error flag

Can you help?

Thnks
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: storing state variables in newElement

Post by fmk »

there is a problem with the tangent from your element or your model.
johnnyontheweb
Posts: 48
Joined: Sat Oct 08, 2011 6:28 am

Re: storing state variables in newElement

Post by johnnyontheweb »

Ok, I partially solve this matter in my routine. I have a question to better understand what to do:
can I return to the solver a null tangent stiffness when my element brokes?
In this case I obtain:

WARNING BandSPDLinLapackSolver::solve() - the LAPACK routines returned 1
WARNING NewtonRaphson::solveCurrentStep() -the LinearSysOfEqn failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 16 with domain at load factor 17

OpenSees > analyze failed, returned: -3 error flag

What this error exactly means?

Thanks
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: storing state variables in newElement

Post by fmk »

in case you haven't figured this out yet, the solver is failing because of a probable problem with the ele tangent.
johnnyontheweb
Posts: 48
Joined: Sat Oct 08, 2011 6:28 am

Re: storing state variables in newElement

Post by johnnyontheweb »

Thank you so much, I figured out the problem before OpenSees Days in Rome where we met.
Price9
Posts: 1
Joined: Wed Jun 13, 2012 11:30 pm

Re: storing state variables in newElement

Post by Price9 »

Thanks for the information.
[url=http://www.sandfordhighschool.com/][I]High school diploma[/I][/url]
Post Reply