-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: AddNodalVariables type method for Processes. #869
Comments
Something important in order to reduce memory usage is to reduce the number of historical variables in processes and utilities, many processes keep using by default the historical variables |
(Just to recall the potential issue discussed in #854) The issue in here is what happens if the process is constructed using a submodelpart (a common operation) instead of using the main model part, what is to say that some variables are added only in a set of nodes instead of adding them to all the nodes. |
I Line the idea, but as i recall there is a problem with the order of
creation of the processes. Still it is a +1 If we can do it correctly
Riccardo
…On Oct 19, 2017 4:45 PM, "jcotela" ***@***.***> wrote:
Hi everyone,
The discussion in #854
<#854> made me think
that it would be nice if the process class had some way of adding its
required variables to the model part, in order to make it more robust. The
idea is as follows: now it is the job of the Python solver to add all
required variables to the nodes, but sometimes processes use additional
variables in their regular operation. I think it would be desirable that
each process had the opportunity to add its required variables to the
modelpart (not only check if they have been added by the solver). In my
view, this would help us
- Increase robustness: The process ensures the model part is correctly
prepared for the operations to be done within the process.
- Reduce memory usage: "niche" variables, used only within a process
and not within the main solution loop are only added when the process is
used.
There are some potential issues, as @rubenzorrilla
<https://github.com/rubenzorrilla> was mentioning in #854
<#854>, with
submodelparts, but I don't think they would be a blocker.
Does anyone else think this would be good to have/sees problems with this
idea?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#869>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AHr7EaKdcXB-ZAl2ubdP1P0ZEOxxoSPSks5st2CBgaJpZM4P_WF9>
.
|
I also like the idea but I want to draw your attention to a potential problem: |
👍 for the @jcotela proposal. I see the concern of @rubenzorrilla but at this moment all sub model parts are sharing the same variable lists with the main one. So adding a variable to any of them would add it to all. I think this mechanism would avoid problems even in adding variable by process. |
I thought abt this and have two comments on this:
|
Hi @philbucher, I think that the solution is essentially in the line you are suggesting. The AddVariables methods for processes should be static. A possibility would be:
|
Having the static Just to add as a long term solution: It is time to think about |
I think that adding variables here and there can result in a big caos. I would suggest to add a method in processes to ask for the variables GetVariables(). Externally a manager asks for the variables of processes, solvers, and whatever your problem needs and it adds to the main model part. It is true that now, when processes are build, a model (list of model parts) is passed to the constructor. Usually the modelpart where is going to apply the process is taken from the model in the constructor. The change here would be to pass an empty model and ask for the modelpart in ExecuteInitialize(), once the model would read and build. I just want to ask if this solucion have any conflict with you current processes and solving designs? |
to give my two cents: i agree on Jordi's solution, however i think it could make sense to combine with the idea of @josep-m-carbonell (i don't like the name GetVariables though) i don't love the idea of manually adding to the .json . I think it can be done to add specific variables for special reasons but not as a general mechanism for solvers or processes to add the variables they need. in any case i also think that all of this is compatible with the idea of a "Project". |
It looks like there's kind of an agreement: static method, json provides the variables,... |
no, i don't think that json should provide the variables.
it can be an extra mechanism but not the first one. And the method should
not be static, i would prefer the mechanism that Jordi proposes
…On Fri, Dec 22, 2017 at 11:16 AM, Miguel Angel Celigueta < ***@***.***> wrote:
I looks like there's kind of an agreement: static method, json provides
the variables,...
Can we write a prototype of how the code would end up? This would allow to
polish the details (names of the functions, potential unexpected problems).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#869 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHr7EQu1LfaUcG2V-eD8JPtTQ3hOrP_xks5tC4GGgaJpZM4P_WF9>
.
--
*Riccardo Rossi*
PhD, Civil Engineer
member of the Kratos Team: www.cimne.com/kratos
Tenure Track Lecturer at Universitat Politècnica de Catalunya,
BarcelonaTech (UPC)
Full Research Professor at International Center for Numerical Methods in
Engineering (CIMNE)
C/ Gran Capità, s/n, Campus Nord UPC, Ed. B0, Despatx 102
(please deliver post to the porters of building C1)
08034 – Barcelona – Spain – www.cimne.com -
T.(+34) 93 401 56 96 skype: *rougered4*
<http://www.cimne.com/>
<https://www.facebook.com/cimne> <http://blog.cimne.com/>
<http://vimeo.com/cimne> <http://www.youtube.com/user/CIMNEvideos>
<http://www.linkedin.com/company/cimne> <https://twitter.com/cimne>
Les dades personals contingudes en aquest missatge són tractades amb la
finalitat de mantenir el contacte professional entre CIMNE i voste. Podra
exercir els drets d'accés, rectificació, cancel·lació i oposició,
dirigint-se a [email protected]. La utilització de la seva adreça de
correu electronic per part de CIMNE queda subjecte a les disposicions de la
Llei 34/2002, de Serveis de la Societat de la Informació i el Comerç
Electronic.
Imprimiu aquest missatge, només si és estrictament necessari.
<http://www.cimne.com/>
|
Then I am completely lost. I thought @jcotela used the word static and talked about passing the json to the solver (in principle to know the list of processes, but then the variables too, right?). |
well, then i think that the proposal of jordi was to have a "empty constructor" and then a AddVariables and Initialize function. we could then first construct the processes, call the AddVariables and then call the initialize function. this is not incompatible with additionally reading variables from json and with the proposal of @josep-m-carbonell |
My proposal, in short, is to provide a function that adds the required variables on each process (or at least declares them, as @josep-m-carbonell is suggesting). The details of it being a static method or moving stuff away from the constructor to the initialize method, should be "whatever works best", I don't have a strong preference. The point is: we have one or more solvers and a list of processes. From that, we should be able to determine the list of required variables and add them to the model part automatically. |
Closing due to inactivity. I don't think my original proposal can be realized in the current design (#2994 specifically requires the model part to be created before the processes). I still think the goal of not having to add nodal variables to a solver when only one (optional) process requires them would be nice to have, so feel free to reopen if anyone has new ideas. |
just for the record, I still have this on my todo-list |
I also find this interesting. We talked with @gcasas about this and about Utilities (which also need variables). They should add the variables or at least make a check. How to enforce this is also an interesting discussion. |
I also liked the idea... and I think sometime soon we should deal with it again... |
I implemented this in #3561 |
Hi everyone,
The discussion in #854 made me think that it would be nice if the process class had some way of adding its required variables to the model part, in order to make it more robust. The idea is as follows: now it is the job of the Python solver to add all required variables to the nodes, but sometimes processes use additional variables in their regular operation. I think it would be desirable that each process had the opportunity to add its required variables to the modelpart (not only check if they have been added by the solver). In my view, this would help us
There are some potential issues, as @rubenzorrilla was mentioning in #854, with submodelparts, but I don't think they would be a blocker.
Does anyone else think this would be good to have/sees problems with this idea?
The text was updated successfully, but these errors were encountered: