Go to the documentation of this file.
39 namespace incompressible
54 sensitivityBezier::sensitivityBezier
75 sens_(Bezier_.nBezier(),
Zero),
76 flowSens_(Bezier_.nBezier(),
Zero),
77 dSdbSens_(Bezier_.nBezier(),
Zero),
78 dndbSens_(Bezier_.nBezier(),
Zero),
79 dxdbDirectSens_(Bezier_.nBezier(),
Zero),
80 derivativesFolder_(
"optimisation"/
type() +
"Derivatives")
84 mkDir(derivativesFolder_);
101 for (
const label patchI : sensitivityPatchIDs_)
155 if (confineXmovement[cpI])
163 if (confineYmovement[cpI])
171 if (confineZmovement[cpI])
197 Info<<
"Writing control point sensitivities to file" <<
endl;
205 unsigned int widthDV =
max(
int(
name(
sens_.size()).size()),
int(3));
208 <<
setw(widthDV) <<
"#dv" <<
" "
209 <<
setw(width) <<
"total" <<
" "
210 <<
setw(width) <<
"flow" <<
" "
211 <<
setw(width) <<
"dSdb" <<
" "
212 <<
setw(width) <<
"dndb" <<
" "
213 <<
setw(width) <<
"dxdbDirect" <<
endl;
217 label lastActive(-1);
218 for (
label iDV = 0; iDV < nDV; iDV++)
220 label iCP = iDV%nBezier;
221 label idir = iDV/nBezier;
222 if (!confineMovement[idir][iCP])
224 if (iDV!=lastActive + 1) derivFile <<
"\n";
227 <<
setw(widthDV) << iDV <<
" "
autoPtr< boundaryVectorField > dxdbDirectMult_
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
class for managing incompressible objective functions.
virtual void assembleSensitivities()
Assemble sensitivities.
const word & solverName() const
Return solver name.
const boolList & confineXmovement() const
Confine x movement.
A class for handling words, derived from Foam::string.
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
defineTypeNameAndDebug(adjointEikonalSolver, 0)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero.
static word timeName(const scalar t, const int precision=precision_)
Base class for Surface Integral-based sensitivity derivatives.
virtual void write(const word &baseName=word::null)
Write sensitivities to file.
Ostream & endl(Ostream &os)
Add newline and flush stream.
sensitivitySurface surfaceSensitivity_
Surface sensitivities.
Type gSum(const FieldField< Field, Type > &f)
const boolList & confineZmovement() const
Confine z movement.
Class including all adjoint fields for incompressible flows.
virtual void assembleSensitivities()
Assemble sensitivities.
#define forAll(list, i)
Loop across all elements in list.
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
label nBezier() const
Number of Bezier control points.
addToRunTimeSelectionTable(adjointSensitivity, sensitivityBezier, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
Istream and Ostream manipulators taking arguments.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
tmp< tensorField > dxdbFace(const label patchI, const label cpI, bool useChainRule=true) const
dxdb tensor for a Bezier parameterized patch
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
incompressibleAdjointVars & adjointVars_
Mesh data needed to do the Finite Volume discretisation.
Omanip< int > setw(const int i)
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Output to file stream, using an OSstream.
static bool master(const label communicator=0)
Am I the master process.
autoPtr< boundaryVectorField > dSfdbMult_
Fields related to direct sensitivities.
static unsigned int defaultPrecision()
Return the default precision.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
autoPtr< boundaryVectorField > dnfdbMult_
const Time & time() const
Return the top-level database.
const boolList & confineYmovement() const
Confine y movement.
const boolListList & confineMovement() const
Info about confining movement in all directions.
fv::IOoptionListAdjoint fvOptionsAdjoint(mesh)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Base class for solution control classes.
vectorField dxdbDirectSens_
fileName derivativesFolder_
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool returnDimensionedNormalSens=true) const