Pass mesh and time information to the DAObjFunc class #549
Replies: 3 comments 5 replies
-
What error did you get when you put the above code in DAObjFunc? Regarding your question, I suggest you implement your new objFunc as a function (e.g., called myNewObj)in DASover.C first. Then, at the end of the DASimpleFOam loop, you call this->myNewObj(). If this approach works, you can then move it to the DAObjFunc class. |
Beta Was this translation helpful? Give feedback.
-
Can you change the above |
Beta Was this translation helpful? Give feedback.
-
If runTimePtr_() is not available, you can use |
Beta Was this translation helpful? Give feedback.
-
Hi,
This is more of a design of the code type of question.
I am trying to perform interpolation between two meshes on the fly in DAFoam. I have managed to search the OpenFOAM source code and retrieve the relevant functions that perform this task. I have even written a small application in native OpenFOAM to do this task for me.
Now I want to do the same with DAFoam but I am facing so many issues. Primarily because of the structure. I would like to do my interpolation at the end of all the primal solver calls (because it is costly) so I can have a separate solver and remove the printAllObjFuncs() function so that the functioncall to derived calcObjFunc() does not take place at every primal solver iteration (happens only at the end). But in order to do my interpolation, I need to create a new mesh object (and I want to have this option for only some objective function child classes) which requires the time object as well. I have tried everything to declare this in the DAObjFunc class, tried a lot of tricks but I have not been successful.
Is there a way to translate something like this
into an equivalent code in DAFoam in the DAObjFunc parent class?
I even tried having multiple constructors since I come to understand that there is a runTime election table which picks the child class at runtime based on the type information but I was not successful. Any hints on where to begin would be highly useful!
Beta Was this translation helpful? Give feedback.
All reactions