/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #ifndef MapMeshes_H #define MapMeshes_H #include "MapVolFields.H" #include "MapConsistentVolFields.H" #include "mapLagrangian.H" #include "UnMapped.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { template class CombineOp> void MapConsistentMesh ( const fvMesh& meshSource, const fvMesh& meshTarget, const meshToMesh0::order& mapOrder ) { // Create the interpolation scheme meshToMesh0 meshToMesh0Interp(meshSource, meshTarget); Info<< nl << "Consistently creating and mapping fields for time " << meshSource.time().timeName() << nl << endl; { // Search for list of objects for this time IOobjectList objects(meshSource, meshSource.time().timeName()); // Map volFields // ~~~~~~~~~~~~~ MapConsistentVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapConsistentVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapConsistentVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapConsistentVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapConsistentVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); } { // Search for list of target objects for this time IOobjectList objects(meshTarget, meshTarget.time().timeName()); // Mark surfaceFields as unmapped // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); // Mark pointFields as unmapped // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); } mapLagrangian(meshToMesh0Interp); } template class CombineOp> void MapSubMesh ( const fvMesh& meshSource, const fvMesh& meshTarget, const HashTable& patchMap, const wordList& cuttingPatches, const meshToMesh0::order& mapOrder ) { // Create the interpolation scheme meshToMesh0 meshToMesh0Interp ( meshSource, meshTarget, patchMap, cuttingPatches ); Info<< nl << "Mapping fields for time " << meshSource.time().timeName() << nl << endl; { // Search for list of source objects for this time IOobjectList objects(meshSource, meshSource.time().timeName()); // Map volFields // ~~~~~~~~~~~~~ MapVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); MapVolFields ( objects, meshToMesh0Interp, mapOrder, CombineOp() ); } { // Search for list of target objects for this time IOobjectList objects(meshTarget, meshTarget.time().timeName()); // Mark surfaceFields as unmapped // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); // Mark pointFields as unmapped // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); UnMapped(objects); } mapLagrangian(meshToMesh0Interp); } template class CombineOp> void MapConsistentSubMesh ( const fvMesh& meshSource, const fvMesh& meshTarget, const meshToMesh0::order& mapOrder ) { HashTable patchMap; HashTable