45 const bool isTopoField,
46 const scalar minSetValue
63 const scalar minSetValue
66 const labelList& IOcells =
mesh.cellZones()[zones_.IOzoneID()];
67 cells.append(IOcells);
70 forAll(zones_.fixedPorousZoneIDs(), zI)
72 const label
cellZoneID = zones_.fixedPorousZoneIDs()[zI];
74 cells.append(zoneCells);
81 zones_.fixedPorousValues()[zI] : scalar(0)
86 for (label
cellZoneID : zones_.fixedZeroPorousZoneIDs())
89 cells.append(zoneCells);
97 scalar averageVol(
gAverage(mesh_.V().field()));
98 const Vector<label>& geometricD = mesh_.geometricD();
99 const boundBox& bounds = mesh_.bounds();
102 if (geometricD[iDir] == -1)
104 averageVol /= bounds.span()[iDir];
107 scalar radius =
pow(averageVol, scalar(1)/scalar(mesh_.nGeometricD()));
108 Info<<
"Computed a mean radius of " << radius <<
endl;
115Foam::regularisationPDE::regularisationPDE
138 const word modelType =
139 dict.getOrDefault<
word>(
"regularisationPDE",
"Helmholtz");
141 auto* ctorPtr = dictionaryConstructorTable(modelType);
143 Info<<
"regularisationPDE type " << modelType <<
endl;
152 *dictionaryConstructorTablePtr_
156 return autoPtr<regularisationPDE>
const Mesh & mesh() const noexcept
Return const reference to mesh.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
void size(const label n)
Older name for setAddressableSize.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bounding box defined in terms of min/max extrema points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void setValues(const labelUList &cellLabels, const Type &value)
Set solution in given cells to the specified value and eliminate the corresponding equations from the...
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Mesh data needed to do the Finite Volume discretisation.
Base class for selecting the regulatisation PDE.
bool growFromWalls_
Whether to apply a fixedValue BC or zeroGradient one to alphaTilda, when regularisation is performed.
scalar computeRadius()
Compute smoothing radius, if not directly given.
void setValues(fvScalarMatrix &bTildaEqn, const bool isTopoField, const scalar minSetValue=Zero)
Set fixed bTilda values.
static autoPtr< regularisationPDE > New(const fvMesh &mesh, const dictionary &dict, const topOZones &zones)
Construct and return the selected regularisationPDE.
const topOZones & zones_
Cell zones related to topology optimisation.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Namespace for bounding specifications. At the moment, mostly for tables.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
List< label > labelList
A List of labels.
fvMatrix< scalar > fvScalarMatrix
messageStream Info
Information stream (stdout output on master, null elsewhere).
DynamicID< cellZoneMesh > cellZoneID
Foam::cellZoneID.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.