|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Jakub Zlamal
Join Date: Mar 2009
Posts: 1
Rep Power: 0 ![]() |
I calculated field U and I need Ux,Uy,Uz in each point of mesh (together with mesh coordinates) like
1 x y z Ux Uy Uz 2 x y z Ux Uy Uz to be able to import field to my program. Can anyone give me code to do this? I am not succesfull to do it myself and I am little bit confused from C++ because I am programming in FORTRAN. Thank for any advice Jakub Zlamal |
|
|
|
|
|
|
|
|
#2 |
|
Member
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 18 ![]() |
ave you tried something like this !
Code:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// Read U field
Info<< "Reading U field \n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
pointField C = mesh.C()
forAll(cell,U)
{
Info << C[cell] << U[Cell] << endl;
}
return(0);
}
|
|
|
|
|
|
|
|
|
#3 |
|
Member
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 18 ![]() |
or
Code:
forAll(cell,U)
{
Info << cell
<< C[cell].x()
<< C[cell].y()
<< C[cell].z()
<< U[cell].x()
<< U[cell].y()
<< U[cell].z()
<< endl;
}
|
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interpolation between faces and points of a polyPatch | hartinger | OpenFOAM Running, Solving & CFD | 12 | March 7, 2016 14:08 |
| 2D Field Panel Method Source Code | Shukla | Main CFD Forum | 3 | January 20, 2011 13:51 |
| Putting submesh field values into field on parent mesh | helmut | OpenFOAM Running, Solving & CFD | 2 | June 20, 2006 08:31 |
| Mesh hard points on faces | Ashton Peters | FLUENT | 4 | March 15, 2005 16:43 |
| Clustering points in Elliptic mesh | Doctor Blade | Main CFD Forum | 3 | October 16, 2004 12:01 |