CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Assigning objects to cells (https://www.cfd-online.com/Forums/openfoam-programming-development/91377-assigning-objects-cells.html)

Hisham August 9, 2011 05:35

Assigning objects to cells
 
Hi

I want to develop a class that defines material behaviour for a stress analysis solver. I need to assign an object to each finite volume.

Also, I need to extract numerical values from tensor/vector/scalar field (for each cell), use them inside the object functions then return these values to a variable field (a tensor field) (during the time step loop).

How is it possible to loop the control volumes?

I would appreciate it if I get help on how to do that or where to look for answers.

Thanks

gunnar2 August 9, 2011 14:30

Hello Hisham,
I am not sure if I understand your question.

This should work:

Quote:

YourObjectType someValue;
GeometricField< YourObjectType, fvPatchField, fvMesh > field=...;
for (int i=0;i<field.size();i++){
field[i]=someValue;
}
HTH
Gunnar

Hisham August 17, 2011 10:32

Thanks a lot for your reply

Can you elaborate more or at least, can you guide me to where I can learn more


All times are GMT -4. The time now is 02:52.