CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Map fields every time step

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By sebas

Reply
 
LinkBack Thread Tools Display Modes
Old   August 27, 2012, 04:58
Default Map fields every time step
  #1
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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);
However, when this is to be run in parallel things start to get tricky. The way in which the mapFields utility does it is not really efficient as it creates copies of meshes and fields, and spends most of its time reading/writing IOobjects.

So I create a list of pointers to my meshes/fields:

Code:
List< fvMesh* > sourceMeshes(Pstream::nProcs());
sourceMeshes[Pstream::myProcNo()] = &meshSource;
I then try to gather data from all processors and perform the interpolation on the master processor:

Code:
Pstream::gatherList(sourceMeshes);
And this is where I get the following error message:

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&)
Does anybody know how to fix this? I would really appreciate your help.

Sebastian
sebas is offline   Reply With Quote

Old   August 27, 2012, 05:36
Default
  #2
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi,

could you give the line(s) of code where the error occurs, i.e somewhere around myLaplacianFoam.C:58:37?
Arnoldinho is offline   Reply With Quote

Old   August 27, 2012, 05:43
Default
  #3
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
Dear Arnoldinho,

it is exactly the call to
Code:
Pstream::gatherList(sourceMeshes);
sebas is offline   Reply With Quote

Old   August 27, 2012, 05:55
Default
  #4
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
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
Arnoldinho is offline   Reply With Quote

Old   August 27, 2012, 06:19
Default
  #5
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
If I use
Code:
List<fvMesh> sourceMeshes(Pstream::nProcs());
and
Code:
sourceMeshes[Pstream:myProcNo()] = sourceMesh;
instead of pointers, I get an error when trying to populate the list (not when gathering as before):
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’
sebas is offline   Reply With Quote

Old   August 27, 2012, 06:47
Default
  #6
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
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 07:11.
Arnoldinho is offline   Reply With Quote

Old   August 27, 2012, 07:20
Default
  #7
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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
    )
);
The fields are "living"on the respective meshes, e.g.
Code:
volScalarField TSource
(
    IOobject
    (
        "T",
        runTime.timeName(),
        meshSource,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE,
    ),
    meshSource
);
By the way, without the mapping the case runs perfectly also in parallel.
sebas is offline   Reply With Quote

Old   August 27, 2012, 09:02
Default
  #8
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
It works with an integer list where I store e.g. the processor IDs.
sebas is offline   Reply With Quote

Old   August 27, 2012, 09:16
Default
  #9
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
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
Arnoldinho is offline   Reply With Quote

Old   September 3, 2012, 04:34
Default
  #10
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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?
sebas is offline   Reply With Quote

Old   September 12, 2012, 10:32
Default
  #11
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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...
sebas is offline   Reply With Quote

Old   September 24, 2012, 03:01
Default
  #12
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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...
sebas is offline   Reply With Quote

Old   October 26, 2012, 18:31
Default
  #13
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
mm.abdollahzadeh is on a distinguished road
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 to meshs , mesh and newMesh which are the same size at the beginning ....In each iteration solution is done by the fields defined on mesh. t then meshNew will be refined according to Errorfield. then I want to map the results of fields on mesh to corrosponding fields on newMesh. then mesh will be refined to be similar to meshnew and then I want to map the newMesh on mesh.
I have both volscalar and volvector and surfacescalar.

but when I am trying to run my case even on the first iteration.

Quote:
the argument field does not correspond to the right mesh. Field size: 400 mesh size: 1600

From function meshToMesh::interpolateInternalField(Field<Type>& toF, const GeometricField<Type, fvPatchField, volMesh>& fromVf, meshToMesh:rder ord) const
in file /home/mahdi/OpenFOAM/OpenFOAM-1.7.1/src/sampling/lnInclude/meshToMeshInterpolate.C at line 147.
I will be thankful for help

best
mahdi
mm.abdollahzadeh is offline   Reply With Quote

Old   October 27, 2012, 09:48
Default
  #14
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 4
sebas is on a distinguished road
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.
sebas is offline   Reply With Quote

Old   October 27, 2012, 11:23
Default
  #15
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
mm.abdollahzadeh is on a distinguished road
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
mm.abdollahzadeh is offline   Reply With Quote

Old   November 2, 2012, 08:08
Default
  #16
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
mm.abdollahzadeh is on a distinguished road
Quote:
Originally Posted by sebas View Post
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.
Dear Sebas

I have solved that problem ... but no data in maped FROM my first mesh to meshNew!!!!.

best
mahdi
mm.abdollahzadeh is offline   Reply With Quote

Old   December 5, 2012, 14:13
Default
  #17
Member
 
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 43
Rep Power: 7
ganeshv is on a distinguished road
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
ganeshv is offline   Reply With Quote

Old   December 5, 2012, 14:13
Default
  #18
Member
 
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 43
Rep Power: 7
ganeshv is on a distinguished road
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
ganeshv is offline   Reply With Quote

Reply

Tags
map fields, multiple meshes, parallel, pstream

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 15: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 07:56
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02


All times are GMT -4. The time now is 18:21.