From d40df85591c288640f07a7a5545e057ba3b3f4a6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Aug 2010 16:17:18 +0100 Subject: [PATCH] ENH: interpolationPoint : interpolation from point values only (using Mean Value Coordinates) --- src/finiteVolume/Make/files | 2 + .../interpolationPoint/interpolationPoint.C | 255 ++++++++++++++ .../interpolationPoint/interpolationPoint.H | 108 ++++++ .../interpolationPoint/interpolationPointI.H | 53 +++ .../makeInterpolationPoint.C | 35 ++ .../interpolationPoint/pointMVCWeight.C | 324 ++++++++++++++++++ .../interpolationPoint/pointMVCWeight.H | 162 +++++++++ .../interpolationPoint/pointMVCWeightI.H | 48 +++ 8 files changed, 987 insertions(+) create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPointI.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/makeInterpolationPoint.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeightI.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 84ff879b50..126669d56a 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -196,6 +196,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C $(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C $(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C $(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C +$(interpolation)/interpolationPoint/pointMVCWeight.C +$(interpolation)/interpolationPoint/makeInterpolationPoint.C volPointInterpolation = interpolation/volPointInterpolation /* diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C b/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C new file mode 100644 index 0000000000..598a5807ee --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C @@ -0,0 +1,255 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "interpolationPoint.H" +#include "volPointInterpolation.H" + +// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // + +template +Foam::interpolationPoint::interpolationPoint +( + const GeometricField& psi +) +: + interpolation(psi), + psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +//template +//void Foam::interpolationPoint::calcWeights +//( +// const vector& position, +// const label cellI, +// const label faceI, +// scalarField& weights +//) const +//{ +// const polyMesh& mesh = this->pMesh_; +// const pointField& points = mesh.points(); +// +// +// const scalar eps = 0.00000001; +// +// +// // Addressing - face vertices to local points +// const labelList& toGlobal = mesh.cellPoints()[cellI]; +// Map