Author Topic: Sending and receiving the global variables between two different FEAPs  (Read 3484 times)

nima_ikm

  • Jr. Member
  • **
  • Posts: 33
Hello
My model is describes as follows:
At first, I am defining one main FORTRAN code. After that, I perform FEAP and then finally get displacement as my solution. Then, I perform second FEAP by using imposed displacement which this displacement comes from the first FEAP. Finally, I will get residual from the second FEAP and then imposed this to the first FEAP as my prescribed traction. This procedure should run until some criteria is satisfied. This can be sketched as follows:

1.   While convergence satisfied
2.              Call FEAP 1
3.               Receive Global displacement for certain nodes
4.               Send Prescribed displacement to FEAP 2
5.               Call FEAP 2
6.               Receive Reaction force for some certain nodes
7.               Send Prescribed reaction force (prescribed traction) to FEAP 1
8.               Preform some other analysis
9.   End While

My question is that:
1.   When the first FEAP is finished, how I can access the global variable from the current FEAP and imposed the results to the next FEAP (receiving global variable).
2.   How, I can import the result from the current FEAP to another FEAP as a global variable (sending global variable).
Probably, I should define on share global variable between two FEAP, whereas this global variable should not vanish even when FEAP is terminated.

Thank you so much for your kind help and your time, in advance.


luc

  • Full Member
  • ***
  • Posts: 53
If you don't want to rewrite things in FEAP you can always export displacements and stresses after each call to FEAP and use these information to write an new input file that will specify the correct boundary conditions.

Do you need to have this done in FORTRAN? A lot of scripting languages such as Python could preform these operations for you and it would provide advanced built in functions to read and write than FORTRAN. Also calling FEAP in Python is quite simple with Pythons's subprocess module: https://docs.python.org/2/library/subprocess.html and offers more control for error handling.

nima_ikm

  • Jr. Member
  • **
  • Posts: 33
Thank you so much for your response. What I realy want to do is based on the following algorithms which I want to implement in input file. Suppose, I have the following input file:

(…)
Edisp ! prescribed traction
Include traction
Batch
        Umacr  -->  {Run another feap by:  call system(‘./feap’)  --> Result: (displacement, reaction force)  -->  store result in global 
                               varaiable (UL and TL)
        Tangent,,1 
        Obtain reaction force from solution called TG
        Umacr  --> (change prescribed traction to (TG+TL) )
End

As result, I need to know about the following problem:

  1.   In the first Umacr, Is it possible to store the result (displacement and reaction force) in the global variable where we can access to that later in the second Umacr (because first feap is terminated then the lifetime of its global varaibale is also over).
  2.   In general case, Is it possible to change prescribed traction (probably I should find whereis it allocated like hr(np(..))).
  3.   How, I can access to the reaction force for some specific nodes (I mean either TL or TG).

Thank you very much for your kindness and help.
« Last Edit: April 21, 2015, 09:21:46 AM by nima_ikm »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Each feap manages its own data, thus it will be very difficult to communicate directly between two versions the way you describe - you would have to communicate the pointer to where the data is stored.  A simple way out of the problem is to write results to files and read them in the other code.  Another option is to partition the problem using ACTI and DEACTI then all the results are in one problem.  Problem 1 could be in REGION 1 and Problem 2 in REGION 2.  then you can activate and deactivate the regions to solve the problem.  It is tedious to do so but a script can help using either feap procedures or running in batch mode.

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
You could also try setting up a socket interface to communicate data back and forth between FEAP versions.  If you look at the web page of Prof. D.S. Bindel he has, in the past, posted code that allows one to drive FEAP from a separate program and then get and set data within FEAP's memory space.  Using his methodologies you could implement what you describe.

nima_ikm

  • Jr. Member
  • **
  • Posts: 33
Dear Professor Taylor and FEAP_Admin,

Thank you for reply. I need to do so more research on that. However, could you please make a comments on the other problems which I mentoned,as well:

  2.   In general case, Is it possible to change prescribed traction (probably I should find whereis it allocated like hr(np(..))).
  3.   How, I can access to the reaction force for some specific nodes (I mean either TL or TG).

Thank you very much.

Best wishes
« Last Edit: April 22, 2015, 04:35:57 AM by nima_ikm »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Traction vectors are not specifically defined in any hr(*) location.  Generally, they are defined as boundary conditions through CSURface or resultand FORCes precomputed.  Body forces are converted in elements.  You can define your own traction through user functions which store results in the F array.

When you request REACtions they are stored in the DR array which is np(26).  This array is also used in solution phase to store the global residual.  In REAC all dof are available, but in residual form only the active dof's are stored. 

nima_ikm

  • Jr. Member
  • **
  • Posts: 33
Dear Professor Taylor,

I am so appreciate of your help and your response.

« Last Edit: April 22, 2015, 07:29:37 AM by nima_ikm »