Go to the documentation of this file.
48 constructAndWriteSensitivityField<scalar>
60 constructAndWriteSensitivityField<vector>
70 constructAndWriteSensitivityField<vector>
83 if (wallPointSensNormalPtr_.valid())
85 constructAndWriteSensitivtyPointField<scalar>
87 wallPointSensNormalPtr_,
88 "pointSensNormal" + surfaceFieldSuffix_
95 if (writeAllSurfaceFiles_)
98 if (wallPointSensVecPtr_.valid())
100 constructAndWriteSensitivtyPointField<vector>
102 wallPointSensVecPtr_,
103 "pointSensVec" + surfaceFieldSuffix_
108 if (wallPointSensNormalVecPtr_.valid())
110 constructAndWriteSensitivtyPointField<vector>
112 wallPointSensNormalVecPtr_,
113 "pointSensNormalVec" + surfaceFieldSuffix_
124 Foam::shapeSensitivitiesBase::shapeSensitivitiesBase
132 writeAllSurfaceFiles_
136 "writeAllSurfaceFiles",
147 wallFaceSensVecPtr_(
nullptr),
148 wallFaceSensNormalPtr_(
nullptr),
149 wallFaceSensNormalVecPtr_(
nullptr),
151 wallPointSensVecPtr_(
nullptr),
152 wallPointSensNormalPtr_(
nullptr),
153 wallPointSensNormalVecPtr_(
nullptr)
162 return sensitivityPatchIDs_;
171 sensitivityPatchIDs_ = sensPatchIDs;
178 if (wallFaceSensVecPtr_.valid())
182 if (wallFaceSensNormalVecPtr_.valid())
186 if (wallFaceSensNormalPtr_.valid())
188 wallFaceSensNormalPtr_() = scalar(0);
192 if (wallPointSensVecPtr_.valid())
194 for (
vectorField& patchSens : wallPointSensVecPtr_())
199 if (wallPointSensNormalVecPtr_.valid())
201 for (
vectorField& patchSens : wallPointSensNormalVecPtr_())
206 if (wallPointSensNormalPtr_.valid())
208 for (
scalarField& patchSens : wallPointSensNormalPtr_())
210 patchSens = scalar(0);
218 writeFaceBasedSens();
219 writePointBasedSens();
225 surfaceFieldSuffix_ = suffix;
232 if (wallFaceSensVecPtr_.valid())
235 constructVolSensitivtyField<vector>
238 "faceSensVec" + surfaceFieldSuffix_
244 <<
" no faceSensVec boundary field. Returning zero" <<
endl;
249 createZeroFieldPtr<vector>
252 "faceSensVec" + surfaceFieldSuffix_,
263 if (wallFaceSensNormalPtr_.valid())
266 constructVolSensitivtyField<scalar>
268 wallFaceSensNormalPtr_,
269 "faceSensNormal" + surfaceFieldSuffix_
275 <<
" no wallFaceSensNormal boundary field. Returning zero" <<
endl;
280 createZeroFieldPtr<scalar>
283 "faceSensNormal" + surfaceFieldSuffix_,
dimless
293 if (wallFaceSensNormalVecPtr_.valid())
296 constructVolSensitivtyField<vector>
298 wallFaceSensNormalVecPtr_,
299 "faceSensNormalVec" + surfaceFieldSuffix_
305 <<
" no wallFaceSensNormalVec boundary field. Returning zero"
311 createZeroFieldPtr<vector>
314 "faceSensNormalVec" + surfaceFieldSuffix_,
328 return (volPointInter.
interpolate(tWallFaceSensVec));
338 return (volPointInter.
interpolate(tWallFaceSensNormal));
348 return (volPointInter.
interpolate(tWallFaceSensNormalVec));
355 return wallFaceSensVecPtr_();
362 return wallFaceSensNormalPtr_();
369 return wallFaceSensNormalVecPtr_();
void writePointBasedSens() const
Write point-based sensitivities, if present.
virtual const boundaryVectorField & getWallFaceSensNormalVecBoundary() const
Get wall face normal sens as vectors field.
const labelHashSet & sensitivityPatchIDs() const
Get patch IDs on which sensitivities are computed.
tmp< volVectorField > getWallFaceSensVec()
Get wall face sensitivity vectors field.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
autoPtr< boundaryVectorField > wallFaceSensVecPtr_
Wall face sens w.r.t. (x,y.z)
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
tmp< pointVectorField > getWallPointSensNormalVec()
Get wall point sens as vectors field.
autoPtr< boundaryScalarField > wallFaceSensNormalPtr_
Wall face sens projected to normal.
tmp< pointScalarField > getWallPointSensNormal()
Get wall point sensitivity projected to normal field.
tmp< volVectorField > getWallFaceSensNormalVec()
Get wall face normal sens as vectors field.
Base class supporting shape sensitivity derivatives for incompressible flows.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual const boundaryVectorField & getWallFaceSensVecBoundary() const
Get wall face sensitivity vectors field.
autoPtr< boundaryVectorField > wallFaceSensNormalVecPtr_
Normal sens as vectors.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
bool writeAllSurfaceFiles_
tmp< volScalarField > getWallFaceSensNormal()
Get wall face sensitivity projected to normal field.
void write()
Write sensitivity fields.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void setSensitivityPatchIDs(const labelHashSet &sensPatchIDs)
Overwrite sensitivityPatchIDs.
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
virtual const boundaryScalarField & getWallFaceSensNormalBoundary() const
Get wall face sensitivity projected to normal field.
void clearSensitivities()
Zero sensitivity fields and their constituents.
A List of wordRe with additional matching capabilities.
void writeFaceBasedSens() const
Write face-based sensitivities, if present.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
static const word null
An empty word.
static const Vector< scalar > zero
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
void setSuffix(const word &suffix)
Set suffix.
defineTypeNameAndDebug(combustionModel, 0)
Interpolate from cell centres to points (vertices) using inverse distance weighting.
#define WarningInFunction
Report a warning using Foam::Warning.
tmp< pointVectorField > getWallPointSensVec()
Get wall point sensitivity vectors field.