mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: consistent handling of "value" for faePatchField
- base level now explicity equivalent to LAZY_READ with overriding as required - clearer documentation for reading of "value" for faPatchField
This commit is contained in:
@ -71,6 +71,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
basicSymmetryFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
@ -78,7 +79,8 @@ public:
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given basicSymmetryFaPatchField onto a new patch
|
||||
//- Construct by mapping given basicSymmetryFaPatchField
|
||||
//- onto a new patch
|
||||
basicSymmetryFaPatchField
|
||||
(
|
||||
const basicSymmetryFaPatchField<Type>&,
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,7 +38,7 @@ const Foam::word& Foam::faPatchField<Type>::calculatedType()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
@ -51,6 +51,19 @@ Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
(
|
||||
@ -64,18 +77,6 @@ Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
(
|
||||
@ -98,10 +99,10 @@ Foam::calculatedFaPatchField<Type>::calculatedFaPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
template<class Type2>
|
||||
template<class AnyType>
|
||||
Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType
|
||||
(
|
||||
const faPatchField<Type2>& pf
|
||||
const faPatchField<AnyType>& pf
|
||||
)
|
||||
{
|
||||
auto* patchTypeCtor = patchConstructorTable(pf.patch().type());
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,8 +38,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef calculatedFaPatchField_H
|
||||
#define calculatedFaPatchField_H
|
||||
#ifndef Foam_calculatedFaPatchField_H
|
||||
#define Foam_calculatedFaPatchField_H
|
||||
|
||||
#include "faPatchField.H"
|
||||
|
||||
@ -56,7 +57,6 @@ class calculatedFaPatchField
|
||||
:
|
||||
public faPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -77,7 +77,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! The "value" entry (default: optional)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::LAZY_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping given patch field onto a new patch
|
||||
|
||||
@ -73,11 +73,12 @@ Foam::coupledFaPatchField<Type>::coupledFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
lduInterfaceField(refCast<const lduInterface>(p, dict)),
|
||||
faPatchField<Type>(p, iF, dict)
|
||||
faPatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,8 +38,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef coupledFaPatchField_H
|
||||
#define coupledFaPatchField_H
|
||||
#ifndef Foam_coupledFaPatchField_H
|
||||
#define Foam_coupledFaPatchField_H
|
||||
|
||||
#include "lduInterfaceField.H"
|
||||
#include "faPatchField.H"
|
||||
@ -60,7 +60,6 @@ class coupledFaPatchField
|
||||
public lduInterfaceField,
|
||||
public faPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -89,7 +88,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! The "value" entry (default: mandatory)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::MUST_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping the given coupledFaPatchField onto a new patch
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedGradientFaPatchField.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -63,7 +64,7 @@ Foam::fixedGradientFaPatchField<Type>::fixedGradientFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF),
|
||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
gradient_("gradient", dict, p.size())
|
||||
{
|
||||
evaluate();
|
||||
|
||||
@ -129,20 +129,19 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
// Member Functions
|
||||
|
||||
// Return defining fields
|
||||
//- The reference gradient at boundary
|
||||
virtual Field<Type>& gradient() noexcept
|
||||
{
|
||||
return gradient_;
|
||||
}
|
||||
|
||||
//- Return gradient at boundary
|
||||
virtual Field<Type>& gradient()
|
||||
{
|
||||
return gradient_;
|
||||
}
|
||||
|
||||
virtual const Field<Type>& gradient() const
|
||||
{
|
||||
return gradient_;
|
||||
}
|
||||
//- The reference gradient at boundary
|
||||
virtual const Field<Type>& gradient() const noexcept
|
||||
{
|
||||
return gradient_;
|
||||
}
|
||||
|
||||
|
||||
// Mapping functions
|
||||
|
||||
@ -45,10 +45,11 @@ Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
|
||||
faPatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
@ -137,5 +138,4 @@ void Foam::fixedValueFaPatchField<Type>::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,8 +38,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixedValueFaPatchField_H
|
||||
#define fixedValueFaPatchField_H
|
||||
#ifndef Foam_fixedValueFaPatchField_H
|
||||
#define Foam_fixedValueFaPatchField_H
|
||||
|
||||
#include "faPatchField.H"
|
||||
|
||||
@ -56,7 +57,6 @@ class fixedValueFaPatchField
|
||||
:
|
||||
public faPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -77,7 +77,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
//! The "value" entry (default: mandatory)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::MUST_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping the given fixedValue patch field
|
||||
|
||||
@ -188,8 +188,7 @@ void Foam::mixedFaPatchField<Type>::rmap
|
||||
{
|
||||
faPatchField<Type>::rmap(ptf, addr);
|
||||
|
||||
const mixedFaPatchField<Type>& mptf =
|
||||
refCast<const mixedFaPatchField<Type>>(ptf);
|
||||
const auto& mptf = refCast<const mixedFaPatchField<Type>>(ptf);
|
||||
|
||||
refValue_.rmap(mptf.refValue_, addr);
|
||||
refGrad_.rmap(mptf.refGrad_, addr);
|
||||
|
||||
@ -234,7 +234,8 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
@ -264,7 +265,7 @@ public:
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
// Member Operators
|
||||
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ Foam::transformFaPatchField<Type>::transformFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, dict)
|
||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -73,7 +73,8 @@ public:
|
||||
const DimensionedField<Type, areaMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
//- Construct from patch, internal field and dictionary.
|
||||
// The "value" entry: NO_READ
|
||||
transformFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
|
||||
@ -68,12 +68,13 @@ Foam::zeroGradientFaPatchField<Type>::zeroGradientFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary&
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF)
|
||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
faPatchField<Type>::operator=(this->patchInternalField());
|
||||
// Set to the internal field
|
||||
faPatchField<Type>::patchInternalField(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -72,10 +72,11 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
coupledFaPatchField<Type>(p, iF, dict),
|
||||
coupledFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
cyclicPatch_(refCast<const cyclicFaPatch>(p, dict))
|
||||
{
|
||||
if (!isA<cyclicFaPatch>(p))
|
||||
@ -89,7 +90,10 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
if (IOobjectOption::isReadRequired(valueRequired))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ class cyclicFaPatchField
|
||||
virtual public cyclicLduInterfaceField,
|
||||
public coupledFaPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Local reference cast into the cyclic patch
|
||||
const cyclicFaPatch& cyclicPatch_;
|
||||
@ -98,7 +98,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! Evaluate (default: mandatory)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::MUST_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping given cyclicFaPatchField onto a new patch
|
||||
|
||||
@ -38,7 +38,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, Field<Type>(0))
|
||||
faPatchField<Type>(p, iF, Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
|
||||
const faPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, Field<Type>(0))
|
||||
faPatchField<Type>(p, iF, Field<Type>())
|
||||
{
|
||||
if (!isType<emptyFaPatch>(p))
|
||||
{
|
||||
@ -74,7 +74,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF, Field<Type>(0))
|
||||
faPatchField<Type>(p, iF, Field<Type>())
|
||||
{
|
||||
if (!isA<emptyFaPatch>(p))
|
||||
{
|
||||
@ -95,12 +95,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
|
||||
const emptyFaPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
faPatchField<Type>
|
||||
(
|
||||
ptf.patch(),
|
||||
ptf.internalField(),
|
||||
Field<Type>(0)
|
||||
)
|
||||
faPatchField<Type>(ptf.patch(), ptf.internalField(), Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
@ -111,7 +106,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
|
||||
faPatchField<Type>(ptf.patch(), iF, Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
coupledFaPatchField<Type>(p, iF, dict),
|
||||
coupledFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
procPatch_(refCast<const processorFaPatch>(p, dict)),
|
||||
sendRequest_(-1),
|
||||
recvRequest_(-1)
|
||||
@ -116,6 +116,12 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
|
||||
<< " in file " << this->internalField().objectPath()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
// Use 'value' supplied, or set to internal field
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
faPatchField<Type>::patchInternalField(*this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,8 +38,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef symmetryFaPatchField_H
|
||||
#define symmetryFaPatchField_H
|
||||
#ifndef Foam_symmetryFaPatchField_H
|
||||
#define Foam_symmetryFaPatchField_H
|
||||
|
||||
#include "basicSymmetryFaPatchField.H"
|
||||
#include "symmetryFaPatch.H"
|
||||
@ -58,7 +58,6 @@ class symmetryFaPatchField
|
||||
:
|
||||
public basicSymmetryFaPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -75,6 +74,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
symmetryFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
|
||||
@ -37,8 +37,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef wedgeFaPatchField_H
|
||||
#define wedgeFaPatchField_H
|
||||
#ifndef Foam_wedgeFaPatchField_H
|
||||
#define Foam_wedgeFaPatchField_H
|
||||
|
||||
#include "transformFaPatchField.H"
|
||||
#include "wedgeFaPatch.H"
|
||||
@ -58,7 +58,6 @@ class wedgeFaPatchField
|
||||
:
|
||||
public transformFaPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -75,6 +74,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
wedgeFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
|
||||
@ -56,7 +56,7 @@ clampedPlateFaPatchField<Type>::clampedPlateFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(p, iF)
|
||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
faPatchField<Type>::operator=(this->patchInternalField());
|
||||
}
|
||||
@ -113,14 +113,13 @@ void clampedPlateFaPatchField<scalar>::evaluate(const Pstream::commsTypes)
|
||||
this->updateCoeffs();
|
||||
}
|
||||
|
||||
Field<scalar>::operator=(pTraits<scalar>::zero);
|
||||
Field<scalar>::operator=(Zero);
|
||||
|
||||
const labelUList& edgeFaces = this->patch().edgeFaces();
|
||||
forAll(edgeFaces, edgeID)
|
||||
auto& iF = const_cast<Field<scalar>&>(this->primitiveField());
|
||||
|
||||
for (const label facei : this->patch().edgeFaces())
|
||||
{
|
||||
label faceID = edgeFaces[edgeID];
|
||||
const_cast<Field<scalar>&>(this->primitiveField())[faceID] =
|
||||
pTraits<scalar>::zero;
|
||||
iF[facei] = Zero;
|
||||
}
|
||||
|
||||
faPatchField<scalar>::evaluate();
|
||||
|
||||
@ -27,7 +27,7 @@ Class
|
||||
Foam::clampedPlateFaPatchField
|
||||
|
||||
Description
|
||||
This BC provides a clamped BC. It sets zero fixe value and zeroGradient.
|
||||
This BC provides a clamped BC. It sets zero fixed value and zeroGradient.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
@ -91,6 +91,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
clampedPlateFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
@ -143,9 +144,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~clampedPlateFaPatchField()
|
||||
{}
|
||||
//- Destructor
|
||||
virtual ~clampedPlateFaPatchField() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -40,7 +40,20 @@ edgeNormalFixedValueFaPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFaPatchVectorField(p, iF),
|
||||
refValue_(p.size(), 0)
|
||||
refValue_(p.size(), Zero)
|
||||
{}
|
||||
|
||||
|
||||
Foam::edgeNormalFixedValueFaPatchVectorField::
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<vector, areaMesh>& iF,
|
||||
const scalar refValue
|
||||
)
|
||||
:
|
||||
fixedValueFaPatchVectorField(p, iF),
|
||||
refValue_(p.size(), refValue)
|
||||
{}
|
||||
|
||||
|
||||
@ -66,9 +79,13 @@ edgeNormalFixedValueFaPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFaPatchVectorField(p, iF, dict),
|
||||
fixedValueFaPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
refValue_("refValue", dict, p.size())
|
||||
{}
|
||||
{
|
||||
tmp<vectorField> tvalues(refValue_*patch().edgeNormals());
|
||||
|
||||
faPatchVectorField::operator=(tvalues);
|
||||
}
|
||||
|
||||
|
||||
Foam::edgeNormalFixedValueFaPatchVectorField::
|
||||
@ -128,7 +145,10 @@ void Foam::edgeNormalFixedValueFaPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
operator==(refValue_*patch().edgeNormals());
|
||||
tmp<vectorField> tvalues(refValue_*patch().edgeNormals());
|
||||
|
||||
faPatchVectorField::operator=(tvalues);
|
||||
faPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
@ -139,18 +159,16 @@ void Foam::edgeNormalFixedValueFaPatchVectorField::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
makeFaPatchTypeField
|
||||
(
|
||||
faPatchVectorField,
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
);
|
||||
|
||||
} // End namespace Foam
|
||||
makeFaPatchTypeField
|
||||
(
|
||||
faPatchVectorField,
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -60,9 +60,9 @@ class edgeNormalFixedValueFaPatchVectorField
|
||||
:
|
||||
public fixedValueFaPatchVectorField
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Surface-normal velocity value
|
||||
//- Edge-normal velocity value
|
||||
scalarField refValue_;
|
||||
|
||||
|
||||
@ -81,6 +81,14 @@ public:
|
||||
const DimensionedField<vector, areaMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and reference value
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<vector, areaMesh>&,
|
||||
const scalar refValue
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
(
|
||||
@ -89,9 +97,8 @@ public:
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// edgeNormalFixedValueFaPatchVectorField
|
||||
// onto a new patch
|
||||
//- Construct by mapping given edgeNormalFixedValueFaPatchVectorField
|
||||
//- onto a new patch
|
||||
edgeNormalFixedValueFaPatchVectorField
|
||||
(
|
||||
const edgeNormalFixedValueFaPatchVectorField&,
|
||||
|
||||
@ -56,7 +56,6 @@ class fixedValueOutflowFaPatchField
|
||||
:
|
||||
public faPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -73,6 +72,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: MUST_READ
|
||||
fixedValueOutflowFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -68,11 +68,11 @@ Foam::inletOutletFaPatchField<Type>::inletOutletFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFaPatchField<Type>(p, iF),
|
||||
// No reading of refValue, refGradient, valueFraction entries
|
||||
mixedFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
phiName_(dict.getOrDefault<word>("phi", "phi"))
|
||||
{
|
||||
faPatchFieldBase::readDict(dict);
|
||||
|
||||
// Require inletValue (MUST_READ)
|
||||
this->refValue().assign("inletValue", dict, p.size());
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
|
||||
@ -36,7 +36,7 @@ Foam::slipFaPatchField<Type>::slipFaPatchField
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
basicSymmetryFaPatchField<Type>(p, iF)
|
||||
basicSymmetryFaPatchField<Type>(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -39,8 +39,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef slipFaPatchField_H
|
||||
#define slipFaPatchField_H
|
||||
#ifndef Foam_slipFaPatchField_H
|
||||
#define Foam_slipFaPatchField_H
|
||||
|
||||
#include "basicSymmetryFaPatchField.H"
|
||||
|
||||
@ -58,7 +58,6 @@ class slipFaPatchField
|
||||
:
|
||||
public basicSymmetryFaPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -75,6 +74,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
slipFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
@ -125,6 +125,7 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~slipFaPatchField() = default;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -52,7 +53,7 @@ timeVaryingUniformFixedValueFaPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFaPatchField<Type>(p, iF),
|
||||
fixedValueFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
timeSeries_(dict)
|
||||
{
|
||||
if (dict.found("value"))
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,6 +37,7 @@ const Foam::word& Foam::faePatchField<Type>::calculatedType()
|
||||
return Foam::calculatedFaePatchField<Type>::typeName;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -68,10 +69,11 @@ Foam::calculatedFaePatchField<Type>::calculatedFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
|
||||
faePatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,7 +77,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, edgeMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! The "value" entry (default: mandatory)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::MUST_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping given patch field onto a new patch
|
||||
|
||||
@ -70,10 +70,11 @@ Foam::coupledFaePatchField<Type>::coupledFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, dict)
|
||||
faePatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -86,7 +86,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, edgeMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! The "value" entry (default: optional)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::LAZY_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping the given coupledFaePatchField onto a new patch
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,10 +46,11 @@ Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
IOobjectOption::readOption valueRequired
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
|
||||
faePatchField<Type>(p, iF, dict, valueRequired)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,7 +77,9 @@ public:
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, edgeMesh>&,
|
||||
const dictionary&
|
||||
const dictionary& dict,
|
||||
//! The "value" entry (default: mandatory)
|
||||
IOobjectOption::readOption valueRequired = IOobjectOption::MUST_READ
|
||||
);
|
||||
|
||||
//- Construct by mapping the given fixedValue patch field
|
||||
|
||||
@ -37,7 +37,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, Field<Type>(0))
|
||||
faePatchField<Type>(p, iF, Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
|
||||
const faPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, Field<Type>(0))
|
||||
faePatchField<Type>(p, iF, Field<Type>())
|
||||
{
|
||||
if (!isType<emptyFaPatch>(this->patch()))
|
||||
{
|
||||
@ -72,7 +72,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, Field<Type>(0))
|
||||
faePatchField<Type>(p, iF, Field<Type>())
|
||||
{
|
||||
if (!isType<emptyFaPatch>(p))
|
||||
{
|
||||
@ -90,12 +90,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
|
||||
const emptyFaePatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
faePatchField<Type>
|
||||
(
|
||||
ptf.patch(),
|
||||
ptf.internalField(),
|
||||
Field<Type>(0)
|
||||
)
|
||||
faePatchField<Type>(ptf.patch(), ptf.internalField(), Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
@ -106,7 +101,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(ptf.patch(), iF, Field<Type>(0))
|
||||
faePatchField<Type>(ptf.patch(), iF, Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ Foam::processorFaePatchField<Type>::processorFaePatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
coupledFaePatchField<Type>(p, iF, dict),
|
||||
coupledFaePatchField<Type>(p, iF, dict, IOobjectOption::LAZY_READ),
|
||||
procPatch_(refCast<const processorFaPatch>(p, dict))
|
||||
{
|
||||
if (!isType<processorFaPatch>(p))
|
||||
|
||||
@ -71,7 +71,7 @@ Foam::symmetryFaePatchField<Type>::symmetryFaePatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(p, iF, dict)
|
||||
faePatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
if (!isType<symmetryFaPatch>(p))
|
||||
{
|
||||
|
||||
@ -75,6 +75,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
// The "value" entry: NO_READ
|
||||
symmetryFaePatchField
|
||||
(
|
||||
const faPatch&,
|
||||
|
||||
Reference in New Issue
Block a user