CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Running mapFields with Parallel Source and Parallel Target (https://www.cfd-online.com/Forums/openfoam-pre-processing/85353-running-mapfields-parallel-source-parallel-target.html)

RDanks February 23, 2011 15:47

Running mapFields with Parallel Source and Parallel Target
 
Hello Foamers,

Basically my problem is that I want to decompose a case, run it out for a certain number of iterations, refine where needed using a cellSet by field and then refineMesh (both with -parallel), map the coarse mesh's fields onto the finer mesh and then continue, I was hoping to do all of this without reconstructing the mesh. (By the way I'm working in OF 1.7.1.)

My only sticking point so far is the fact that when I run mapFields with the -parallelSource and -parallelTarget flags the command throws some warnings (see output below) and nothing is written out in the target directory. It looks to me like each of the source processor directories tries to map to each of the target processor directories, which doesn't make sense.

I make the call like this from the target case directory...
Code:

mapFields ../test1 -parallelTarget -consistent -sourceTime latestTime -parallelSource
The geometry is consistent between the two meshes, the only difference is the refined mesh in the target case. I've checked in paraview and the refinement worked correctly. I've also tried running this without the -consistent flag and with a dict file explicitly mapping each boundary to itself and it still doesn't work.

Does anyone have any experience working with mapFields in parallel? I have no clue what I'm doing wrong!

Thanks.

Code:

Create databases as time

Source processor 0

Source time: 20
Target time: 20
mesh size: 50580

Target processor 0
mesh size: 50580
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch inlet has no faces. Not performing mapping for it.
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch cube has no faces. Not performing mapping for it.

Mapping fields for time 20


Target processor 1
mesh size: 51112
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch inlet has no faces. Not performing mapping for it.
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch cube has no faces. Not performing mapping for it.

Mapping fields for time 20


Source processor 1

Source time: 20
Target time: 20
mesh size: 50545

Target processor 0
mesh size: 50580
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch outlet has no faces. Not performing mapping for it.

Mapping fields for time 20


Target processor 1
mesh size: 51112
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch outlet has no faces. Not performing mapping for it.

Mapping fields for time 20


End


RDanks February 24, 2011 14:32

Updates!
 
I don't want to be one of those people that solve the problem and don't tell anyone else how they did it...

Basically what I did was rather than use the -parallelSource and -parallelTarget flags, I ran map fields on each processor directory individually. So the call from the source case directory was:
Code:

mapFields ../TargetCase/processorX -case processorX  -sourceTime latestTime -consistent
Where X was each processor number.

The odd thing is that I would assume this is exactly how it would work if both the -parallelSource and -parallelTarget flags were set. Anyone know if this is a bug in the OF 1.7.1 code?

David* June 6, 2011 07:56

Similar problem here. I tried

Code:

mapFields ../H12 -sourceTime 8.3 -parallelSource
and got

Code:

Source time: 8.3
Target time: 8.3
mesh size: 259882
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch inlet has no faces. Not performing mapping for it.
--> FOAM Warning :
    From function meshToMesh::calcAddressing()
    in file meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C at line 164
    Source patch structure has no faces. Not performing mapping for it.

Mapping fields for time 8.3

    interpolating nut
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigSegv::sigSegvHandler(int) in "/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  in "/lib/libc.so.6"
#3 
 at mapFields.C:0
#4 
 in "/opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mapFields"
#5 
 in "/opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mapFields"
#6 
 in "/opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mapFields"
#7  __libc_start_main in "/lib/libc.so.6"
#8 
 in "/opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mapFields"
Speicherzugriffsfehler (=segmentation fault)

after using -reconstructPar -time 8.3 on the source case, the problem was gone. Seems like the -parallelSource option does not work as intended.

yb8119 August 2, 2016 04:47

Hi David!

I got the same problem as described in the post, and I tried your method which is to reconstruct the source case.

Then the warnings did disappeared, however, nothing was written into processor folders.

The command I used is

Code:

mapFields ../test_parallel -parallelTarget -consistent
the output in the terminal looked like:
Code:

Create databases as time
Create source mesh

Source time: 2.5
Target time: 2.5
Source mesh size: 1600

Target processor 0
mesh size: 1016

Mapping fields for time 2.5

Target processor 1
mesh size: 584

Mapping fields for time 2.5


Do you have any idea why this happens?
Thanks in advance!

David* August 2, 2016 05:24

Sorry, it's been too long and there were many changes in OF since 2011 so I'm not up to date in this matter. If parallel mapping is still not working as intented, you could create a small test case and submit it to the bug tracker.

Cheers, David


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