MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / calculate

Function calculate

src/sampling/meshToMesh/meshToMesh.C:264–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262
263
264void Foam::meshToMesh::calculate(const word& methodName)
265{
266 Info<< "Creating mesh-to-mesh addressing for " << srcRegion_.name()
267 << " and " << tgtRegion_.name() << " regions using "
268 << methodName << endl;
269
270 singleMeshProc_ = calcDistribution(srcRegion_, tgtRegion_);
271
272 if (singleMeshProc_ == -1)
273 {
274 // create global indexing for src and tgt meshes
275 globalIndex globalSrcCells(srcRegion_.nCells());
276 globalIndex globalTgtCells(tgtRegion_.nCells());
277
278 // Create processor map of overlapping cells. This map gets
279 // (possibly remote) cells from the tgt mesh such that they (together)
280 // cover all of the src mesh
281 autoPtr<mapDistribute> mapPtr = calcProcMap(srcRegion_, tgtRegion_);
282 const mapDistribute& map = mapPtr();
283
284 pointField newTgtPoints;
285 faceList newTgtFaces;
286 labelList newTgtFaceOwners;
287 labelList newTgtFaceNeighbours;
288 labelList newTgtCellIDs;
289
290 distributeAndMergeCells
291 (
292 map,
293 tgtRegion_,
294 globalTgtCells,
295 newTgtPoints,
296 newTgtFaces,
297 newTgtFaceOwners,
298 newTgtFaceNeighbours,
299 newTgtCellIDs
300 );
301
302
303 // create a new target mesh
304 polyMesh newTgt
305 (
306 IOobject
307 (
308 "newTgt." + Foam::name(Pstream::myProcNo()),
309 tgtRegion_.time().timeName(),
310 tgtRegion_.time(),
311 IOobject::NO_READ
312 ),
313 xferMove(newTgtPoints),
314 xferMove(newTgtFaces),
315 xferMove(newTgtFaceOwners),
316 xferMove(newTgtFaceNeighbours),
317 false // no parallel comms
318 );
319
320 // create some dummy patch info
321 List<polyPatch*> patches(1);

Calls 15

distributeAndMergeCellsFunction · 0.85
flipOpClass · 0.85
normaliseWeightsFunction · 0.85
toGlobalMethod · 0.80
calcAddressingFunction · 0.70
polyPatchClass · 0.50
forAllFunction · 0.50
mapDistributeClass · 0.50
reduceFunction · 0.50
nameMethod · 0.45
nFacesMethod · 0.45
nInternalFacesMethod · 0.45

Tested by

no test coverage detected