Loading...
Searching...
No Matches
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"
36// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37
38namespace Foam
39{
40
41template<template<class> class CombineOp>
42void MapMesh
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 // ~~~~~~~~~~~~~
58 (
59 objects,
60 selectedFields,
61 interp,
62 CombineOp<scalar>()
63 );
64
66 (
67 objects,
68 selectedFields,
69 interp,
70 CombineOp<vector>()
71 );
73 (
74 objects,
75 selectedFields,
76 interp,
77 CombineOp<sphericalTensor>()
78 );
80 (
81 objects,
82 selectedFields,
83 interp,
84 CombineOp<symmTensor>()
85 );
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 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
109 // Mark pointFields as unmapped
110 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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. Implemented as a HashTable,...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Definition Time.C:714
Class to calculate the cell-addressing between two overlapping meshes.
Definition meshToMesh.H:61
const polyMesh & srcRegion() const
Return const access to the source mesh.
Definition meshToMeshI.H:26
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition meshToMeshI.H:32
const Time & time() const noexcept
Return time registry.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
Maps lagrangian positions and fields.
Namespace for OpenFOAM.
void MapVolFields(const IOobjectList &objects, const meshToMesh0 &meshToMesh0Interp, const meshToMesh0::order &mapOrder, const CombineOp &cop)
void MapMesh(const meshToMesh &interp, const wordRes &selectedFields, const bool noLagrangian)
Definition MapMeshes.H:36
void UnMapped(const IOobjectList &objects)
Definition UnMapped.H:34
void mapLagrangian(const meshToMesh0 &meshToMesh0Interp)
Maps lagrangian positions and fields.