Go to the documentation of this file.
53 auto& resGrad = tresGrad.ref();
61 const GeometricField<Type, fvPatchField, volMesh>&
field =
74 tmp<surfaceInterpolationScheme<Type>> tinterpScheme
79 mesh.interpolationScheme(
"interpolate(" +
name +
")")
83 GeometricField<Type, fvsPatchField, surfaceMesh> surfField
98 const label cI = faceCells[fI];
99 const cell& cellI =
cells[cI];
100 for (
const label faceI : cellI)
102 label
patchID =
mesh.boundaryMesh().whichPatch(faceI);
105 const label own = owner[faceI];
120 const fvPatch& patchForFlux =
mesh.boundary()[
patchID];
121 const label boundaryFaceI = faceI - patchForFlux.start();
125 *surfField.boundaryField()[
patchID][boundaryFaceI];
129 resGrad[fI] /= V[cI];
135 resGrad = nf*bField.snGrad() + (resGrad - nf*(nf & resGrad));
147 const DimensionedField<Type, volMesh>& iF,
148 const word& solverName
152 managerName_(
"objectiveManager" + solverName),
153 adjointSolverName_(solverName),
154 simulationType_(
"incompressible"),
155 boundaryContrPtr_(nullptr),
156 addATCUaGradUTerm_(nullptr)
159 setBoundaryContributionPtr();
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
adjointBoundaryCondition(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const word &solverName)
Construct from field and base name.
const fvPatch & patch_
Reference to patch.
static constexpr const zero Zero
Global zero (0)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
const fvMesh & mesh() const
Return the mesh reference.
#define forAll(list, i)
Loop across all elements in list.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
virtual label size() const
Return size.
tmp< vectorField > nf() const
Return face normals.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
word name(const complex &c)
Return string representation of complex.
List< cell > cellList
A List of cells.
label index() const
Return the index of this patch in the fvBoundaryMesh.
tmp< Field< typename Foam::outerProduct< Foam::vector, Type2 >::type > > computePatchGrad(word name)
Get gradient of field on a specific boundary.
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
virtual const labelUList & faceCells() const
Return faceCells.
UList< label > labelUList
A UList of labels.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.