76 <<
"confineMovement lists sizes "
77 << confineXmovement_.size() <<
" "
78 << confineYmovement_.size() <<
" "
79 << confineZmovement_.size() <<
" "
80 <<
"are incompatible with nBezier " << nBezier_
90 for (label iDir = 0; iDir < 3; ++iDir)
92 for (label iCP = 0; iCP <
nBezier_; ++iCP)
103 for (label iCP = 0; iCP <
nBezier_; ++iCP)
113 mesh_.time().timeName(),
167 bool returnDimensionedNormalSens
175 auto& dndbSens = tdndbSens.ref();
179 const label patchStart = ppatch.
start();
192 facePointDerivs[pI] = dxdbInt[fGlobal[pI]];
196 if (returnDimensionedNormalSens)
199 deltaBoundary.makeFaceCentresAndAreas_d
208 deltaBoundary.makeFaceCentresAndAreas_d
224 bool returnDimensionedNormalSens
227 const fvPatch&
patch =
mesh_.boundary()[patchI];
228 const polyPatch& ppatch =
patch.patch();
232 auto& dndbSens = tdndbSens.ref();
235 deltaBoundary deltaBoundary(
mesh_);
236 const label patchStart = ppatch.start();
244 const face& fGlobal =
mesh_.faces()[fI + patchStart];
251 facePointDerivs[pI] = dxdbDir[fGlobal[pI]];
255 if (returnDimensionedNormalSens)
258 deltaBoundary.makeFaceCentresAndAreas_d
260 facePoints, facePointDerivs
266 deltaBoundary.makeFaceCentresAndAreas_d
285 const polyPatch&
patch =
mesh_.boundary()[patchI].patch();
293 deltaBoundary deltaBoundary(
mesh_);
294 const label patchStart =
patch.start();
300 const face& fGlobal =
mesh_.faces()[fI + patchStart];
307 facePointDerivs[pI] = dxdbInt[fGlobal[pI]];
310 deltaBoundary.makeFaceCentresAndAreas_d
320 PrimitivePatchInterpolation<polyPatch> patchInter(patch);
321 dxdbFace = patchInter.pointToFaceInterpolate
323 dxidXj_[cpI].boundaryField()[patchI].patchInternalField()()
347 deltaBoundary deltaBoundary(
mesh_);
348 const label patchStart = patch.start();
351 dxdbDir.replace(0, dxdbInt.component(3*idir));
352 dxdbDir.replace(1, dxdbInt.component(3*idir + 1));
353 dxdbDir.replace(2, dxdbInt.component(3*idir + 2));
358 const face& fGlobal =
mesh_.
faces()[fI + patchStart];
365 facePointDerivs[pI] = dxdbDir[fGlobal[pI]];
368 deltaBoundary.makeFaceCentresAndAreas_d
378 PrimitivePatchInterpolation<polyPatch> patchInter(patch);
383 dxidXj_[cpI].boundaryField()[patchI].patchInternalField()().
386 dxdbFace = patchInter.pointToFaceInterpolate(dxdb)();
394 const label globalFaceI,
398 const face& faceI(
mesh_.
faces()[globalFaceI]);
402 fPoints_d[fpI] =
dxidXj_[cpI].primitiveField()[faceI[fpI]];
410 const label globalFaceI,
415 const face& faceI(
mesh_.
faces()[globalFaceI]);
419 const tensor& dxdbTensor =
dxidXj_[cpI].primitiveField()[faceI[fpI]];
420 fPoints_d[fpI].x() = dxdbTensor.component(3*idir);
421 fPoints_d[fpI].y() = dxdbTensor.component(3*idir + 1);
422 fPoints_d[fpI].z() = dxdbTensor.component(3*idir + 2);
Calculation of adjoint based sensitivities for Bezier control points.
boolList confineYmovement_
PtrList< pointTensorField > dxidXj_
label nBezier() const
Number of Bezier control points.
const boolList & confineZmovement() const
Confine z movement.
boolListList confineMovement_
const boolList & confineYmovement() const
Confine y movement.
const boolListList & confineMovement() const
Info about confining movement in all directions.
boolList confineXmovement_
const boolList & confineXmovement() const
Confine x movement.
labelList activeDesignVariables_
tmp< tensorField > dxdbFace(const label patchI, const label cpI, bool useChainRule=true) const
dxdb tensor for a Bezier parameterized patch
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool returnDimensionedNormalSens=true) const
Compute derivative of the normal vector for a Bezier parameterized patch.
boolList confineZmovement_
tensorField facePoints_d(const label globalFaceI, const label cpI) const
For a given (global) face ID, return the change of the face points.
PtrList< pointTensorField > & dxidXj()
dx/db tensor for all control points
const labelList & getActiveDesignVariables() const
Return active design variables.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
@ MUST_READ
Reading required.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static FOAM_NO_DANGLING_REFERENCE const pointMesh & New(const polyMesh &mesh, Args &&... args)
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void size(const label n)
Older name for setAddressableSize.
const Cmpt & component(const direction) const
Differentiation of the mesh data structure.
vectorField makeFaceCentresAndAreas_d(const pointField &p, const pointField &p_d)
Given a face and the points to be moved in the normal direction, find faceArea, faceCentre and unitVe...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A face is a list of labels corresponding to mesh vertices.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const faceList & faces() const
Return raw faces.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
label start() const noexcept
Return start label of this patch in the polyMesh face list.
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const std::string patch
OpenFOAM patch number as a std::string.
GeometricField< tensor, pointPatchField, pointMesh > pointTensorField
List< label > labelList
A List of labels.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
List< List< bool > > boolListList
List of boolList.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< bool > boolList
A List of bools.
static constexpr const zero Zero
Global zero (0).
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
void unzipRow(const FieldField< Field, SymmTensor< Cmpt > > &input, const direction idx, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field row (x,y,z) == (0,1,2).
vectorField pointField
pointField is a vectorField.
#define forAll(list, i)
Loop across all elements in list.