From 301eac2089f710482863c3ae8cf3ae2ae24e161d Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 15 Jun 2021 12:09:43 +0100 Subject: [PATCH] primitives: Added 2D barycentric tensor --- .../Barycentric2D/BarycentricTensor2D.H | 137 ++++++++++++++ .../Barycentric2D/BarycentricTensor2DI.H | 179 ++++++++++++++++++ .../barycentricTensor2D/barycentricTensor2D.H | 64 +++++++ 3 files changed, 380 insertions(+) create mode 100644 src/OpenFOAM/primitives/Barycentric2D/BarycentricTensor2D.H create mode 100644 src/OpenFOAM/primitives/Barycentric2D/BarycentricTensor2DI.H create mode 100644 src/OpenFOAM/primitives/Barycentric2D/barycentricTensor2D/barycentricTensor2D.H diff --git a/src/OpenFOAM/primitives/Barycentric2D/BarycentricTensor2D.H b/src/OpenFOAM/primitives/Barycentric2D/BarycentricTensor2D.H new file mode 100644 index 0000000000..9923ab7db1 --- /dev/null +++ b/src/OpenFOAM/primitives/Barycentric2D/BarycentricTensor2D.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::BarycentricTensor2D + +Description + Templated 3x3 tensor derived from VectorSpace. Has 9 components. Can + represent a barycentric transformation as a matrix-barycentric inner- + product. Can alternatively represent an inverse barycentric transformation + as a vector-matrix inner-product. + +SourceFiles + BarycentricTensor2DI.H + +\*---------------------------------------------------------------------------*/ + +#ifndef BarycentricTensor2D_H +#define BarycentricTensor2D_H + +#include "Barycentric2D.H" +#include "Tensor2D.H" +#include "Vector.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class BarycentricTensor2D Declaration +\*---------------------------------------------------------------------------*/ + +template +class BarycentricTensor2D +: + public MatrixSpace, Cmpt, 3, 3> +{ +public: + + //- Equivalent type of labels used for valid component indexing + typedef Tensor2D