pointConstraints.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) 2013-2016 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
26Class
27 Foam::pointConstraints
28
29Description
30 Application of (multi-)patch point constraints.
31
32 Note: includes all points which are on the boundary of a patch
33 with a constraint. It includes them (even though the constraint
34 will already be implemented through the patch evaluation)
35 since these points might be
36 coupled to points which are not on any constraint patch and we
37 don't want to get inconsistency between the two points.
38
39SourceFiles
40 pointConstraints.C
41 pointConstraintsTemplates.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef pointConstraints_H
46#define pointConstraints_H
47
48#include "MeshObject.H"
49#include "tensorField.H"
50#include "pointFieldsFwd.H"
51#include "pointConstraint.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58class pointMesh;
59class polyMesh;
60
61/*---------------------------------------------------------------------------*\
62 Class pointConstraints Declaration
63\*---------------------------------------------------------------------------*/
66:
67 public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints>
68{
69 // Private data
70
71 // Patch-patch constraints
72
73 //- Mesh points on which to apply special constraints
74 labelList patchPatchPointConstraintPoints_;
75 //- Special constraints (as tensors)
76 tensorField patchPatchPointConstraintTensors_;
77 //- Special constraints (raw)
78 List<pointConstraint> patchPatchPointConstraints_;
79
80
81 // Private Member Functions
82
83 //- Make patch-patch constraints
84 void makePatchPatchAddressing();
85
86 //- No copy construct
87 pointConstraints(const pointConstraints&) = delete;
88
89 //- No copy assignment
90 void operator=(const pointConstraints&) = delete;
91
92
93public:
94
95 // Declare name of the class and its debug switch
96 ClassName("pointConstraints");
97
98
99 // Constructors
100
101 //- Constructor from pointMesh.
102 explicit pointConstraints(const pointMesh&);
103
104
105 //- Destructor
107
108
109 // Member functions
110
111 // Access
112
113 //- Mesh points on which to apply special constraints
115 {
116 return patchPatchPointConstraintPoints_;
117 }
118
119 //- Special constraints
121 {
122 return patchPatchPointConstraintTensors_;
123 }
124
125 //- Actual constraints
127 {
128 return patchPatchPointConstraints_;
129 }
130
131
132 // Edit
133
134 //- Update mesh topology using the morph engine
135 void updateMesh(const mapPolyMesh&);
136
137 //- Correct weighting factors for moving mesh.
138 bool movePoints();
139
140
141 // Interpolation functions
142
143 //- Helper: sync data on collocated points only
144 template<class Type, class CombineOp>
145 static void syncUntransformedData
146 (
147 const polyMesh& mesh,
148 List<Type>& pointData,
149 const CombineOp& cop
150 );
151
152 //- Helper: set patchField values from internal values (on
153 // valuePointPatchFields). Opposite of
154 // pointPatchField::setInInternalField
155 template<class Type>
156 static void setPatchFields
157 (
159 );
160
161 //- Apply patch-patch constraints only
162 template<class Type>
164 (
166 ) const;
167
168 //- Apply boundary conditions (single-patch constraints) and
169 // patch-patch constraints on generic pointField.
170 // Optionally override valuePointPatchFields with constrained
171 // values (see setPatchFields above)
172 template<class Type>
173 void constrain
174 (
176 const bool overrideValue = false
177 ) const;
178
179 //- Apply boundary conditions (single-patch constraints),
180 // patch-patch constraints and
181 // two-D constraints on displacement field
183 (
184 pointVectorField& displacement,
185 const bool overrideValue = false
186 ) const;
187};
188
189
190template<>
191void pointConstraints::constrainCorners<scalar>
192(
194) const;
195template<>
196void pointConstraints::constrainCorners<label>
197(
199) const;
200
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204} // End namespace Foam
205
206// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207
208#ifdef NoRepository
210#endif
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214#endif
215
216// ************************************************************************* //
Generic GeometricField class.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:91
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Application of (multi-)patch point constraints.
bool movePoints()
Correct weighting factors for moving mesh.
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
static void setPatchFields(GeometricField< Type, pointPatchField, pointMesh > &)
Helper: set patchField values from internal values (on.
ClassName("pointConstraints")
const tensorField & patchPatchPointConstraintTensors() const
Special constraints.
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
const List< pointConstraint > & patchPatchPointConstraints() const
Actual constraints.
~pointConstraints()
Destructor.
void constrainCorners(GeometricField< Type, pointPatchField, pointMesh > &pf) const
Apply patch-patch constraints only.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
void updateMesh(const mapPolyMesh &)
Update mesh topology using the morph engine.
const labelList & patchPatchPointConstraintPoints() const
Mesh points on which to apply special constraints.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:55
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
Namespace for OpenFOAM.
Forwards and collection of common point field types.