Loading...
Searching...
No Matches
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
58// Forward Declarations
59class pointMesh;
60class polyMesh;
62/*---------------------------------------------------------------------------*\
63 Class pointConstraints Declaration
64\*---------------------------------------------------------------------------*/
65
66class pointConstraints
67:
68 public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints>
69{
70 // Private Typedefs
71
72 typedef MeshObject
73 <
76 pointConstraints
77 > MeshObject_type;
78
79
80 // Private Data
81
82 // Patch-patch constraints
83
84 //- Mesh points on which to apply special constraints
85 labelList patchPatchPointConstraintPoints_;
86 //- Special constraints (as tensors)
87 tensorField patchPatchPointConstraintTensors_;
88 //- Special constraints (raw)
89 List<pointConstraint> patchPatchPointConstraints_;
90
91
92 // Private Member Functions
93
94 //- Make patch-patch constraints
95 void makePatchPatchAddressing();
96
97 //- No copy construct
98 pointConstraints(const pointConstraints&) = delete;
99
100 //- No copy assignment
101 void operator=(const pointConstraints&) = delete;
102
103
104public:
105
106 // Declare name of the class and its debug switch
107 ClassName("pointConstraints");
108
109
110 // Constructors
111
112 //- Constructor from pointMesh.
113 explicit pointConstraints(const pointMesh&);
115
116 //- Destructor
118
119
120 // Member functions
121
122 // Access
123
124 //- Mesh points on which to apply special constraints
126 {
127 return patchPatchPointConstraintPoints_;
128 }
129
130 //- Special constraints
132 {
133 return patchPatchPointConstraintTensors_;
134 }
135
136 //- Actual constraints
137 const List<pointConstraint>& patchPatchPointConstraints() const
139 return patchPatchPointConstraints_;
140 }
141
142
143 // Edit
144
145 //- Update mesh topology using the morph engine
147
148 //- Correct weighting factors for moving mesh.
149 bool movePoints();
150
151
152 // Interpolation functions
153
154 //- Helper: sync data on collocated points only
155 template<class Type, class CombineOp>
156 static void syncUntransformedData
157 (
158 const polyMesh& mesh,
159 List<Type>& pointData,
160 const CombineOp& cop
161 );
162
163 //- Helper: set patchField values from internal values (on
164 // valuePointPatchFields). Opposite of
165 // pointPatchField::setInInternalField
166 template<class Type>
167 static void setPatchFields
168 (
170 );
171
172 //- Apply patch-patch constraints only
173 template<class Type>
175 (
177 ) const;
178
179 //- Apply boundary conditions (single-patch constraints) and
180 // patch-patch constraints on generic pointField.
181 // Optionally override valuePointPatchFields with constrained
182 // values (see setPatchFields above)
183 template<class Type>
184 void constrain
185 (
187 const bool overrideValue = false
188 ) const;
189
190 //- Apply boundary conditions (single-patch constraints),
191 // patch-patch constraints and
192 // two-D constraints on displacement field
194 (
195 pointVectorField& displacement,
196 const bool overrideValue = false
197 ) const;
198};
199
200
201template<>
203(
205) const;
206template<>
208(
210) const;
211
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#ifdef NoRepository
221#endif
222
223// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224
225#endif
226
227// ************************************************************************* //
Generic GeometricField class.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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.
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:49
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Forwards and collection of common point field types.