CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   boundBox in OpenFoam (https://www.cfd-online.com/Forums/main/238949-boundbox-openfoam.html)

kraf October 13, 2021 02:24

boundBox in OpenFoam
 
Hello, I'm having some problems to understand the source code of a program in openfoam. For instance what is the meaning of a command boundbox could somebody help me to understand this lines?
Thanks for your help!
-----------------------------------------------------------------------------------------
Code:
boundBox* meshBB = new boundBox(this->points(), false);
vector span = meshBB->span();
delete meshBB;
scalar waterDepth = meshBB->max()[2]; // What is this [2]?
waterDepth = ibProperties().lookupOrDefault<scalar>
("waterDepth",waterDepth);
waterDepth = objectDictList()[objectID].lookupOrDefault<scalar>
("waterDepth",waterDepth);

LuckyTran October 13, 2021 04:24

I'm not familiar with where these particular lines of code can be found in the OpenFOAM programming but:

A boundBox is a class or structure that is defined by the extreme points of a box. To say it again, a box that is defined by its corners.

The 2nd line attempts to retrieve the extreme (the min and max) values using span. I presume this span gets used somewhere else in a way that is not shown here or maybe it is being used in a way that I don't intuitively understand right away.

kraf October 15, 2021 00:08

Thank you very much! It really helped me to understand the code.


All times are GMT -4. The time now is 19:06.