39namespace incompressible
62 label nb = boxes[iNURB].getControlPoints().
size();
63 for (label cpI = 0; cpI < nb; cpI++)
67 for (
const label patchI : sensitivityPatchIDs_)
71 boxes[iNURB].dndbBasedSensitivities(patchI, cpI)
77 boxes[iNURB].dndbBasedSensitivities
98 boxes[iNURB].computeControlPointSensitivities
101 sensitivityPatchIDs_.toc()
105 forAll(sensDxDbDirect, cpI)
109 passedCPs += sensDxDbDirect.
size();
123 boxes[iNURB].computeControlPointSensitivities
126 sensitivityPatchIDs_.toc()
132 bcSens_[passedCPs + cpI] = sensBcsDxDb[cpI];
134 passedCPs += sensBcsDxDb.
size();
161 derivativesFolder_(
"optimisation"/
type() +
"Derivatives")
195 boxes[iNURB].computeControlPointSensitivities
198 sensitivityPatchIDs_.toc()
205 passedCPs += sens.
size();
259 Info<<
"Writing control point sensitivities to file" <<
endl;
270 unsigned int widthDV =
274 <<
setw(widthDV) <<
"#cp" <<
" "
275 <<
setw(width) <<
"total::x"<<
" "
276 <<
setw(width) <<
"total::y"<<
" "
277 <<
setw(width) <<
"total::z"<<
" "
278 <<
setw(width) <<
"flow::x" <<
" "
279 <<
setw(width) <<
"flow::y" <<
" "
280 <<
setw(width) <<
"flow::z" <<
" "
281 <<
setw(width) <<
"dSdb::x" <<
" "
282 <<
setw(width) <<
"dSdb::y" <<
" "
283 <<
setw(width) <<
"dSdb::z" <<
" "
284 <<
setw(width) <<
"dndb::x" <<
" "
285 <<
setw(width) <<
"dndb::y" <<
" "
286 <<
setw(width) <<
"dndb::z" <<
" "
287 <<
setw(width) <<
"dxdbDirect::x" <<
" "
288 <<
setw(width) <<
"dxdbDirect::y" <<
" "
289 <<
setw(width) <<
"dxdbDirect::z" <<
" "
290 <<
setw(width) <<
"dvdb::x" <<
" "
291 <<
setw(width) <<
"dvdb::y" <<
" "
292 <<
setw(width) <<
"dvdb::z" <<
endl;
295 label lastActive(-1);
299 label nb = boxes[iNURB].getControlPoints().
size();
300 const boolList& activeCPs = boxes[iNURB].getActiveCPs();
301 for (label iCP = 0; iCP < nb; iCP++)
305 label globalCP = passedCPs + iCP;
306 if (globalCP!=lastActive + 1)
310 lastActive = globalCP;
313 <<
setw(widthDV) << globalCP <<
" "
Istream and Ostream manipulators taking arguments.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic GeometricBoundaryField class.
static unsigned int defaultPrecision() noexcept
Return the default precision.
Output to file stream, using an OSstream.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
Base class for adjoint solvers.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool write()
Write the output fields.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Base class for incompressibleAdjoint solvers.
Base class for Surface Integral-based sensitivity derivatives.
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
sensitivitySurface surfaceSensitivity_
Surface sensitivities.
bool includeObjective_
Whether to include direct sensitivities or not.
Abstract base class for adjoint-based sensitivities in incompressible flows.
incompressibleAdjointVars & adjointVars_
virtual void assembleSensitivities()
Assemble sensitivities.
Calculation of adjoint based sensitivities at vol B-Splines control points using the SI or e-SI appro...
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
vectorField dSdbSens_
Term depending on delta(n dS)/delta b.
vectorField flowSens_
Flow related term.
vectorField dxdbDirectSens_
virtual void assembleSensitivities()
Assemble sensitivities.
vectorField bcSens_
Term dependng on the differentiation of boundary conditions.
fileName derivativesFolder_
void computeObjectiveContributions()
void computeBCContributions()
vectorField dndbSens_
Term depending on delta (n)/delta b.
volBSplinesBase & volBSplinesBase_
Reference to underlaying volumetric B-Splines morpher.
autoPtr< boundaryVectorField > dxdbDirectMult_
autoPtr< boundaryVectorField > bcDxDbMult_
autoPtr< boundaryVectorField > dnfdbMult_
autoPtr< boundaryVectorField > dSfdbMult_
Fields related to direct sensitivities.
splitCell * master() const
const word & solverName() const
Return solver name.
Class constructing a number of volumetric B-Splines boxes, read from dynamicMeshDict....
PtrList< NURBS3DVolume > & boxesRef()
Get non-const reference to the vol. B-splines boxes.
label getTotalControlPointsNumber() const
Get cumulative number of control points from all boxes.
void boundControlPointMovement(vectorField &controlPointsMovement) const
Bound control points movement.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define forAll(list, i)
Loop across all elements in list.
A non-counting (dummy) refCount.