How to control the ANALYSIS procedure thru modify the SRC?

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

Moderators: silvia, selimgunay, Moderators

Post Reply
wanfei
Posts: 5
Joined: Thu May 12, 2016 9:53 pm
Location: BJTU

How to control the ANALYSIS procedure thru modify the SRC?

Post by wanfei » Thu May 12, 2016 10:43 pm

Hi fmk.
When I am tring to add a discrete crack analysis framework to OPENSEES, stationary crack simulation is of good accuracy. When crack growth simulation is the problem,full control of the analysis procedure should be obtained(I think),because SOLUTION DEPENDENT Criterion(like "energy release rate" calculated from the element stress statuses about the vicinity of crack tips) is used.

What I want to do is Just Commit the domain status according to a SOLUTION DEPENDENT criterion, and Call the revertTolastcommit() when the SOLUTION DEPENDENT criterion is beyond the tolerance, then go on iteration with a smaller increment. The question is how to do this?

I also want some Constraints, nodes and elements to be added or removed during the analysis steps.
Could I get my goal thru modifying some functions of StaticAnalysis class? or StaticIntegrator class? or Just modifying codes in Element class level or Material class level?

wanfei
Posts: 5
Joined: Thu May 12, 2016 9:53 pm
Location: BJTU

Re: How to control the ANALYSIS procedure thru modify the SR

Post by wanfei » Sun May 15, 2016 3:10 am

FROM the quickmain project of Opensees SRC code, I have known that the object of StaticAnalysis class(which derives from the Analysis class) Controlled the Solving procedure of an FEA model. That means one can modify the definition of StaticAnalysis class to make opensees do what you want.

go on typing my own codes..to be continued.

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

Re: How to control the ANALYSIS procedure thru modify the SR

Post by fmk » Tue May 24, 2016 9:47 am

not sure what you are on about.

wanfei
Posts: 5
Joined: Thu May 12, 2016 9:53 pm
Location: BJTU

Re: How to control the ANALYSIS procedure thru modify the SR

Post by wanfei » Tue May 24, 2016 7:40 pm

fmk wrote:
> not sure what you are on about.

Sorry about my poor English,
I just studied what OpenSEES did when a user sourced a tcl script through the quickmain project in the SRC..
And I have known that when we typed some script, like "node 1 0 0 0", in the prompt, the corresponding object would be created in OpenSEES memory.

I found that all the objects, which were created before the creation of the object of StaticAnalysis class, were just the definition of a analysis model.
When we call the member function StaticAnalysis::analyze(numSteps), the solution procedure will start..

The problem is: I want to do something during the solution procedure, like "removing/adding a SP_constraint" "removing/adding an element or a node".
And also I don't want to modify the StaticAnalysis class and re-compile the SRC to build my own version of OpenSEES..

I just want to achieve the goal throught creating a Dynamic-link library file of element class..
I know that when an element object is being added to the "Domain", the element class member function "Setdomain(Domain *theDomain)" is first called, then function"update()"..

My idea is that modify Setdomain() that we store the Domain pointer as a "static" member. Thus when the last element is added to Domain, we create an object of StaticAnalysis class in the Setdomain(). This time, StaticAnalysis can be my own version(removing/adding components is possible according to my preferences) then run function analyze(numSteps)...

So I want to know if there is any other way to do something, like removing/adding domain components , during the the routine StaticAnalysis::analyze(numSteps) is running.

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

Re: How to control the ANALYSIS procedure thru modify the SR

Post by fmk » Thu May 26, 2016 7:38 am

no .. just repeat what the script would do in C++ .. i.e. some analysis step2, remove whatever, more analysis steps .. it is much easier in a script than writing the c++ code though the results will be the same whichever approach you use.

wanfei
Posts: 5
Joined: Thu May 12, 2016 9:53 pm
Location: BJTU

Re: How to control the ANALYSIS procedure thru modify the SR

Post by wanfei » Thu May 26, 2016 11:39 pm

fmk wrote:
> no .. just repeat what the script would do in C++ .. i.e. some analysis
> step2, remove whatever, more analysis steps .. it is much easier in a
> script than writing the c++ code though the results will be the same
> whichever approach you use.

thanks a lot for your suggestion, I am now trying to make it work..
but it suddenly occurs to me that..is there any way to transmit the result of a c++ coding function to a variable defined in Tcl command line?

Because some..solution dependent results..are needed to judge whatever to remove from the current domain.. and it may be easier(I think..) to get those solution dependent results in c++ code through ..calling the existed member functions defined in OpenSees classes..

My idea is doing this through text document files.. Could it be more efficient?

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

Re: How to control the ANALYSIS procedure thru modify the SR

Post by fmk » Wed Jun 01, 2016 10:14 am

it is possible to add a command to do it .. look at commands.cpp in OpenSees/SRC/tcl to see how to add commands

wanfei
Posts: 5
Joined: Thu May 12, 2016 9:53 pm
Location: BJTU

Re: How to control the ANALYSIS procedure thru modify the SR

Post by wanfei » Wed Jun 01, 2016 6:54 pm

Thanks very much, now trying..

Post Reply