WIP area fields

This commit is contained in:
Mark Olesen 2023-02-23 15:33:46 +01:00
parent 64e5b7f626
commit ce602d340b
11 changed files with 97 additions and 25 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2018-2022 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,12 +34,14 @@ License
namespace Foam
{
defineTemplateTypeNameAndDebug(areaLabelField::Internal, 0);
defineTemplateTypeNameAndDebug(areaScalarField::Internal, 0);
defineTemplateTypeNameAndDebug(areaVectorField::Internal, 0);
defineTemplateTypeNameAndDebug(areaSphericalTensorField::Internal, 0);
defineTemplateTypeNameAndDebug(areaSymmTensorField::Internal, 0);
defineTemplateTypeNameAndDebug(areaTensorField::Internal, 0);
defineTemplateTypeNameAndDebug(areaLabelField, 0);
defineTemplateTypeNameAndDebug(areaScalarField, 0);
defineTemplateTypeNameAndDebug(areaVectorField, 0);
defineTemplateTypeNameAndDebug(areaSphericalTensorField, 0);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2018-2022 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,6 +75,7 @@ using AreaInternalField = DimensionedField<Type, areaMesh>;
// Typedefs
typedef GeometricField<label, faPatchField, areaMesh> areaLabelField;
typedef GeometricField<scalar, faPatchField, areaMesh> areaScalarField;
typedef GeometricField<vector, faPatchField, areaMesh> areaVectorField;
typedef GeometricField<sphericalTensor, faPatchField, areaMesh>

View File

@ -30,17 +30,12 @@ License
#include "areaFaMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFaPatchFields(calculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeFaPatchFields(calculated);
makeFaPatchFieldType(label, calculated);
}
// ************************************************************************* //

View File

@ -38,6 +38,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFaPatchTypeFieldTypedefs(calculated);
makeFaPatchFieldTypedef(label, calculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -212,6 +212,27 @@ public:
};
// * * * * * * * * * * * * Template Specialisations * * * * * * * * * * * * //
template<>
tmp<Field<label>> coupledFaPatchField<label>::snGrad() const;
template<>
void coupledFaPatchField<label>::evaluate(const Pstream::commsTypes);
template<>
tmp<Field<label>>
coupledFaPatchField<label>::valueInternalCoeffs(const tmp<scalarField>&) const;
template<>
tmp<Field<label>>
coupledFaPatchField<label>::valueBoundaryCoeffs(const tmp<scalarField>&) const;
template<>
tmp<Field<label>>
coupledFaPatchField<label>::gradientInternalCoeffs() const;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -29,17 +29,70 @@ License
#include "coupledFaPatchFields.H"
#include "areaFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
makeFaPatchFieldsTypeName(coupled);
makeFaPatchFieldTypeName(label, coupled);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Specialisations * * * * * * * * * * * * * * //
makeFaPatchFieldsTypeName(coupled);
template<>
Foam::tmp<Foam::Field<Foam::label>>
Foam::coupledFaPatchField<Foam::label>::snGrad() const
{
// TBD: Treat like zero-gradient
return tmp<Field<label>>::New(this->size(), Zero);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
template<>
void Foam::coupledFaPatchField<Foam::label>::evaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}
// TBD: Treat like zero-gradient
faPatchField<label>::operator=(this->patchInternalField());
faPatchField<label>::evaluate();
}
template<>
Foam::tmp<Foam::Field<Foam::label>>
Foam::coupledFaPatchField<Foam::label>::valueInternalCoeffs
(
const tmp<scalarField>&
) const
{
// TBD: Treat like zero-gradient
return tmp<Field<label>>::New(this->size(), label(1));
}
template<>
Foam::tmp<Foam::Field<Foam::label>>
Foam::coupledFaPatchField<Foam::label>::valueBoundaryCoeffs
(
const tmp<scalarField>&
) const
{
// TBD: Treat like zero-gradient
return tmp<Field<label>>::New(this->size(), Zero);
}
template<>
Foam::tmp<Foam::Field<Foam::label>>
Foam::coupledFaPatchField<Foam::label>::gradientInternalCoeffs() const
{
// TBD: Treat like zero-gradient
return tmp<Field<label>>::New(this->size(), Zero);
}
// ************************************************************************* //

View File

@ -38,6 +38,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFaPatchTypeFieldTypedefs(coupled);
makeFaPatchFieldTypedef(label, coupled);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -30,17 +30,12 @@ License
#include "areaFaMesh.H"
#include "areaFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFaPatchFields(processor);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeFaPatchFields(processor);
makeFaPatchFieldType(label, processor);
}
// ************************************************************************* //

View File

@ -38,6 +38,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFaPatchTypeFieldTypedefs(processor);
makeFaPatchFieldTypedef(label, processor);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -38,6 +38,7 @@ namespace Foam
defineTemplateRunTimeSelectionTable(PatchTypeField, patchMapper); \
defineTemplateRunTimeSelectionTable(PatchTypeField, dictionary);
makeFaPatchField(faPatchLabelField);
makeFaPatchField(faPatchScalarField);
makeFaPatchField(faPatchVectorField);
makeFaPatchField(faPatchSphericalTensorField);

View File

@ -42,6 +42,7 @@ namespace Foam
template<class Type> class faPatchField;
typedef faPatchField<label> faPatchLabelField;
typedef faPatchField<scalar> faPatchScalarField;
typedef faPatchField<vector> faPatchVectorField;
typedef faPatchField<sphericalTensor> faPatchSphericalTensorField;