Personal tools
You are here: Home Forum Use Clear Study

Clear Study

Up to Use

Clear Study

Posted by L Tro at January 15. 2016
Dear all,

is there a safe way to remove all geometry and meshes in a study to free memory?
I have to run the script in a loop and encounter some problems because of full memory.

I tried to close the study at the end of the loop and create a new one but this prevents the python console from printing any output (it is printed when all the loops are finished).

Preferred way would be to clear the study and run the loop inside the same study.

Any suggestions are appreciated.

Thanks.

Re: Clear Study

Posted by Florian Brunet at January 22. 2016

Hello,

If you want to loop over a process which builds a geometry and meshes it into a python script, it is possible ; though it is painful.

You have a component dedicated for that matter called YACS. The idea is that you create a scheme with nodes realizing actions (input parameters, create a geometry, generate a mesh...). Go to that module and check the help to see how it works.

However, what do you want to do by looping over ?

If you want to perform a parametric study, definitely go for YACS module.

If you want to do something else, please explain you idea, so I can point out the appropriate tool in salome.

 

Regards,

Florian

Re: Clear Study

Posted by gowrishnakar at April 21. 2016

Hi Florian,

               I too have a similar problem as posted here. In my case i am using external python to call ./runsession of salome and build my geometry and export the mesh. Exported mesh is processed in FEniCS. Since i am doing optimization problem, results from FEniCs are used to vary the geometry parameters and it calls ./runsession of salome again again. I am using a server and it is getting overloaded as Salome is using 100% after some 100 runs. Is there a way to delete the study, because as my study numbers increase server gets overloaded.

Re: Clear Study

Posted by Saint Michael at April 25. 2016

Is there a way to delete the study, because as my study numbers increase server gets overloaded.

I think you can simply close a study:

salome.myStudy.Close()

St.Michael

Re: Clear Study

Posted by gowrishnakar at April 25. 2016

Thanks for the reply. 

Yeah i did that and still my SalomeSessionServer uses 100% CPU after some iterations and it hangs. I have to forcefully kill it.

 

Previously Saint Michael wrote:

Is there a way to delete the study, because as my study numbers increase server gets overloaded.

I think you can simply close a study:

salome.myStudy.Close()

St.Michael

 

Re: Clear Study

Posted by Franz Pichler at June 18. 2021

Hello dear community!

I am also trying to clear a study and in salome 9.2. i am told that

Traceback (most recent call last):
  File "/home/franzpichler/Documents/FEM_Toolbox/SINGLE_PARTICLE_MODEL/create_laser_structure_2d.py", line 636, in <module>
    salome.myStudy.Close()
AttributeError: '_objref_Study' object has no attribute 'Close'

and if i try studymanager (that i found in another psot)

Traceback (most recent call last):
  File "/home/franzpichler/Documents/FEM_Toolbox/SINGLE_PARTICLE_MODEL/create_laser_structure_2d.py", line 635, in <module>
    salome.myStudyManager.Close(salome.myStudy)
AttributeError: module 'salome' has no attribute 'myStudyManager'

 

 

So what would be the recommended  way of clearing the whole study for the newest salome version?

many thanks in advance

 

best regards,

 

Franz

Re: Clear Study

Posted by Vadim SANDLER at June 18. 2021

Hello Franz,

I believe you can use:

import salome
salome.salome_close()

This cleans up the study and related context.

Alternatively you can just invoke:

salome.myStudy.Clear()

... but first approach is preferable.

Regards,
Vadim.

Powered by Ploneboard
Document Actions