48 constructAndWriteSensitivityField<scalar>
60 constructAndWriteSensitivityField<vector>
70 constructAndWriteSensitivityField<vector>
83 if (wallPointSensNormalPtr_)
85 constructAndWriteSensitivtyPointField<scalar>
87 wallPointSensNormalPtr_,
88 "pointSensNormal" + surfaceFieldSuffix_
95 if (writeAllSurfaceFiles_)
98 if (wallPointSensVecPtr_)
100 constructAndWriteSensitivtyPointField<vector>
102 wallPointSensVecPtr_,
103 "pointSensVec" + surfaceFieldSuffix_
108 if (wallPointSensNormalVecPtr_)
110 constructAndWriteSensitivtyPointField<vector>
112 wallPointSensNormalVecPtr_,
113 "pointSensNormalVec" + surfaceFieldSuffix_
124 Foam::shapeSensitivitiesBase::shapeSensitivitiesBase
131 surfaceFieldSuffix_(
word::null),
132 writeAllSurfaceFiles_
134 dict.getOrDefault<bool>
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_)
180 wallFaceSensVecPtr_() = vector::zero;
182 if (wallFaceSensNormalVecPtr_)
184 wallFaceSensNormalVecPtr_() = vector::zero;
186 if (wallFaceSensNormalPtr_)
188 wallFaceSensNormalPtr_() = scalar(0);
192 if (wallPointSensVecPtr_)
194 for (
vectorField& patchSens : wallPointSensVecPtr_())
196 patchSens = vector::zero;
199 if (wallPointSensNormalVecPtr_)
201 for (
vectorField& patchSens : wallPointSensNormalVecPtr_())
203 patchSens = vector::zero;
206 if (wallPointSensNormalPtr_)
208 for (
scalarField& patchSens : wallPointSensNormalPtr_())
210 patchSens = scalar(0);
218 writeFaceBasedSens();
219 writePointBasedSens();
225 surfaceFieldSuffix_ = suffix;
232 if (wallFaceSensVecPtr_)
235 constructVolSensitivtyField<vector>
238 "faceSensVec" + surfaceFieldSuffix_
244 <<
" no faceSensVec boundary field. Returning zero" <<
endl;
249 createZeroFieldPtr<vector>
252 "faceSensVec" + surfaceFieldSuffix_,
263 if (wallFaceSensNormalPtr_)
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_)
296 constructVolSensitivtyField<vector>
298 wallFaceSensNormalVecPtr_,
299 "faceSensNormalVec" + surfaceFieldSuffix_
305 <<
" no wallFaceSensNormalVec boundary field. Returning zero" 311 createZeroFieldPtr<vector>
314 "faceSensNormalVec" + surfaceFieldSuffix_,
325 tmp<volVectorField> tWallFaceSensVec = getWallFaceSensVec();
328 return (volPointInter.interpolate(tWallFaceSensVec));
338 return (volPointInter.interpolate(tWallFaceSensNormal));
348 return (volPointInter.interpolate(tWallFaceSensNormalVec));
355 return wallFaceSensVecPtr_();
362 return wallFaceSensNormalPtr_();
369 return wallFaceSensNormalVecPtr_();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
void writeFaceBasedSens() const
Write face-based sensitivities, if present.
A class for handling keywords in dictionaries.
tmp< volVectorField > getWallFaceSensVec()
Get wall face sensitivity vectors field.
void setSuffix(const word &suffix)
Set suffix.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< volVectorField > getWallFaceSensNormalVec()
Get wall face normal sens as vectors field.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelHashSet & sensitivityPatchIDs() const
Get patch IDs on which sensitivities are computed.
autoPtr< boundaryVectorField > wallFaceSensNormalVecPtr_
Normal sens as vectors.
const dimensionSet dimless
Dimensionless.
autoPtr< boundaryVectorField > wallFaceSensVecPtr_
Wall face sens w.r.t. (x,y.z)
Macros for easy insertion into run-time selection tables.
autoPtr< boundaryScalarField > wallFaceSensNormalPtr_
Wall face sens projected to normal.
bool writeAllSurfaceFiles_
virtual const boundaryVectorField & getWallFaceSensNormalVecBoundary() const
Get wall face normal sens as vectors field.
virtual const boundaryVectorField & getWallFaceSensVecBoundary() const
Get wall face sensitivity vectors field.
tmp< pointVectorField > getWallPointSensNormalVec()
Get wall point sens as vectors field.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const boundaryScalarField & getWallFaceSensNormalBoundary() const
Get wall face sensitivity projected to normal field.
A List of wordRe with additional matching capabilities.
void writePointBasedSens() const
Write point-based sensitivities, if present.
Interpolate from cell centres to points (vertices) using inverse distance weighting.
tmp< volScalarField > getWallFaceSensNormal()
Get wall face sensitivity projected to normal field.
tmp< pointVectorField > getWallPointSensVec()
Get wall point sensitivity vectors field.
defineTypeNameAndDebug(combustionModel, 0)
void write()
Write sensitivity fields.
#define WarningInFunction
Report a warning using Foam::Warning.
void setSensitivityPatchIDs(const labelHashSet &sensPatchIDs)
Overwrite sensitivityPatchIDs.
void clearSensitivities()
Zero sensitivity fields and their constituents.
Mesh data needed to do the Finite Volume discretisation.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
tmp< pointScalarField > getWallPointSensNormal()
Get wall point sensitivity projected to normal field.