Go to the documentation of this file.
40 namespace incompressible
55 sensitivityVolBSplinesFI::sensitivityVolBSplinesFI
85 derivativesFolder_(
"optimisation"/
type() +
"Derivatives")
122 distanceSensPtr.reset
124 createZeroFieldPtr<tensor>
139 const label nb(boxes[iNURB].getControlPoints().size());
142 vectorField dxdbSens = boxes[iNURB].computeControlPointSensitivities
145 sensitivityPatchIDs_.toc()
148 vectorField bcSens = boxes[iNURB].computeControlPointSensitivities
151 sensitivityPatchIDs_.toc()
154 for (label cpI = 0; cpI < nb; cpI++)
156 label globalCP = passedCPs + cpI;
222 for (
const label patchI : sensitivityPatchIDs_)
226 boxes[iNURB].dndbBasedSensitivities(patchI, cpI)
231 boxes[iNURB].dndbBasedSensitivities(patchI, cpI,
false)
242 *
fvc::div(
T(volDxDbI))().primitiveField()
250 distanceSensPtr().primitiveField();
254 (distSensInt && gradDxDb1.primitiveField())*
mesh_.
V()
259 (distSensInt && gradDxDb2.primitiveField())*
mesh_.
V()
264 (distSensInt && gradDxDb3.primitiveField()) *
mesh_.
V()
276 bcSens_[globalCP] = bcSens[cpI];
278 boxSensitivities[cpI] =
290 boxes[iNURB].boundControlPointMovement(boxSensitivities);
293 for (label cpI = 0; cpI < nb; cpI++)
295 label globalCP = passedCPs + cpI;
297 derivatives_[3*globalCP + 1] = boxSensitivities[cpI].y();
298 derivatives_[3*globalCP + 2] = boxSensitivities[cpI].z();
335 Info<<
"Writing control point sensitivities to file" <<
endl;
349 <<
setw(widthDV) <<
"#cp" <<
" "
350 <<
setw(width) <<
"total::x" <<
" "
351 <<
setw(width) <<
"total::y" <<
" "
352 <<
setw(width) <<
"total::z" <<
" "
353 <<
setw(width) <<
"flow::x" <<
" "
354 <<
setw(width) <<
"flow::y" <<
" "
355 <<
setw(width) <<
"flow::z" <<
" "
356 <<
setw(width) <<
"dSdb::x" <<
" "
357 <<
setw(width) <<
"dSdb::y" <<
" "
358 <<
setw(width) <<
"dSdb::z" <<
" "
359 <<
setw(width) <<
"dndb::x" <<
" "
360 <<
setw(width) <<
"dndb::y" <<
" "
361 <<
setw(width) <<
"dndb::z" <<
" "
362 <<
setw(width) <<
"dxdbDirect::x" <<
" "
363 <<
setw(width) <<
"dxdbDirect::y" <<
" "
364 <<
setw(width) <<
"dxdbDirect::z" <<
" "
365 <<
setw(width) <<
"dVdb::x" <<
" "
366 <<
setw(width) <<
"dVdb::y" <<
" "
367 <<
setw(width) <<
"dVdb::z" <<
" "
368 <<
setw(width) <<
"distance::x" <<
" "
369 <<
setw(width) <<
"distance::y" <<
" "
370 <<
setw(width) <<
"distance::z" <<
" "
371 <<
setw(width) <<
"options::x" <<
" "
372 <<
setw(width) <<
"options::y" <<
" "
373 <<
setw(width) <<
"options::z" <<
" "
374 <<
setw(width) <<
"dvdb::x" <<
" "
375 <<
setw(width) <<
"dvdb::y" <<
" "
376 <<
setw(width) <<
"dvdb::z" <<
endl;
379 label lastActive(-1);
383 label nb = boxes[iNURB].getControlPoints().size();
384 const boolList& activeCPs = boxes[iNURB].getActiveCPs();
385 for (label iCP = 0; iCP < nb; iCP++)
389 label globalCP = passedCPs + iCP;
390 if (globalCP!=lastActive + 1) derivFile <<
"\n";
391 lastActive = globalCP;
394 <<
setw(widthDV) << globalCP <<
" "
vectorField optionsDxDbMult_
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
class for managing incompressible objective functions.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
const word & solverName() const
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
autoPtr< boundaryVectorField > bcDxDbMult_
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
A class for handling words, derived from Foam::string.
virtual void clearSensitivities()
defineTypeNameAndDebug(adjointEikonalSolver, 0)
Class constructing a number of volumetric B-Splines boxes, read from dynamicMeshDict....
A class for managing temporary objects.
static constexpr const zero Zero
const Internal::FieldType & primitiveField() const
volTensorField gradDxDbMult_
static const volBSplinesBase & New(const fvMesh &mesh, Args &&... args)
static word timeName(const scalar t, const int precision=precision_)
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
static bool master(const label communicator=worldComm)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Type gSum(const FieldField< Field, Type > &f)
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Class including all adjoint fields for incompressible flows.
vectorField dxdbDirectSens_
Field< vector > vectorField
Specialisation of Field<T> for vector.
autoPtr< adjointEikonalSolver > eikonalSolver_
autoPtr< boundaryVectorField > dSfdbMult_
addToRunTimeSelectionTable(adjointSensitivity, sensitivityBezier, dictionary)
void interpolate(const GeometricField< Type, pointPatchField, pointMesh > &, GeometricField< Type, fvPatchField, volMesh > &) const
Generic templated field type.
label getTotalControlPointsNumber() const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void boundControlPointMovement(vectorField &controlPointsMovement)
Istream and Ostream manipulators taking arguments.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
PtrList< NURBS3DVolume > & boxesRef()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
autoPtr< boundaryVectorField > dxdbDirectMult_
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)
Output to file stream, using an OSstream.
virtual void write(const word &baseName=word::null)
void reset(autoPtr< T > &&other) noexcept
static unsigned int defaultPrecision() noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Base class for Field Integral-based sensitivity derivatives.
Calculation of adjoint based sensitivities at vol B-Splines control points using the FI approach.
virtual void assembleSensitivities()
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
fileName::Type type(const fileName &name, const bool followLink=true)
virtual void clearSensitivities()
word name(const expressions::valueTypeCode typeCode)
const Time & time() const
autoPtr< boundaryVectorField > dnfdbMult_
fileName derivativesFolder_
Generic GeometricField class.
bool mkDir(const fileName &pathName, mode_t mode=0777)
volBSplinesBase & volBSplinesBase_
vectorField distanceSens_
Base class for solution control classes.
const DimensionedField< scalar, volMesh > & V() const