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/)
-   -   matching variable data with grid point data (https://www.cfd-online.com/Forums/openfoam-programming-development/88048-matching-variable-data-grid-point-data.html)

anfho May 6, 2011 15:28

matching variable data with grid point data
 
1 Attachment(s)
Hi,
I want to extract data point values and grid/mesh point information/location from OF, specifically fireFoam, but the solver should not matter here. Moreover, I do not only want to extract them, I also want to match that information, meaning I want to be sure which value belongs to which mesh point.

So far, I have been able to extract that data (see below), but I am not 100% sure, if the label for the value corresponds to the label of the mesh point.

So the QUESTION here is: can anyone verify that the label associated with a data point is the same label that is associated with a mesh point that corresponds to that very same data point?

Thanks!
Andreas

P.S.:
Extracting and outputting the data into a external file has been accomplished by:

Code:

#include "OFstream.H"
OFstream testout ("densitydata");

//start time loop

Code:

forAll(rho,rholbl)
{
  scalar rhoi = rho[rholbl];
  Vector<double> rhopos = mesh.points()[rholbl];
  testout << "rho:" << rhoi << ":" << rholbl << ":" << rhopos << endl;
  rho[rholbl] = rhoi;
}

//end time loop

which will result in the following output:

rhoi: data point value
rholbl: rho-label associated with that datapoint
rhopos: grid point location (coordinates) associated with that label

"rho":rhoi:rholbl:rhopos

Code:

rho:1.17195:0:(-0.5 0 -0.01)
rho:1.17195:1:(-0.493333 0 -0.01)
rho:1.17195:2:(-0.486667 0 -0.01)
rho:1.17195:3:(-0.48 0 -0.01)
rho:1.17195:4:(-0.473333 0 -0.01)
rho:1.17195:5:(-0.466667 0 -0.01)
rho:1.17195:6:(-0.46 0 -0.01)
rho:1.17195:7:(-0.453333 0 -0.01)
rho:1.17195:8:(-0.446667 0 -0.01)
rho:1.17195:9:(-0.44 0 -0.01)
rho:1.17195:10:(-0.433333 0 -0.01)
rho:1.17195:11:(-0.426667 0 -0.01)
etc.
etc.
...

myfireFoam.C attached.


All times are GMT -4. The time now is 07:34.