void Foam::fvMesh::mapOldVolumes(const mapPolyMesh& meshMap) { const labelList& cellMap = meshMap.cellMap(); // Map the old volume. Just map to new cell labels. if (V0Ptr_) { if (debug) { InfoIn("void fvMesh::mapOldVolumes(const mapPolyMesh& meshMap)") << "Mapping old cell volumes." << endl; } scalarField& V0 = *V0Ptr_; scalarField savedV0(V0); V0.setSize(nCells()); forAll (V0, i) { if (cellMap[i] > -1) { V0[i] = savedV0[cellMap[i]]; } else { V0[i] = 0.0; } } } // Map the old-old volume. Just map to new cell labels. if (V00Ptr_) { if (debug) { InfoIn("void fvMesh::mapOldVolumes(const mapPolyMesh& meshMap)") << "Mapping old-old cell volumes." << endl; } scalarField& V00 = *V00Ptr_; scalarField savedV00(V00); V00.setSize(nCells()); forAll (V00, i) { if (cellMap[i] > -1) { V00[i] = savedV00[cellMap[i]]; } else { V00[i] = 0.0; } } } }
void Foam::fvMesh::mapFields(const mapPolyMesh& meshMap) { // Create a mapper const fvMeshMapper mapper(*this, meshMap); // Map all the volFields in the objectRegistry MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh> (mapper); MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh> (mapper); MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh> (mapper); MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh> (mapper); MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh> (mapper); // Map all the surfaceFields in the objectRegistry MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh> (mapper); MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh> (mapper); MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh> (mapper); MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh> (mapper); MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh> (mapper); // Map all the clouds in the objectRegistry mapClouds(*this, meshMap); const labelList& cellMap = meshMap.cellMap(); // Map the old volume. Just map to new cell labels. if (V0Ptr_) { scalarField& V0 = *V0Ptr_; scalarField savedV0(V0); V0.setSize(nCells()); forAll(V0, i) { if (cellMap[i] > -1) { V0[i] = savedV0[cellMap[i]]; } else { V0[i] = 0.0; } } } // Map the old-old volume. Just map to new cell labels. if (V00Ptr_) { scalarField& V00 = *V00Ptr_; scalarField savedV00(V00); V00.setSize(nCells()); forAll(V00, i) { if (cellMap[i] > -1) { V00[i] = savedV00[cellMap[i]]; } else { V00[i] = 0.0; } } } }