MapMeshes.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#ifndef MapMeshes_H
29#define MapMeshes_H
30
31#include "MapVolFields.H"
32#include "mapLagrangian.H"
33#include "UnMapped.H"
34#include "pointMesh.H"
35
36// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37
38namespace Foam
39{
40
41template<template<class> class CombineOp>
43(
44 const meshToMesh& interp,
45 const wordRes& selectedFields,
46 const bool noLagrangian
47)
48{
49 {
50 const polyMesh& meshSource = interp.srcRegion();
51
52 // Search for list of objects for this time
53 IOobjectList objects(meshSource, meshSource.time().timeName());
54
55 // Map volFields
56 // ~~~~~~~~~~~~~
57 MapVolFields<scalar>
58 (
59 objects,
60 selectedFields,
61 interp,
62 CombineOp<scalar>()
63 );
64
65 MapVolFields<vector>
66 (
67 objects,
68 selectedFields,
69 interp,
70 CombineOp<vector>()
71 );
72 MapVolFields<sphericalTensor>
73 (
74 objects,
75 selectedFields,
76 interp,
77 CombineOp<sphericalTensor>()
78 );
79 MapVolFields<symmTensor>
80 (
81 objects,
82 selectedFields,
83 interp,
84 CombineOp<symmTensor>()
85 );
86 MapVolFields<tensor>
87 (
88 objects,
89 selectedFields,
90 interp,
91 CombineOp<tensor>()
92 );
93 }
94
95 {
96 const polyMesh& meshTarget = interp.tgtRegion();
97
98 // Search for list of target objects for this time
99 IOobjectList objects(meshTarget, meshTarget.time().timeName());
100
101 // Mark surfaceFields as unmapped
102 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103 UnMapped<surfaceScalarField>(objects);
104 UnMapped<surfaceVectorField>(objects);
105 UnMapped<surfaceSphericalTensorField>(objects);
106 UnMapped<surfaceSymmTensorField>(objects);
107 UnMapped<surfaceTensorField>(objects);
108
109 // Mark pointFields as unmapped
110 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111 UnMapped<pointScalarField>(objects);
112 UnMapped<pointVectorField>(objects);
113 UnMapped<pointSphericalTensorField>(objects);
114 UnMapped<pointSymmTensorField>(objects);
115 UnMapped<pointTensorField>(objects);
116 }
117
118 if (!noLagrangian)
119 {
120 mapLagrangian(interp);
121 }
122}
123
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127} // End namespace Foam
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131#endif
132
133// ************************************************************************* //
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:59
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:65
const polyMesh & srcRegion() const
Return const access to the source mesh.
Definition: meshToMeshI.H:33
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition: meshToMeshI.H:39
const Time & time() const noexcept
Return time registry.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
Maps lagrangian positions and fields.
Namespace for OpenFOAM.
void MapMesh(const meshToMesh &interp, const wordRes &selectedFields, const bool noLagrangian)
Definition: MapMeshes.H:43
void mapLagrangian(const meshToMesh0 &meshToMesh0Interp)
Maps lagrangian positions and fields.