diff --git a/src/finiteVolume/CMakeLists.txt b/src/finiteVolume/CMakeLists.txt index a85cd059e..ef40896bf 100644 --- a/src/finiteVolume/CMakeLists.txt +++ b/src/finiteVolume/CMakeLists.txt @@ -306,6 +306,7 @@ list(APPEND SOURCES ${interpolation}/interpolationCellPointFace/makeInterpolationCellPointFace.C ${interpolation}/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C ${interpolation}/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C + ${interpolation}/interpolationPointMVC/interpolationPointMVC.C ) set(volPointInterpolation interpolation/volPointInterpolation) diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index dbc7cacd5..efc3c98e7 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -238,6 +238,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C $(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C $(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C $(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C +$(interpolation)/interpolationPointMVC/pointMVCWeight.C +$(interpolation)/interpolationPointMVC/makeInterpolationPointMVC.C volPointInterpolation = interpolation/volPointInterpolation $(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.C b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.C new file mode 100644 index 000000000..a4d318f7f --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.C @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "interpolationPointMVC.H" +#include "volPointInterpolation.H" + +// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // + +template +Foam::interpolationPointMVC::interpolationPointMVC +( + const GeometricField& psi +) +: + interpolation(psi), + psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)) +/* + psip_ + ( + volPointInterpolation::New(psi.mesh()).interpolate + ( + psi, + "volPointInterpolate(" + psi.name() + ')', + true // use cache + ) + ) +*/ +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.H b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.H new file mode 100644 index 000000000..bec28fdbf --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVC.H @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + Foam::interpolationPointMVC + +Description + Given cell centre values interpolates to vertices and uses these to + do a Mean Value Coordinates interpolation. + +\*---------------------------------------------------------------------------*/ + +#ifndef interpolationPointMVC_H +#define interpolationPointMVC_H + +#include "interpolation.H" +#include "pointMVCWeight.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class interpolationPointMVC Declaration +\*---------------------------------------------------------------------------*/ + +template +class interpolationPointMVC +: + public interpolation +{ +protected: + + // Protected data + + //- Interpolated volfield + const GeometricField psip_; + + +public: + + //- Runtime type information + TypeName("pointMVC"); + + + // Constructors + + //- Construct from components + interpolationPointMVC + ( + const GeometricField& psi + ); + + + // Member Functions + + //- Inherit interpolate from interpolation + using interpolation::interpolate; + + //- Interpolate field for the given cellPointWeight + inline Type interpolate(const pointMVCWeight& cpw) const; + + //- Interpolate field to the given point in the given cell + inline Type interpolate + ( + const vector& position, + const label celli, + const label facei = -1 + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "interpolationPointMVCI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "interpolationPointMVC.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVCI.H b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVCI.H new file mode 100644 index 000000000..17d03a224 --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/interpolationPointMVCI.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Type Foam::interpolationPointMVC::interpolate +( + const pointMVCWeight& cpw +) const +{ + return cpw.interpolate(psip_); +} + + +template +inline Type Foam::interpolationPointMVC::interpolate +( + const vector& position, + const label celli, + const label facei +) const +{ + return interpolate + ( + pointMVCWeight(this->pMesh_, position, celli, facei) + ); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/makeInterpolationPointMVC.C b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/makeInterpolationPointMVC.C new file mode 100644 index 000000000..582b575ad --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/makeInterpolationPointMVC.C @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "interpolationPointMVC.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeInterpolation(interpolationPointMVC); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C new file mode 100644 index 000000000..6a812aa34 --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C @@ -0,0 +1,324 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "pointMVCWeight.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +Foam::debug::debugSwitch +Foam::pointMVCWeight::debug +( + "pointMVCWeight", + 0 +); +Foam::scalar Foam::pointMVCWeight::tol(SMALL); + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::pointMVCWeight::calcWeights +( + const Map