diff --git a/src/finiteVolume/expressions/base/fvExprDriver.H b/src/finiteVolume/expressions/base/fvExprDriver.H index dd485d4dbc..0f59ecfe4b 100644 --- a/src/finiteVolume/expressions/base/fvExprDriver.H +++ b/src/finiteVolume/expressions/base/fvExprDriver.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2010-2018 Bernhard Gschaider - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -166,7 +166,7 @@ protected: template static inline word defaultBoundaryType ( - const GeometricField& + const VolumeField& ) { return "zeroGradient"; @@ -180,7 +180,7 @@ protected: template static inline void correctField ( - GeometricField& fld + VolumeField& fld ) { fld.correctBoundaryConditions(); diff --git a/src/finiteVolume/expressions/base/fvExprDriverTemplates.C b/src/finiteVolume/expressions/base/fvExprDriverTemplates.C index 51697a1ed2..ca813b6aa7 100644 --- a/src/finiteVolume/expressions/base/fvExprDriverTemplates.C +++ b/src/finiteVolume/expressions/base/fvExprDriverTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2010-2018 Bernhard Gschaider - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -231,18 +231,14 @@ bool Foam::expressions::fvExprDriver::isField Info<< "fvExprDriver::isField <" << name << '>' << endl; } - typedef GeometricField vfieldType; - typedef GeometricField sfieldType; - typedef GeometricField pfieldType; - return ( wantPointData - ? this->foundField(name) + ? this->foundField>(name) : ( - this->foundField(name) - || this->foundField(name) + this->foundField>(name) + || this->foundField>(name) ) ); } diff --git a/src/finiteVolume/expressions/patch/patchExprDriverTemplates.C b/src/finiteVolume/expressions/patch/patchExprDriverTemplates.C index cbb01fc4d8..f2043dc794 100644 --- a/src/finiteVolume/expressions/patch/patchExprDriverTemplates.C +++ b/src/finiteVolume/expressions/patch/patchExprDriverTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -118,17 +118,11 @@ Foam::expressions::patchExpr::parseDriver::getField(const word& name) const label patchIndex = patch_.index(); - // Field types - - typedef GeometricField vfieldType; - typedef GeometricField sfieldType; - typedef GeometricField pfieldType; - // Local, temporary storage and/or lookup values bool found = false; - tmp vfield; - tmp sfield; - tmp pfield; + tmp> vfield; + tmp> sfield; + tmp> pfield; for (int checki = 0; !found && checki < 2; ++checki) { @@ -144,17 +138,17 @@ Foam::expressions::patchExpr::parseDriver::getField(const word& name) if (!found) { - vfield.cref(dynamic_cast(ioptr)); + vfield.cref(dynamic_cast*>(ioptr)); found = vfield.valid(); } if (!found) { - sfield.cref(dynamic_cast(ioptr)); + sfield.cref(dynamic_cast*>(ioptr)); found = sfield.valid(); } if (!found) { - pfield.cref(dynamic_cast(ioptr)); + pfield.cref(dynamic_cast*>(ioptr)); found = pfield.valid(); } } @@ -165,17 +159,17 @@ Foam::expressions::patchExpr::parseDriver::getField(const word& name) { const word fldType = this->getTypeOfField(name); - if (fldType == vfieldType::typeName) + if (fldType == VolumeField::typeName) { - vfield = this->readAndRegister(name, mesh()); + vfield = this->readAndRegister>(name, mesh()); } - else if (fldType == sfieldType::typeName) + else if (fldType == SurfaceField::typeName) { - sfield = this->readAndRegister(name, mesh()); + sfield = this->readAndRegister>(name, mesh()); } - else if (fldType == pfieldType::typeName) + else if (fldType == PointField::typeName) { - pfield = this->readAndRegister + pfield = this->readAndRegister> ( name, pointMesh::New(mesh()) @@ -209,16 +203,16 @@ Foam::expressions::patchExpr::parseDriver::getField(const word& name) << pTraits::typeName << nl << nl; FatalError - << vfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << VolumeField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError - << sfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << SurfaceField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError - << pfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << PointField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError << exit(FatalError); @@ -245,15 +239,10 @@ Foam::expressions::patchExpr::parseDriver::patchInternalField const label patchIndex = patch_.index(); - // Field types - - typedef GeometricField vfieldType; - typedef GeometricField pfieldType; - // Local, temporary storage and/or lookup values bool found = false; - tmp vfield; - tmp pfield; + tmp> vfield; + tmp> pfield; for (int checki = 0; !found && checki < 2; ++checki) { @@ -269,12 +258,12 @@ Foam::expressions::patchExpr::parseDriver::patchInternalField if (!found) { - vfield.cref(dynamic_cast(ioptr)); + vfield.cref(dynamic_cast*>(ioptr)); found = vfield.valid(); } if (!found) { - pfield.cref(dynamic_cast(ioptr)); + pfield.cref(dynamic_cast*>(ioptr)); found = pfield.valid(); } } @@ -285,13 +274,13 @@ Foam::expressions::patchExpr::parseDriver::patchInternalField { const word fldType = this->getTypeOfField(name); - if (fldType == vfieldType::typeName) + if (fldType == VolumeField::typeName) { - vfield = this->readAndRegister(name, mesh()); + vfield = this->readAndRegister>(name, mesh()); } - else if (fldType == pfieldType::typeName) + else if (fldType == PointField::typeName) { - pfield = this->readAndRegister + pfield = this->readAndRegister> ( name, pointMesh::New(mesh()) @@ -315,12 +304,12 @@ Foam::expressions::patchExpr::parseDriver::patchInternalField << pTraits::typeName << nl << nl; FatalError - << vfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << VolumeField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError - << pfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << PointField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError << exit(FatalError); @@ -347,13 +336,9 @@ Foam::expressions::patchExpr::parseDriver::patchNeighbourField const label patchIndex = patch_.index(); - // Field types - - typedef GeometricField vfieldType; - // Local, temporary storage and/or lookup values bool found = false; - tmp vfield; + tmp> vfield; for (int checki = 0; !found && checki < 2; ++checki) { @@ -369,7 +354,7 @@ Foam::expressions::patchExpr::parseDriver::patchNeighbourField if (!found) { - vfield.cref(dynamic_cast(ioptr)); + vfield.cref(dynamic_cast*>(ioptr)); found = vfield.valid(); } } @@ -380,9 +365,9 @@ Foam::expressions::patchExpr::parseDriver::patchNeighbourField { const word fldType = this->getTypeOfField(name); - if (fldType == vfieldType::typeName) + if (fldType == VolumeField::typeName) { - vfield = this->readAndRegister(name, mesh()); + vfield = this->readAndRegister>(name, mesh()); } } @@ -398,8 +383,8 @@ Foam::expressions::patchExpr::parseDriver::patchNeighbourField << pTraits::typeName << nl << nl; FatalError - << vfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << VolumeField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError << exit(FatalError); @@ -426,13 +411,9 @@ Foam::expressions::patchExpr::parseDriver::patchNormalField const label patchIndex = patch_.index(); - // Field types - - typedef GeometricField vfieldType; - // Local, temporary storage and/or lookup values bool found = false; - tmp vfield; + tmp> vfield; for (int checki = 0; !found && checki < 2; ++checki) { @@ -448,7 +429,7 @@ Foam::expressions::patchExpr::parseDriver::patchNormalField if (!found) { - vfield.cref(dynamic_cast(ioptr)); + vfield.cref(dynamic_cast*>(ioptr)); found = vfield.valid(); } } @@ -459,9 +440,9 @@ Foam::expressions::patchExpr::parseDriver::patchNormalField { const word fldType = this->getTypeOfField(name); - if (fldType == vfieldType::typeName) + if (fldType == VolumeField::typeName) { - vfield = this->readAndRegister(name, mesh()); + vfield = this->readAndRegister>(name, mesh()); } } @@ -477,8 +458,8 @@ Foam::expressions::patchExpr::parseDriver::patchNormalField << pTraits::typeName << nl << nl; FatalError - << vfieldType::typeName << " Fields: " - << flatOutput(obr.sortedNames()) << nl; + << VolumeField::typeName << " Fields: " + << flatOutput(obr.sortedNames>()) << nl; FatalError << exit(FatalError); diff --git a/src/finiteVolume/expressions/volume/volumeExprDriver.H b/src/finiteVolume/expressions/volume/volumeExprDriver.H index b4c182ab62..39f0aa0e58 100644 --- a/src/finiteVolume/expressions/volume/volumeExprDriver.H +++ b/src/finiteVolume/expressions/volume/volumeExprDriver.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -325,60 +325,48 @@ public: //- Set result (vol field) template - void setResult - ( - GeometricField* ptr, - bool logical = false - ); + void setResult(VolumeField* ptr, bool logical = false); //- Set result (surface field) template - void setResult - ( - GeometricField* ptr, - bool logical = false - ); + void setResult(SurfaceField* ptr, bool logical = false); //- Set result (point field) template - void setResult - ( - GeometricField* ptr, - bool logical = false - ); + void setResult(PointField* ptr, bool logical = false); // New Fields //- Return a new volume field with the mesh size template - tmp> + tmp> newVolField(const Type& val = pTraits::zero) const; //- Return a new surface field with the mesh nInternalFaces size template - tmp> + tmp> newSurfaceField(const Type& val = pTraits::zero) const; //- Return a new point field with the mesh nPoints size template - tmp> + tmp> newPointField(const Type& val = pTraits::zero) const; //- Retrieve field (vol field) template - tmp> + tmp> getVolField(const word& fldName, bool getOldTime=false); //- Retrieve field (surface field) template - tmp> + tmp> getSurfaceField(const word& fldName, bool getOldTime=false); //- Retrieve field (surface field) template - tmp> + tmp> getPointField(const word& fldName, bool getOldTime=false); @@ -386,57 +374,39 @@ public: //- Interpolate cell to face values template - tmp> - cellToFace - ( - const GeometricField& field - ) const; + tmp> + cellToFace(const VolumeField& field) const; //- Interpolate cell to point values template - tmp> - cellToPoint - ( - const GeometricField& field - ) const; + tmp> + cellToPoint(const VolumeField& field) const; //- Interpolate point to cell values template - tmp> - pointToCell - ( - const GeometricField& field - ) const; + tmp> + pointToCell(const PointField& field) const; // Custom Field Functions //- The volume-weighted average of a field template - Type volAverage - ( - GeometricField& fld - ) const + Type volAverage(VolumeField& fld) const { return weightedAverage(fld.mesh().V(), fld.primitiveField()); } //- The volume-weighted sum of a field template - Type volSum - ( - GeometricField& fld - ) const + Type volSum(VolumeField& fld) const { return weightedSum(fld.mesh().V(), fld.primitiveField()); } //- The area-weighted average of a field template - Type areaAverage - ( - GeometricField& fld - ) const + Type areaAverage(SurfaceField& fld) const { return weightedAverage ( @@ -447,10 +417,7 @@ public: //- The area-weighted sum of a field template - Type areaSum - ( - GeometricField& fld - ) const + Type areaSum(SurfaceField& fld) const { return weightedSum ( diff --git a/src/finiteVolume/expressions/volume/volumeExprDriverTemplates.C b/src/finiteVolume/expressions/volume/volumeExprDriverTemplates.C index ba39f568b5..5518642010 100644 --- a/src/finiteVolume/expressions/volume/volumeExprDriverTemplates.C +++ b/src/finiteVolume/expressions/volume/volumeExprDriverTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -62,16 +62,14 @@ void Foam::expressions::volumeExpr::parseDriver::setInternalFieldResult template void Foam::expressions::volumeExpr::parseDriver::setResult ( - GeometricField* ptr, + VolumeField* ptr, bool logical ) { - typedef GeometricField fieldType; - resultField_.reset(nullptr); // Characteristics - resultType_ = pTraits::typeName; + resultType_ = VolumeField::typeName; isLogical_ = logical; fieldGeoType_ = VOLUME_DATA; @@ -91,16 +89,14 @@ void Foam::expressions::volumeExpr::parseDriver::setResult template void Foam::expressions::volumeExpr::parseDriver::setResult ( - GeometricField* ptr, + SurfaceField* ptr, bool logical ) { - typedef GeometricField fieldType; - resultField_.reset(nullptr); // Characteristics - resultType_ = pTraits::typeName; + resultType_ = SurfaceField::typeName; isLogical_ = logical; fieldGeoType_ = FACE_DATA; @@ -120,16 +116,14 @@ void Foam::expressions::volumeExpr::parseDriver::setResult template void Foam::expressions::volumeExpr::parseDriver::setResult ( - GeometricField* ptr, + PointField* ptr, bool logical ) { - typedef GeometricField fieldType; - resultField_.reset(nullptr); // Characteristics - resultType_ = pTraits::typeName; + resultType_ = PointField::typeName; isLogical_ = logical; fieldGeoType_ = POINT_DATA; @@ -182,16 +176,14 @@ Foam::expressions::volumeExpr::parseDriver::isResultType template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::getVolField ( const word& fldName, bool getOldTime ) { - typedef GeometricField fieldType; - - return this->getOrReadField + return this->getOrReadField> ( fldName, true, // mandatory @@ -201,16 +193,14 @@ Foam::expressions::volumeExpr::parseDriver::getVolField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::getSurfaceField ( const word& fldName, bool getOldTime ) { - typedef GeometricField fieldType; - - return this->getOrReadField + return this->getOrReadField> ( fldName, true, // mandatory @@ -220,16 +210,14 @@ Foam::expressions::volumeExpr::parseDriver::getSurfaceField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::getPointField ( const word& fldName, bool getOldTime ) { - typedef GeometricField fieldType; - - return this->getOrReadPointField + return this->getOrReadPointField> ( fldName, true, // mandatory @@ -239,15 +227,13 @@ Foam::expressions::volumeExpr::parseDriver::getPointField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::newVolField ( const Type& val ) const { - typedef GeometricField fieldType; - - return fieldType::New + return VolumeField::New ( word("constant.") + word(pTraits::typeName), mesh(), @@ -257,15 +243,13 @@ Foam::expressions::volumeExpr::parseDriver::newVolField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::newSurfaceField ( const Type& val ) const { - typedef GeometricField fieldType; - - return fieldType::New + return SurfaceField::New ( word("constant.") + word(pTraits::typeName), mesh(), @@ -275,15 +259,13 @@ Foam::expressions::volumeExpr::parseDriver::newSurfaceField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::newPointField ( const Type& val ) const { - typedef GeometricField fieldType; - - return fieldType::New + return PointField::New ( word("constant.") + word(pTraits::typeName), pointMesh::New(mesh()), @@ -293,10 +275,10 @@ Foam::expressions::volumeExpr::parseDriver::newPointField template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::cellToFace ( - const GeometricField& field + const VolumeField& field ) const { return fvc::interpolate(field); @@ -304,10 +286,10 @@ Foam::expressions::volumeExpr::parseDriver::cellToFace template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::cellToPoint ( - const GeometricField& field + const VolumeField& field ) const { volPointInterpolation interp(this->mesh()); @@ -316,10 +298,10 @@ Foam::expressions::volumeExpr::parseDriver::cellToPoint template -Foam::tmp> +Foam::tmp> Foam::expressions::volumeExpr::parseDriver::pointToCell ( - const GeometricField& field + const PointField& field ) const { auto tresult = newVolField(); diff --git a/src/functionObjects/field/expressions/fvExpressionField.C b/src/functionObjects/field/expressions/fvExpressionField.C index fb395e7538..ca07f69588 100644 --- a/src/functionObjects/field/expressions/fvExpressionField.C +++ b/src/functionObjects/field/expressions/fvExpressionField.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,7 +80,7 @@ template static void doCorrectBoundaryConditions ( bool correctBCs, - GeometricField& field + VolumeField& field ) { if (correctBCs) @@ -104,7 +104,7 @@ template void doCorrectBoundaryConditions ( bool correctBCs, - GeometricField& field + PointField& field ) { if (correctBCs) @@ -119,7 +119,7 @@ template void doCorrectBoundaryConditions ( bool correctBCs, - GeometricField& field + SurfaceField& field ) {} @@ -148,15 +148,11 @@ bool Foam::functionObjects::fvExpressionField::loadAndStore(const IOobject& io) template bool Foam::functionObjects::fvExpressionField::loadField(const IOobject& io) { - typedef GeometricField VolFieldType; - // typedef typename VolFieldType::Internal IntVolFieldType; - typedef GeometricField SurfaceFieldType; - return ( - loadAndStore(io) - /// || loadAndStore(io) - || loadAndStore(io) + loadAndStore>(io) + /// || loadAndStore>(io) + || loadAndStore>(io) ); } diff --git a/src/sampling/functions/Function1/Sample/SampleFunction1.C b/src/sampling/functions/Function1/Sample/SampleFunction1.C index d617ec7d35..d71427e1fb 100644 --- a/src/sampling/functions/Function1/Sample/SampleFunction1.C +++ b/src/sampling/functions/Function1/Sample/SampleFunction1.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,7 +43,7 @@ void Foam::Function1Types::Sample::setSampleCell() const { pointEventNo_ = points.eventNo(); - celli_ = this->template mesh().findCell(position_); + celli_ = mesh.findCell(position_); if (!returnReduce(celli_ != -1, orOp())) { @@ -104,18 +104,17 @@ Foam::Function1Types::Sample::Sample(const Sample& s) template Type Foam::Function1Types::Sample::value(const scalar x) const { - typedef GeometricField VolFieldType; - const auto& mesh = this->template mesh(); - const auto* fieldPtr = mesh.template cfindObject(fieldName_); + const auto* fieldPtr = + mesh.template cfindObject>(fieldName_); if (!fieldPtr) { FatalErrorInFunction << "Unable to find field " << fieldName_ << " on the mesh database" - << ". Valid " << VolFieldType::typeName << " fields are:" - << mesh.names(VolFieldType::typeName) + << ". Valid " << VolumeField::typeName << " fields are:" + << mesh.template sortedNames>() << exit(FatalError); } diff --git a/src/sampling/meshToMesh/meshToMesh.C b/src/sampling/meshToMesh/meshToMesh.C index 9601fe3d8b..b5404474d5 100644 --- a/src/sampling/meshToMesh/meshToMesh.C +++ b/src/sampling/meshToMesh/meshToMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2015-2020 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,9 +73,9 @@ Foam::meshToMesh::procMapMethodNames_ template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -86,9 +86,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -99,9 +99,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -112,9 +112,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -125,9 +125,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -138,9 +138,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -151,9 +151,9 @@ void Foam::meshToMesh::mapInternalSrcToTgt template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -164,9 +164,9 @@ void Foam::meshToMesh::mapInternalTgtToSrc template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -177,9 +177,9 @@ void Foam::meshToMesh::mapInternalTgtToSrc template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -190,9 +190,9 @@ void Foam::meshToMesh::mapInternalTgtToSrc template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -203,9 +203,9 @@ void Foam::meshToMesh::mapInternalTgtToSrc template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const plusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -216,9 +216,9 @@ void Foam::meshToMesh::mapInternalTgtToSrc template<> void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const minusEqOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { diff --git a/src/sampling/meshToMesh/meshToMesh.H b/src/sampling/meshToMesh/meshToMesh.H index 877259617d..29ab929360 100644 --- a/src/sampling/meshToMesh/meshToMesh.H +++ b/src/sampling/meshToMesh/meshToMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2015-2018 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,8 +42,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef meshToMesh_H -#define meshToMesh_H +#ifndef Foam_meshToMesh_H +#define Foam_meshToMesh_H #include "polyMesh.H" #include "treeBoundBox.H" @@ -159,9 +159,9 @@ private: template void mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const; @@ -170,9 +170,9 @@ private: template void mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const; @@ -550,18 +550,18 @@ public: template void mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder = true ) const; //- Interpolate a field with a defined operation. The initial // values of the result are set to zero template - tmp> mapSrcToTgt + tmp> mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, const bool secondOrder = true ) const; @@ -569,10 +569,9 @@ public: //- Interpolate a tmp field with a defined operation. The // initial values of the result are set to zero template - tmp> mapSrcToTgt + tmp> mapSrcToTgt ( - const tmp>& - tfield, + const tmp>& tfield, const CombineOp& cop, const bool secondOrder = true ) const; @@ -580,19 +579,18 @@ public: //- Convenience function to map a field with a default // operation (plusEqOp) template - tmp> mapSrcToTgt + tmp> mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const bool secondOrder = true ) const; //- Convenience function to map a tmp field with a default // operation (plusEqOp) template - tmp> mapSrcToTgt + tmp> mapSrcToTgt ( - const tmp>& - tfield, + const tmp>& tfield, const bool secondOrder = true ) const; @@ -606,18 +604,18 @@ public: template void mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder = true ) const; //- Interpolate a field with a defined operation. The initial // values of the result are set to zero template - tmp> mapTgtToSrc + tmp> mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, const bool secondOrder = true ) const; @@ -625,9 +623,9 @@ public: //- Interpolate a tmp field with a defined operation. The // initial values of the result are set to zero template - tmp> mapTgtToSrc + tmp> mapTgtToSrc ( - const tmp>& + const tmp>& tfield, const CombineOp& cop, const bool secondOrder = true @@ -636,19 +634,18 @@ public: //- Convenience function to map a field with a default // operation (plusEqOp) template - tmp> mapTgtToSrc + tmp> mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const bool secondOrder = true ) const; //- Convenience function to map a tmp field with a default // operation (plusEqOp) template - tmp> mapTgtToSrc + tmp> mapTgtToSrc ( - const tmp>& - tfield, + const tmp>& tfield, const bool secondOrder = true ) const; }; @@ -661,97 +658,97 @@ public: template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalSrcToTgt ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const plusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; template<> void meshToMesh::mapInternalTgtToSrc ( - const GeometricField&, + const VolumeField&, const minusEqOp&, - GeometricField&, + VolumeField&, const bool ) const; diff --git a/src/sampling/meshToMesh/meshToMeshTemplates.C b/src/sampling/meshToMesh/meshToMeshTemplates.C index f13e0d8362..7fe01d548a 100644 --- a/src/sampling/meshToMesh/meshToMeshTemplates.C +++ b/src/sampling/meshToMesh/meshToMeshTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2015 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -472,9 +472,9 @@ Foam::tmp> Foam::meshToMesh::mapTgtToSrc template void Foam::meshToMesh::mapInternalSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -519,9 +519,9 @@ void Foam::meshToMesh::mapAndOpSrcToTgt template void Foam::meshToMesh::mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -529,8 +529,7 @@ void Foam::meshToMesh::mapSrcToTgt const PtrList& AMIList = patchAMIs(); - typename GeometricField:: - Boundary& resultBf = result.boundaryFieldRef(); + auto& resultBf = result.boundaryFieldRef(); forAll(AMIList, i) { @@ -581,21 +580,18 @@ void Foam::meshToMesh::mapSrcToTgt template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, const bool secondOrder ) const { - typedef GeometricField fieldType; - const fvMesh& tgtMesh = static_cast(tgtRegion_); const fvBoundaryMesh& tgtBm = tgtMesh.boundary(); - const typename fieldType::Boundary& srcBfld = - field.boundaryField(); + const auto& srcBfld = field.boundaryField(); PtrList> tgtPatchFields(tgtBm.size()); @@ -646,9 +642,8 @@ Foam::meshToMesh::mapSrcToTgt } } - tmp tresult - ( - new fieldType + auto tresult = + tmp>::New ( IOobject ( @@ -662,8 +657,7 @@ Foam::meshToMesh::mapSrcToTgt field.dimensions(), Field(tgtMesh.nCells(), Zero), tgtPatchFields - ) - ); + ); mapSrcToTgt(field, cop, tresult.ref(), secondOrder); @@ -672,10 +666,10 @@ Foam::meshToMesh::mapSrcToTgt template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapSrcToTgt ( - const tmp>& tfield, + const tmp>& tfield, const CombineOp& cop, const bool secondOrder ) const @@ -685,10 +679,10 @@ Foam::meshToMesh::mapSrcToTgt template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapSrcToTgt ( - const GeometricField& field, + const VolumeField& field, const bool secondOrder ) const { @@ -697,10 +691,10 @@ Foam::meshToMesh::mapSrcToTgt template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapSrcToTgt ( - const tmp>& tfield, + const tmp>& tfield, const bool secondOrder ) const { @@ -711,9 +705,9 @@ Foam::meshToMesh::mapSrcToTgt template void Foam::meshToMesh::mapInternalTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -758,9 +752,9 @@ void Foam::meshToMesh::mapAndOpTgtToSrc template void Foam::meshToMesh::mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, - GeometricField& result, + VolumeField& result, const bool secondOrder ) const { @@ -817,21 +811,18 @@ void Foam::meshToMesh::mapTgtToSrc template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const CombineOp& cop, const bool secondOrder ) const { - typedef GeometricField fieldType; - const fvMesh& srcMesh = static_cast(srcRegion_); const fvBoundaryMesh& srcBm = srcMesh.boundary(); - const typename fieldType::Boundary& tgtBfld = - field.boundaryField(); + const auto& tgtBfld = field.boundaryField(); PtrList> srcPatchFields(srcBm.size()); @@ -882,9 +873,8 @@ Foam::meshToMesh::mapTgtToSrc } } - tmp tresult - ( - new fieldType + auto tresult = + tmp>::New ( IOobject ( @@ -898,8 +888,7 @@ Foam::meshToMesh::mapTgtToSrc field.dimensions(), Field(srcMesh.nCells(), Zero), srcPatchFields - ) - ); + ); mapTgtToSrc(field, cop, tresult.ref(), secondOrder); @@ -908,10 +897,10 @@ Foam::meshToMesh::mapTgtToSrc template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapTgtToSrc ( - const tmp>& tfield, + const tmp>& tfield, const CombineOp& cop, const bool secondOrder ) const @@ -921,10 +910,10 @@ Foam::meshToMesh::mapTgtToSrc template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapTgtToSrc ( - const GeometricField& field, + const VolumeField& field, const bool secondOrder ) const { @@ -933,10 +922,10 @@ Foam::meshToMesh::mapTgtToSrc template -Foam::tmp> +Foam::tmp> Foam::meshToMesh::mapTgtToSrc ( - const tmp>& tfield, + const tmp>& tfield, const bool secondOrder ) const { diff --git a/src/sampling/meshToMesh0/meshToMesh0.H b/src/sampling/meshToMesh0/meshToMesh0.H index 1d30a3fd63..625f89056c 100644 --- a/src/sampling/meshToMesh0/meshToMesh0.H +++ b/src/sampling/meshToMesh0/meshToMesh0.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2020 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,7 +31,7 @@ Description Serial mesh to mesh interpolation class. Note - This class is due to be deprecated in favour of meshToMesh0New + This class is due to be deprecated in favour of meshToMesh SourceFiles meshToMesh0.C @@ -41,8 +41,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef meshToMesh0_H -#define meshToMesh0_H +#ifndef Foam_meshToMesh0_H +#define Foam_meshToMesh0_H #include "fvMesh.H" #include "HashTable.H" @@ -271,7 +271,7 @@ public: void interpolateField ( Field&, - const GeometricField&, + const VolumeField&, const labelList& adr, const scalarListList& weights, const CombineOp& cop @@ -282,7 +282,7 @@ public: void interpolateField ( Field&, - const GeometricField&, + const VolumeField&, const labelListList& adr, const scalarListList& weights, const CombineOp& cop @@ -294,7 +294,7 @@ public: void interpolateField ( Field&, - const GeometricField&, + const VolumeField&, const labelList& adr, const vectorField& centres, const CombineOp& cop @@ -306,7 +306,7 @@ public: void interpolateInternalField ( Field&, - const GeometricField&, + const VolumeField&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; @@ -315,7 +315,7 @@ public: void interpolateInternalField ( Field&, - const tmp>&, + const tmp>&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; @@ -325,8 +325,8 @@ public: template void interpolate ( - GeometricField&, - const GeometricField&, + VolumeField&, + const VolumeField&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; @@ -334,8 +334,8 @@ public: template void interpolate ( - GeometricField&, - const tmp>&, + VolumeField&, + const tmp>&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; @@ -343,17 +343,17 @@ public: //- Interpolate volume field template - tmp> interpolate + tmp> interpolate ( - const GeometricField&, + const VolumeField&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; template - tmp> interpolate + tmp> interpolate ( - const tmp>&, + const tmp>&, order=INTERPOLATE, const CombineOp& cop = eqOp() ) const; diff --git a/src/sampling/meshToMesh0/meshToMesh0Templates.C b/src/sampling/meshToMesh0/meshToMesh0Templates.C index 02efc09d89..c40298f4bd 100644 --- a/src/sampling/meshToMesh0/meshToMesh0Templates.C +++ b/src/sampling/meshToMesh0/meshToMesh0Templates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,7 +61,7 @@ template void Foam::meshToMesh0::interpolateField ( Field& toF, - const GeometricField& fromVf, + const VolumeField& fromVf, const labelListList& adr, const scalarListList& weights, const CombineOp& cop @@ -87,7 +88,7 @@ template void Foam::meshToMesh0::interpolateField ( Field& toF, - const GeometricField& fromVf, + const VolumeField& fromVf, const labelList& adr, const scalarListList& weights, const CombineOp& cop @@ -122,7 +123,7 @@ template void Foam::meshToMesh0::interpolateField ( Field& toF, - const GeometricField& fromVf, + const VolumeField& fromVf, const labelList& adr, const vectorField& centres, const CombineOp& cop @@ -153,7 +154,7 @@ template void Foam::meshToMesh0::interpolateInternalField ( Field& toF, - const GeometricField& fromVf, + const VolumeField& fromVf, meshToMesh0::order ord, const CombineOp& cop ) const @@ -234,7 +235,7 @@ template void Foam::meshToMesh0::interpolateInternalField ( Field& toF, - const tmp>& tfromVf, + const tmp>& tfromVf, meshToMesh0::order ord, const CombineOp& cop ) const @@ -247,16 +248,15 @@ void Foam::meshToMesh0::interpolateInternalField template void Foam::meshToMesh0::interpolate ( - GeometricField& toVf, - const GeometricField& fromVf, + VolumeField& toVf, + const VolumeField& fromVf, meshToMesh0::order ord, const CombineOp& cop ) const { interpolateInternalField(toVf, fromVf, ord, cop); - typename GeometricField:: - Boundary& toVfBf = toVf.boundaryFieldRef(); + auto& toVfBf = toVf.boundaryFieldRef(); forAll(toMesh_.boundaryMesh(), patchi) { @@ -346,8 +346,8 @@ void Foam::meshToMesh0::interpolate template void Foam::meshToMesh0::interpolate ( - GeometricField& toVf, - const tmp>& tfromVf, + VolumeField& toVf, + const tmp>& tfromVf, meshToMesh0::order ord, const CombineOp& cop ) const @@ -358,10 +358,10 @@ void Foam::meshToMesh0::interpolate template -Foam::tmp> +Foam::tmp> Foam::meshToMesh0::interpolate ( - const GeometricField& fromVf, + const VolumeField& fromVf, meshToMesh0::order ord, const CombineOp& cop ) const @@ -406,9 +406,8 @@ Foam::meshToMesh0::interpolate // Create the complete field from the pieces - tmp> ttoF - ( - new GeometricField + return + tmp>::New ( IOobject ( @@ -422,24 +421,20 @@ Foam::meshToMesh0::interpolate fromVf.dimensions(), internalField, patchFields - ) - ); - - return ttoF; + ); } template -Foam::tmp> +Foam::tmp> Foam::meshToMesh0::interpolate ( - const tmp>& tfromVf, + const tmp>& tfromVf, meshToMesh0::order ord, const CombineOp& cop ) const { - tmp> tint = - interpolate(tfromVf(), ord, cop); + tmp> tint = interpolate(tfromVf(), ord, cop); tfromVf.clear(); return tint; diff --git a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurfaceTemplates.C b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurfaceTemplates.C index c9280890a7..df769395ad 100644 --- a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurfaceTemplates.C +++ b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurfaceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -89,8 +89,8 @@ Foam::sampledDistanceSurface::sampleOnIsoSurfacePoints // Assume volPointInterpolation for the point field! const auto& volFld = interpolator.psi(); - tmp> tvolFld(volFld); - tmp> tpointFld; + tmp> tvolFld(volFld); + tmp> tpointFld; // Interpolated point field tpointFld.reset diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C index c9810cb9d2..7a9f826e2c 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,8 +93,8 @@ Foam::sampledIsoSurface::sampleOnIsoSurfacePoints // Assume volPointInterpolation for the point field! const auto& volFld = interpolator.psi(); - tmp> tvolFld(volFld); - tmp> tpointFld; + tmp> tvolFld(volFld); + tmp> tpointFld; if (subMeshPtr_) { diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C index cc030b9e01..30e98d3ad4 100644 --- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C +++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,8 +67,8 @@ Foam::sampledCuttingPlane::sampleOnIsoSurfacePoints // Assume volPointInterpolation for the point field! const auto& volFld = interpolator.psi(); - tmp> tvolFld(volFld); - tmp> tpointFld; + tmp> tvolFld(volFld); + tmp> tpointFld; if (subMeshPtr_) { diff --git a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H index 7daa45c2dc..fb1374bc3d 100644 --- a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H +++ b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZone.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020-2021 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,8 +58,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef sampledFaceZone_H -#define sampledFaceZone_H +#ifndef Foam_sampledFaceZone_H +#define Foam_sampledFaceZone_H #include "sampledSurface.H" #include "MeshedSurfaces.H" @@ -116,7 +116,7 @@ class sampledFaceZone template tmp> sampleOnFaces ( - const GeometricField& sField + const SurfaceField& sField ) const; //- Interpolate volume/boundary field onto surface points diff --git a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZoneTemplates.C b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZoneTemplates.C index 5798324490..da47f374d5 100644 --- a/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZoneTemplates.C +++ b/src/sampling/sampledSurface/sampledFaceZone/sampledFaceZoneTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,7 +72,7 @@ template Foam::tmp> Foam::sampledFaceZone::sampleOnFaces ( - const GeometricField& sField + const SurfaceField& sField ) const { // One value per face diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H index 7627441a6f..6fadf15ad4 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,8 +58,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef sampledPatch_H -#define sampledPatch_H +#ifndef Foam_sampledPatch_H +#define Foam_sampledPatch_H #include "sampledSurface.H" #include "MeshedSurfaces.H" @@ -119,7 +119,7 @@ class sampledPatch template tmp> sampleOnFaces ( - const GeometricField& sField + const SurfaceField& sField ) const; //- Interpolate boundary field (from volume field) onto surface points diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatchTemplates.C b/src/sampling/sampledSurface/sampledPatch/sampledPatchTemplates.C index b818c2d860..73efe7f253 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatchTemplates.C +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatchTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,7 +59,7 @@ template Foam::tmp> Foam::sampledPatch::sampleOnFaces ( - const GeometricField& sField + const SurfaceField& sField ) const { // One value per face diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H index 95ab72c7bd..d7645b192c 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H @@ -71,8 +71,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef sampledSurface_H -#define sampledSurface_H +#ifndef Foam_sampledSurface_H +#define Foam_sampledSurface_H #include "polySurface.H" #include "typeInfo.H" @@ -148,9 +148,9 @@ protected: //- Create cell values by averaging the point values template - static tmp> pointAverage + static tmp> pointAverage ( - const GeometricField& pfld + const PointField& pfld ); diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C index add566ddae..a9225a204a 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C @@ -125,15 +125,15 @@ Foam::sampledSurface::sampleOnPoints template -Foam::tmp> +Foam::tmp> Foam::sampledSurface::pointAverage ( - const GeometricField& pfld + const PointField& pfld ) { const fvMesh& mesh = dynamic_cast(pfld.mesh()()); - auto tcellAvg = tmp>::New + auto tcellAvg = tmp>::New ( IOobject ( diff --git a/src/sampling/surface/distanceSurface/distanceSurface.H b/src/sampling/surface/distanceSurface/distanceSurface.H index 6a4c296932..4a2141bc5d 100644 --- a/src/sampling/surface/distanceSurface/distanceSurface.H +++ b/src/sampling/surface/distanceSurface/distanceSurface.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -130,8 +130,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef distanceSurface_H -#define distanceSurface_H +#ifndef Foam_distanceSurface_H +#define Foam_distanceSurface_H #include "sampledSurface.H" #include "searchableSurface.H" @@ -249,7 +249,7 @@ protected: template tmp> isoSurfaceInterpolate ( - const GeometricField& cellValues, + const VolumeField& cellValues, const Field& pointValues ) const { diff --git a/src/sampling/surface/isoSurface/isoSurfaceBase.H b/src/sampling/surface/isoSurface/isoSurfaceBase.H index a856f06f26..f64213e74c 100644 --- a/src/sampling/surface/isoSurface/isoSurfaceBase.H +++ b/src/sampling/surface/isoSurface/isoSurfaceBase.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef isoSurfaceBase_H -#define isoSurfaceBase_H +#ifndef Foam_isoSurfaceBase_H +#define Foam_isoSurfaceBase_H #include "isoSurfaceParams.H" #include "bitSet.H" @@ -139,7 +139,7 @@ protected: template tmp> interpolateTemplate ( - const GeometricField& cellValues, + const VolumeField& cellValues, const Field& pointValues ) const { @@ -274,7 +274,7 @@ public: virtual tmp> \ interpolate \ ( \ - const GeometricField& cellValues, \ + const VolumeField& cellValues, \ const Field& pointValues \ ) const; diff --git a/src/sampling/surface/isoSurface/isoSurfaceBaseMethods.H b/src/sampling/surface/isoSurface/isoSurfaceBaseMethods.H index 9b14913866..2783aca29f 100644 --- a/src/sampling/surface/isoSurface/isoSurfaceBaseMethods.H +++ b/src/sampling/surface/isoSurface/isoSurfaceBaseMethods.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef isoSurfaceBaseMethods_H -#define isoSurfaceBaseMethods_H +#ifndef Foam_isoSurfaceBaseMethods_H +#define Foam_isoSurfaceBaseMethods_H // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,7 +43,7 @@ Description #define defineIsoSurfaceInterpolateMethod(ThisClass, Type) \ Foam::tmp> ThisClass::interpolate \ ( \ - const GeometricField& cellValues, \ + const VolumeField& cellValues, \ const Field& pointValues \ ) const \ { \ diff --git a/src/sampling/surface/isoSurface/isoSurfacePoint.H b/src/sampling/surface/isoSurface/isoSurfacePoint.H index a4bb33faae..571e5d96cf 100644 --- a/src/sampling/surface/isoSurface/isoSurfacePoint.H +++ b/src/sampling/surface/isoSurface/isoSurfacePoint.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,8 +63,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef isoSurfacePoint_H -#define isoSurfacePoint_H +#ifndef Foam_isoSurfacePoint_H +#define Foam_isoSurfacePoint_H #include "bitSet.H" #include "volFields.H" @@ -206,12 +206,8 @@ class isoSurfacePoint //- Return input field with coupled (and empty) patch values rewritten template - tmp> - adaptPatchFields - ( - const GeometricField& fld - ) const; + tmp> + adaptPatchFields(const VolumeField& fld) const; //- Generate single point by interpolation or snapping template @@ -263,7 +259,7 @@ class isoSurfacePoint const volScalarField& cVals, const scalarField& pVals, - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords, const DynamicList& snappedPoints, @@ -286,7 +282,7 @@ class isoSurfacePoint const volScalarField& cVals, const scalarField& pVals, - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords, const DynamicList& snappedPoints, @@ -360,7 +356,7 @@ class isoSurfacePoint template tmp> interpolateTemplate ( - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords ) const; diff --git a/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C b/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C index f282ddb756..8f077680ac 100644 --- a/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C +++ b/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2021 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,27 +36,13 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -Foam::tmp> +Foam::tmp> Foam::isoSurfacePoint::adaptPatchFields ( - const GeometricField& fld + const VolumeField& fld ) const { - typedef SlicedGeometricField - < - Type, - fvPatchField, - slicedFvPatchField, - volMesh - > FieldType; - - auto tslice = tmp::New + auto tslice = tmp>::New ( IOobject ( @@ -448,7 +434,7 @@ Foam::label Foam::isoSurfacePoint::generateFaceTriPoints const volScalarField& cVals, const scalarField& pVals, - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords, const DynamicList& snappedPoints, @@ -531,7 +517,7 @@ void Foam::isoSurfacePoint::generateTriPoints const volScalarField& cVals, const scalarField& pVals, - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords, const DynamicList& snappedPoints, @@ -809,18 +795,12 @@ template Foam::tmp> Foam::isoSurfacePoint::interpolateTemplate ( - const GeometricField& cCoords, + const VolumeField& cCoords, const Field& pCoords ) const { // Recalculate boundary values - tmp> c2(adaptPatchFields(cCoords)); + tmp> c2(adaptPatchFields(cCoords)); DynamicList triPoints(3*nCutCells_);