|
[Sponsors] |
August 27, 2012, 05:58 |
Map fields every time step
|
#1 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
Dear all,
I would like to solve different equations on different domains. The equations couple through their RHSs wherever the domains overlap. I therefore need to interpolate/map fields from one domain to the other at every time step. For a single CPU this is quite easy to implement: Code:
#include meshToMesh.H meshToMesh mapper(meshSource, meshTarget, patchMap, cuttingPatches); mapper.interpolate(fieldTarget, fieldSource); So I create a list of pointers to my meshes/fields: Code:
List< fvMesh* > sourceMeshes(Pstream::nProcs()); sourceMeshes[Pstream::myProcNo()] = &meshSource; Code:
Pstream::gatherList(sourceMeshes); Code:
/nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C: In static member function ‘static void Foam::Pstream::gatherList(const Foam::List<Foam::UPstream::commsStruct>&, Foam::List<T>&, int) [with T = Foam::fvMesh*]’: /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:187:9: instantiated from ‘static void Foam::Pstream::gatherList(Foam::List<T>&, int) [with T = Foam::fvMesh*]’ myLaplacianFoam.C:58:37: instantiated from here /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:101:17: error: no match for ‘operator>>’ in ‘fromBelow >> ((Foam::List<Foam::fvMesh*>*)Values)->Foam::List<Foam::fvMesh*>::<anonymous>.Foam::UList<T>::operator[] [with T = Foam::fvMesh*, Foam::label = int](belowID)’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/scalarRange.H:135:25: note: candidates are: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::scalarRange&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/septernion.H:146:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::septernion&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/quaternion.H:174:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::quaternion&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/vectorTensorTransform.H:167:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::vectorTensorTransform&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/wordRe.H:231:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/boundBox.H:230:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::boundBox&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/nil.H:77:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::nil&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/cellShape.H:162:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::cellShape&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/faceI.H:151:23: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::face&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/SHA1Digest.H:137:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::SHA1Digest&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/instant.H:145:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::instant&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Switch.H:207:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::Switch&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionSet.H:302:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::dimensionSet&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dictionary.H:507:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::dictionary&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/long.H:56:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, long int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Istream.H:170:17: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::IOstream& (*)(Foam::IOstream&)) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Istream.H:164:17: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::Istream& (*)(Foam::Istream&)) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/token.H:421:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::token&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/fileName.H:188:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::fileName&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Scalar.H:306:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::doubleScalar&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Scalar.H:306:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::floatScalar&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/uint.H:56:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, unsigned int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/bool.H:48:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, bool&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/int.H:57:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/word.H:133:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/string.H:219:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::string&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/char.H:49:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, char&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:114:21: error: no match for ‘operator>>’ in ‘fromBelow >> ((Foam::List<Foam::fvMesh*>*)Values)->Foam::List<Foam::fvMesh*>::<anonymous>.Foam::UList<T>::operator[] [with T = Foam::fvMesh*, Foam::label = int](leafID)’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/scalarRange.H:135:25: note: candidates are: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::scalarRange&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/septernion.H:146:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::septernion&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/quaternion.H:174:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::quaternion&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/vectorTensorTransform.H:167:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::vectorTensorTransform&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/wordRe.H:231:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/boundBox.H:230:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::boundBox&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/nil.H:77:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::nil&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/cellShape.H:162:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::cellShape&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/faceI.H:151:23: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::face&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/SHA1Digest.H:137:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::SHA1Digest&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/instant.H:145:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::instant&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Switch.H:207:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::Switch&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionSet.H:302:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::dimensionSet&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dictionary.H:507:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::dictionary&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/long.H:56:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, long int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Istream.H:170:17: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::IOstream& (*)(Foam::IOstream&)) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Istream.H:164:17: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::Istream& (*)(Foam::Istream&)) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/token.H:421:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::token&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/fileName.H:188:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::fileName&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Scalar.H:306:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::doubleScalar&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Scalar.H:306:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::floatScalar&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/uint.H:56:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, unsigned int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/bool.H:48:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, bool&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/int.H:57:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, int&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/word.H:133:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/string.H:219:25: note: Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::string&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/char.H:49:10: note: Foam::Istream& Foam::operator>>(Foam::Istream&, char&) Sebastian |
|
August 27, 2012, 06:36 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hi,
could you give the line(s) of code where the error occurs, i.e somewhere around myLaplacianFoam.C:58:37? |
|
August 27, 2012, 06:43 |
|
#3 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
Dear Arnoldinho,
it is exactly the call to Code:
Pstream::gatherList(sourceMeshes); |
|
August 27, 2012, 06:55 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hmm, then I have no clue. Have you tried it with a "standard" list first instead of pointers, like given in http://www.cfd-online.com/Forums/openfoam/77465-combining-lists-distributed-amongst-processors.html?
Arne |
|
August 27, 2012, 07:19 |
|
#5 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
If I use
Code:
List<fvMesh> sourceMeshes(Pstream::nProcs()); Code:
sourceMeshes[Pstream:myProcNo()] = sourceMesh; Code:
/nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H: In function ‘int main(int, char**)’: /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:160:14: error: ‘void Foam::fvMesh::operator=(const Foam::fvMesh&)’ is private myLaplacianFoam.C:58:41: error: within this context In file included from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/List.H:259:0, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/labelList.H:48, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/UPstream.H:43, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Pstream.H:42, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/parRun.H:35, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:4, from myLaplacianFoam.C:32: /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/List.C: In constructor ‘Foam::List<T>::List(Foam::label) [with T = Foam::fvMesh, Foam::label = int]’: myLaplacianFoam.C:57:48: instantiated from here /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/List.C:56:9: error: no matching function for call to ‘Foam::fvMesh::fvMesh()’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:194:9: note: candidates are: Foam::fvMesh::fvMesh(const Foam::IOobject&, const Foam::Xfer<Foam::Field<Foam::Vector<double> > >&, const Foam::Xfer<Foam::List<Foam::face> >&, const Foam::Xfer<Foam::List<Foam::cell> >&, bool) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:182:9: note: Foam::fvMesh::fvMesh(const Foam::IOobject&, const Foam::Xfer<Foam::Field<Foam::Vector<double> > >&, const Foam::Xfer<Foam::List<Foam::face> >&, const Foam::Xfer<Foam::List<int> >&, const Foam::Xfer<Foam::List<int> >&, bool) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:178:18: note: Foam::fvMesh::fvMesh(const Foam::IOobject&) /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:157:9: note: Foam::fvMesh::fvMesh(const Foam::fvMesh&) In file included from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Pstream.H:309:0, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/parRun.H:35, from /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:4, from myLaplacianFoam.C:32: /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H: In static member function ‘static void Foam::Pstream::gatherList(const Foam::List<Foam::UPstream::commsStruct>&, Foam::List<T>&, int) [with T = Foam::fvMesh]’: /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:187:9: instantiated from ‘static void Foam::Pstream::gatherList(Foam::List<T>&, int) [with T = Foam::fvMesh]’ myLaplacianFoam.C:59:37: instantiated from here /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:160:14: error: ‘void Foam::fvMesh::operator=(const Foam::fvMesh&)’ is private /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:91:17: error: within this context /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:160:14: error: ‘void Foam::fvMesh::operator=(const Foam::fvMesh&)’ is private /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:95:21: error: within this context /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:101:17: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:105:21: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:114:21: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:118:25: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:135:17: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:160:14: error: ‘void Foam::fvMesh::operator=(const Foam::fvMesh&)’ is private /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:143:17: error: within this context /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvMesh.H:160:14: error: ‘void Foam::fvMesh::operator=(const Foam::fvMesh&)’ is private /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:147:21: error: within this context /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:162:17: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:170:25: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ /nfs/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/gatherScatterList.C:174:21: error: ‘Foam::dictionary’ is an ambiguous base of ‘Foam::fvMesh’ |
|
August 27, 2012, 07:47 |
|
#6 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Where and how did you define your "sourceMesh"?
Further, you have an error in "sourceMeshes[Pstream:myProcNo()] = sourceMesh;" as you are missing a ":" in Pstream::myProcNo(). But the problem is your "void Foam::fvMesh:perator=(const Foam::fvMesh&)’ is private" error. With my hint of using a normal scalar list, I meant just a scalar list with fictitious values, in order to check whether you overall implementation is right or if there is a problem with sharing meshes. As a second step, I would try to populate your real mesh values. Arne Last edited by Arnoldinho; August 27, 2012 at 08:11. |
|
August 27, 2012, 08:20 |
|
#7 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
Sorry, sourceMeshes[Pstream:myProcNo()] is just a typo in the posting. It is correct in the code.
The meshes are different regions registered at the same runTime object. E.g. Code:
FOAM::fvMesh meshSource ( Foam::IOobject ( "regionSource", runTime.timeName(), runTime, Foam::IOobject::MUST_READ ) ); Code:
volScalarField TSource ( IOobject ( "T", runTime.timeName(), meshSource, IOobject::MUST_READ, IOobject::AUTO_WRITE, ), meshSource ); |
|
August 27, 2012, 10:02 |
|
#8 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
It works with an integer list where I store e.g. the processor IDs.
|
|
August 27, 2012, 10:16 |
|
#9 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hmm. Then I can only guess or presume that the gather function has been written for particular types only - and that your mesh structure there is not supported. But this is just a guess...
Arne |
|
September 3, 2012, 05:34 |
|
#10 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
Apparently fvMesh (and hence the fields that live on the mesh) lack the constructor from IStream and the OStream << operator.
Any idea how to sove this without reimplementing the fvMesh class? |
|
September 12, 2012, 11:32 |
|
#11 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
OK. I have an idea for a not-so-quick but dirty work-around.
If I use manual decomposition and make sure that the bits of the two meshes on each processor overlap, I side-step the whole problem of inter-processor communication. However, this requires some compromise regarding mesh quality and decomposition optimality. Let's see how this works... |
|
September 24, 2012, 04:01 |
|
#12 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
It works. And with the use of funkySetfields (and a small script) the pre-processing is not too tedious either.
However, I want to perform a volume averaging when mapping from the fine grid to the coarse one. Therefore, I need to write my on meshToMesh anyway. From what I've seen from the code it looks like it can be easiliy parallellized by means of reduce options. I have no idea how fast or slow this will be due to the additional inter-processor communication... |
|
October 26, 2012, 19:31 |
|
#13 | |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Dear All
I want to use the command below Code:
meshToMesh meshToMeshInterpb(newMesh, mesh); const fvMesh& meshSource = meshToMeshInterpb.fromMesh(); const fvMesh& meshTarget = meshToMeshInterpb.toMesh(); meshToMeshInterp.interpolate(p,pn,meshToMesh::INTERPOLATE); meshToMeshInterp.interpolate(U,Un,meshToMesh::INTERPOLATE); I have both volscalar and volvector and surfacescalar. but when I am trying to run my case even on the first iteration. Quote:
best mahdi |
||
October 27, 2012, 10:48 |
|
#14 |
New Member
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14 |
Dear Mahdi,
is p defined on mesh and pn on newMesh, respectively? The order of source and target field in the interpolate function is different from the order of source and target mesh in the constructor... which is somewhat counter intuitive. |
|
October 27, 2012, 12:23 |
|
#15 |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Dear sebas
Thanks for your reply. Yes p and pn are defined on the mesh and meshnew receptively. and I have checked the order of source and target. But its giving the same error. Best Mahdi |
|
November 2, 2012, 08:08 |
|
#16 | |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Quote:
I have solved that problem ... but no data in maped FROM my first mesh to meshNew!!!!. best mahdi |
||
December 5, 2012, 14:13 |
|
#17 |
Member
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 44
Rep Power: 16 |
Hey Sebas,
Did you manage to figure this out? I need a similar capability now. Essentially it all seems to boil down to creating a parallel implementation of the mapFields utility. ganesh |
|
December 5, 2012, 14:13 |
|
#18 |
Member
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 44
Rep Power: 16 |
Hey Sebas,
Did you manage to figure this out? I need a similar capability now. Essentially it all seems to boil down to creating a parallel implementation of the mapFields utility. ganesh |
|
Tags |
map fields, multiple meshes, parallel, pstream |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating point exception error | Alan | OpenFOAM Running, Solving & CFD | 11 | July 1, 2021 22:51 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
SLTS+rhoPisoFoam: what is rDeltaT??? | nileshjrane | OpenFOAM Running, Solving & CFD | 4 | February 25, 2013 05:13 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 08:56 |