Added library VectorN, containing specializations for Lists, fields, CoeffFields, blockLduMatrices, etc. for arbitrary length vectors (VectorN) and tensors (TensorN).

This commit is contained in:
Ivor Clifford 2010-10-14 17:24:41 -04:00
parent 719616503d
commit 8ed0a59a10
133 changed files with 11866 additions and 0 deletions

39
src/VectorN/Make/files Normal file
View file

@ -0,0 +1,39 @@
OpenFOAM/Lists/VectorNLists.C
OpenFOAM/DimensionedTypes/dimensionedVectorTensorN.C
OpenFOAM/Fields/VectorNFields.C
OpenFOAM/Fields/TensorNFields.C
OpenFOAM/Fields/DiagTensorNFields.C
OpenFOAM/Fields/SphericalTensorNFields.C
OpenFOAM/expandContract/ExpandTensorNField.C
OpenFOAM/BlockLduMatrices/blockVectorNSolvers.C
OpenFOAM/BlockLduMatrices/blockVectorNMatrices.C
OpenFOAM/BlockLduMatrices/blockVectorNLduInterfaceFields.C
finiteVolume/fields/fvPatchFields/fvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/genericFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/calculatedFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/emptyFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/transformFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/wedgeFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/coupledFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/processorFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/fixedValueFvPatchVectorNFields.C
finiteVolume/fields/fvPatchFields/zeroGradientFvPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/fvsPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/calculatedFvsPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/emptyFvsPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/wedgeFvsPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/coupledFvsPatchVectorNFields.C
finiteVolume/fields/fvsPatchFields/processorFvsPatchVectorNFields.C
finiteVolume/fields/volFields/volVectorNFields.C
finiteVolume/fields/surfaceFields/surfaceVectorNFields.C
finiteVolume/interpolation/VectorNSurfaceInterpolationSchemes.C
LIB = $(FOAM_LIBBIN)/libVectorN

6
src/VectorN/Make/options Normal file
View file

@ -0,0 +1,6 @@
EXE_INC = \
-I$(FOAM_SRC)/OpenFOAM/lnInclude \
-I$(FOAM_SRC)/finiteVolume/lnInclude \
-ftemplate-depth-200
LIB_LIBS =

View file

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
blockVectorNLduInterfaceFields
Description
Author
\*----------------------------------------------------------------------------*/
#include "BlockLduInterfaceField.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeTemplateTypeNameAndDebug(type, Type, args...) \
defineTemplateTypeNameAndDebug(BlockLduInterfaceField<type>, 0);
forAllVectorNTypes(makeTemplateTypeNameAndDebug);
#undef makeTemplateTypeNameAndDebug
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-6 H. Jasak All rights reserved
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Description
Block matrix member static data members
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#include "blockVectorNMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeNamedTemplateTypeNameAndDebug(type, Type, args...) \
defineNamedTemplateTypeNameAndDebug(block##Type##Matrix, 0);
forAllVectorNTypes(makeNamedTemplateTypeNameAndDebug);
#undef makeNamedTemplateTypeNameAndDebug
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-6 H. Jasak All rights reserved
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Class
BlockLduMatrix
Description
Typedefs for block matrices
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef blockVectorNMatrices_H
#define blockVectorNMatrices_H
#include "blockLduMatrices.H"
#include "VectorTensorNFieldsFwd.H"
#include "ExpandTensorNField.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#define makeTypedef(type, Type, args...) \
typedef BlockLduMatrix<type > block##Type##Matrix;
forAllVectorNTypes(makeTypedef)
#undef makeTypedef
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-6 H. Jasak All rights reserved
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\*---------------------------------------------------------------------------*/
#include "blockLduMatrices.H"
#include "addToRunTimeSelectionTable.H"
#include "blockLduPrecons.H"
#include "BlockNoPrecon.H"
#include "blockDiagonalPrecons.H"
#include "blockGaussSeidelPrecons.H"
#include "BlockCholeskyPrecon.H"
#include "blockLduSmoothers.H"
#include "blockGaussSeidelSmoothers.H"
#include "BlockILUSmoother.H"
#include "blockLduSolvers.H"
#include "BlockDiagonalSolver.H"
#include "BlockBiCGStabSolver.H"
#include "BlockCGSolver.H"
#include "BlockGaussSeidelSolver.H"
#include "BlockGMRESSolver.H"
#include "VectorTensorNFields.H"
#include "ExpandTensorN.H"
#include "ExpandTensorNField.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeSolver(type, Type, args...) \
/* Preconditioners */ \
typedef BlockLduPrecon<type > block##Type##Precon; \
defineNamedTemplateTypeNameAndDebug(block##Type##Precon, 0); \
defineTemplateRunTimeSelectionTable(block##Type##Precon, dictionary); \
\
typedef BlockNoPrecon<type > block##Type##NoPrecon; \
makeBlockPrecon(block##Type##Precon, block##Type##NoPrecon); \
\
typedef BlockDiagonalPrecon<type > block##Type##DiagonalPrecon; \
makeBlockPrecon(block##Type##Precon, block##Type##DiagonalPrecon); \
\
typedef BlockGaussSeidelPrecon<type > block##Type##GaussSeidelPrecon; \
makeBlockPrecon(block##Type##Precon, block##Type##GaussSeidelPrecon); \
\
typedef BlockCholeskyPrecon<type > block##Type##CholeskyPrecon; \
makeBlockPrecon(block##Type##Precon, block##Type##CholeskyPrecon); \
\
\
/* Smoothers */ \
typedef BlockLduSmoother<type > block##Type##Smoother; \
defineNamedTemplateTypeNameAndDebug(block##Type##Smoother, 0); \
defineTemplateRunTimeSelectionTable(block##Type##Smoother, dictionary); \
\
typedef BlockGaussSeidelSmoother<type > block##Type##GaussSeidelSmoother; \
makeBlockSmoother(block##Type##Smoother, block##Type##GaussSeidelSmoother); \
\
typedef BlockILUSmoother<type > block##Type##ILUSmoother; \
makeBlockSmoother(block##Type##Smoother, block##Type##ILUSmoother); \
\
\
/* Solvers */ \
typedef BlockLduSolver<type > block##Type##Solver; \
defineNamedTemplateTypeNameAndDebug(block##Type##Solver, 0); \
defineTemplateRunTimeSelectionTable \
( \
block##Type##Solver, \
symMatrix \
); \
\
defineTemplateRunTimeSelectionTable \
( \
block##Type##Solver, \
asymMatrix \
); \
\
typedef BlockDiagonalSolver<type > block##Type##DiagonalSolver; \
defineNamedTemplateTypeNameAndDebug(block##Type##DiagonalSolver, 0); \
\
typedef BlockBiCGStabSolver<type > block##Type##BiCGStabSolver; \
makeBlockSolverTypeName(block##Type##BiCGStabSolver); \
addSolverToBlockMatrix(Type, block##Type##BiCGStabSolver, symMatrix); \
addSolverToBlockMatrix(Type, block##Type##BiCGStabSolver, asymMatrix); \
\
typedef BlockCGSolver<type > block##Type##CGSolver; \
makeBlockSolverTypeName(block##Type##CGSolver); \
addSolverToBlockMatrix(Type, block##Type##CGSolver, symMatrix); \
\
typedef BlockGaussSeidelSolver<type > block##Type##GaussSeidelSolver; \
makeBlockSolverTypeName(block##Type##GaussSeidelSolver); \
addSolverToBlockMatrix(Type, block##Type##GaussSeidelSolver, symMatrix); \
\
typedef BlockGMRESSolver<type > block##Type##GMRESSolver; \
makeBlockSolverTypeName(block##Type##GMRESSolver); \
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, symMatrix); \
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, asymMatrix);
forAllVectorNTypes(makeSolver)
#undef makeSolver
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,83 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Dimensioned VectorN and TensorN obtained from generic dimensioned type.
\*---------------------------------------------------------------------------*/
#include "dimensionedVectorTensorN.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define UNARY_FUNCTION(returnType, type, fun, text) \
inline returnType fun(const type& t) \
{ \
return returnType \
( \
#text "(" + t.name() + ')', \
fun(t.dimensions()), \
fun(t.value()) \
); \
}
#define dimensionedType_Funs(cmptType, vectorType, tensorType, \
diagTensorType, sphericalTensorType) \
UNARY_FUNCTION(tensorType, tensorType, inv, inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType, inv, inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, inv, inv) \
UNARY_FUNCTION(diagTensorType, tensorType, diag, diag) \
UNARY_FUNCTION(diagTensorType, diagTensorType, diag, diag) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, diag, diag)\
UNARY_FUNCTION(cmptType, vectorType, cmptSum, cmptSum)
#define dimensionedVectorN_Funs(length) \
dimensionedType_Funs \
( \
dimensionedScalar, \
dimensionedVector##length, \
dimensionedTensor##length, \
dimensionedDiagTensor##length, \
dimensionedSphericalTensor##length \
)
dimensionedVectorN_Funs(2)
dimensionedVectorN_Funs(4)
dimensionedVectorN_Funs(6)
dimensionedVectorN_Funs(8)
#undef dimensionedVectorN_Funs
#undef dimensionedType_Funs
#undef UNARY_FUNCTION
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
dimensionedVectorTensorN
Description
Dimensioned VectorN and TensorN obtained from generic dimensioned type.
Author
Ivor Clifford
SourceFiles
dimensionedVectorTensorN.C
\*---------------------------------------------------------------------------*/
#ifndef dimensionedVectorTensorN_H
#define dimensionedVectorTensorN_H
#include "dimensionedType.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#define doMakeTypedef(type, Type, args...) \
typedef dimensioned<type> dimensioned##Type;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// friend functions
dimensionSet diag(const dimensionSet& ds);
dimensionSet cmptSum(const dimensionSet& ds);
dimensionSet contractLinear(const dimensionSet& ds);
dimensionSet contractScalar(const dimensionSet& ds);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define dimensionedType_Funs(tensorType, diagTensorType, \
sphericalTensorType, vectorType, cmptType, args...) \
\
tensorType inv(const tensorType&); \
diagTensorType inv(const diagTensorType&); \
sphericalTensorType inv(const sphericalTensorType&); \
\
tensorType inv(const tensorType&); \
diagTensorType inv(const diagTensorType&); \
sphericalTensorType inv(const sphericalTensorType&); \
\
cmptType cmptSum(const vectorType&);
#define dimensionedVectorN_Funs(length) \
dimensionedType_Funs \
( \
dimensionedScalar, \
dimensionedVector##length, \
dimensionedTensor##length, \
dimensionedDiagTensor##length, \
dimensionedSphericalTensor##length \
)
forAllVectorTensorNTypes(dimensionedType_Funs)
#undef dimensionedVectorN_Funs
#undef dimensionedType_Funs
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dimensionedVectorTensorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
dimensionedVectorTensorN
Description
Author
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
inline dimensionSet diag(const dimensionSet& ds)
{
return ds;
}
inline dimensionSet cmptSum(const dimensionSet& ds)
{
return ds;
}
inline dimensionSet contractLinear(const dimensionSet& ds)
{
return ds;
}
inline dimensionSet contractScalar(const dimensionSet& ds)
{
return ds;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// ************************************************************************* //

View file

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DimensionedDiagTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType,diag,diag) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, diagTensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+',add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'+', subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,115 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DimensionedDiagTensorNFields
Description
Specialisation of DimensionedField<T> for DiagTensorN
SourceFiles
DimensionedDiagTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef DimensionedDiagTensorNFields_H
#define DimensionedDiagTensorNFields_H
#include "DimensionedField.H"
#include "dimensionedVectorTensorN.H"
#include "VectorTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType,diag,diag) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, diagTensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+',add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'+', subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DimensionedDiagTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DimensionedSphericalTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,inv,inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,diag,diag) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DimensionedSphericalTensorNFields
Description
Specialisation of DimensionedField<T> for SphericalTensorN.
SourceFiles
DimensionedSphericalTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef DimensionedSphericalTensorNFields_H
#define DimensionedSphericalTensorNFields_H
#include "DimensionedField.H"
#include "dimensionedVectorTensorN.H"
#include "VectorTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,inv,inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,diag,diag) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DimensionedSphericalTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DimensionedTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, tensorType,diag,diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag, negSumDiag) \
UNARY_FUNCTION(vectorType, tensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, tensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DimensionedTensorNFields
Description
Specialisation of DimensionedField<T> for TensorN.
SourceFiles
DimensionedTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef DimensionedTensorNFields_H
#define DimensionedTensorNFields_H
#include "DimensionedField.H"
#include "dimensionedVectorTensorN.H"
#include "VectorTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, tensorType,diag,diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag, negSumDiag) \
UNARY_FUNCTION(vectorType, tensorType, contractLinear,contractLinear) \
UNARY_FUNCTION(CmptType, tensorType, contractScalar,contractLinear) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DimensionedTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DimensionedVectorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "undefFieldFunctionsM.H"
// ************************************************************************* //

View file

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DimensionedVectorNFields
Description
Specialisations of DimensionedField<T> for VectorN types.
SourceFiles
DimensionedVectorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef DimensionedVectorNFields_H
#define DimensionedVectorNFields_H
#include "DimensionedField.H"
#include "dimensionedVectorTensorN.H"
#include "VectorTensorNFields.H"
#define TEMPLATE template<class GeoMesh>
#include "DimensionedFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DimensionedVectorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DiagTensorNFieldFields.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType, inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType, diag) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear) \
UNARY_FUNCTION(CmptType, diagTensorType, contractScalar) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DiagTensorNFieldFields
Description
Specialisation of FieldField<Field,T> for DiagTensorN
SourceFiles
DiagTensorNFieldFields.C
\*---------------------------------------------------------------------------*/
#ifndef DiagTensorNFieldFields_H
#define DiagTensorNFieldFields_H
#include "VectorTensorNFieldFieldsFwd.H"
#include "FieldField.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType, inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType, diag) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear) \
UNARY_FUNCTION(CmptType, diagTensorType, contractScalar) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DiagTensorNFieldFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "SphericalTensorNFieldFields.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, diag) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractLinear) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractScalar) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
SphericalTensorNFieldFields
Description
Specialisation of FieldField<Field,T> for SphericalTensorN.
SourceFiles
SphericalTensorNFieldFields.C
\*---------------------------------------------------------------------------*/
#ifndef SphericalTensorNFieldFields_H
#define SphericalTensorNFieldFields_H
#include "VectorTensorNFieldFieldsFwd.H"
#include "FieldField.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, diag) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractLinear) \
UNARY_FUNCTION(CmptType, sphericalTensorType, contractScalar) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "SphericalTensorNFieldFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "TensorNFieldFields.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType, inv) \
UNARY_FUNCTION(diagTensorType, tensorType, diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag) \
UNARY_FUNCTION(vectorType, tensorType, contractLinear) \
UNARY_FUNCTION(CmptType, tensorType, contractScalar) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
tensorNFieldFields
Description
Specialisation of FieldField<Field,T> for TensorN.
SourceFiles
TensorNFieldFields.C
\*---------------------------------------------------------------------------*/
#ifndef TensorNFieldFields_H
#define TensorNFieldFields_H
#include "VectorTensorNFieldFieldsFwd.H"
#include "FieldField.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType, inv) \
UNARY_FUNCTION(diagTensorType, tensorType, diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag) \
UNARY_FUNCTION(vectorType, tensorType, contractLinear) \
UNARY_FUNCTION(CmptType, tensorType, contractScalar) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "TensorNFieldFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "VectorNFieldFields.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, vectorType, CmptType, /,divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, CmptType, /,divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorNFieldFields
Description
Specialisations of FieldField<Field,T> for VectorN types.
SourceFiles
VectorNFieldFields.C
\*---------------------------------------------------------------------------*/
#ifndef VectorNFieldFields_H
#define VectorNFieldFields_H
#include "VectorTensorNFieldFieldsFwd.H"
#include "FieldField.H"
#define TEMPLATE template<template<class> class Field>
#include "FieldFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, vectorType, CmptType, /,divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, CmptType, /,divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "VectorNFieldFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,68 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorTensorNFieldFieldsFwd
Description
Author
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef VectorTensorNFieldFieldsFwd_H
#define VectorTensorNFieldFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<template<class> class Field, class Type>
class FieldField;
#define makeTypedef(Type, args...) \
typedef FieldField<Field, Type > Type##FieldField;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DiagTensorNFields.H"
#include "transformField.H"
#define TEMPLATE
#include "FieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType, inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType, diag) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
\
template<> \
tmp<Field<diagTensorType> > transformFieldMask<diagTensorType> \
( \
const Field<sphericalTensorType>& stf \
) \
{ \
tmp<Field<diagTensorType> > tRes( new Field<diagTensorType>(stf.size()) ); \
Field<diagTensorType>& res = tRes(); \
TFOR_ALL_F_OP_F(diagTensorType, res, =, sphericalTensorType, stf) \
return tRes; \
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DiagTensorNFields
Description
Specialisation of Field<T> for DiagTensorN
SourceFiles
DiagTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef DiagTensorNFields_H
#define DiagTensorNFields_H
#include "VectorTensorNFieldsFwd.H"
#include "Field.H"
#define TEMPLATE
#include "FieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType, inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType, diag) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /, divide)\
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "SphericalTensorNFields.H"
#include "transformField.H"
#define TEMPLATE
#include "FieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, diag) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// ************************************************************************* //

View file

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
SphericalTensorNFields
Description
Specialisation of Field<T> for SphericalTensorN.
SourceFiles
SphericalTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef SphericalTensorNFields_H
#define SphericalTensorNFields_H
#include "VectorTensorNFieldsFwd.H"
#include "Field.H"
#define TEMPLATE
#include "FieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType, diag) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,137 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "TensorNFields.H"
#include "transformField.H"
#define TEMPLATE
#include "FieldFunctionsM.C"
#include "ExpandTensorN.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType,diagTensorType, \
sphericalTensorType,vectorType,CmptType, \
args...) \
\
UNARY_FUNCTION(tensorType, tensorType, inv) \
UNARY_FUNCTION(diagTensorType, tensorType, diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract) \
\
template<> \
tmp<Field<tensorType> > transformFieldMask<tensorType> \
( \
const Field<diagTensorType>& dtf \
) \
{ \
tmp<Field<tensorType> > tRes(new Field<tensorType>(dtf.size())); \
Field<tensorType>& res = tRes(); \
TFOR_ALL_F_OP_F(tensorType, res, =, diagTensorType, dtf) \
return tRes; \
} \
\
template<> \
tmp<Field<tensorType> > transformFieldMask<tensorType> \
( \
const Field<sphericalTensorType>& stf \
) \
{ \
tmp<Field<tensorType> > tRes(new Field<tensorType>(stf.size())); \
Field<tensorType>& res = tRes(); \
TFOR_ALL_F_OP_F(tensorType, res, =, sphericalTensorType, stf) \
return tRes; \
} \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,125 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
tensorNFields
Description
Specialisation of Field<T> for TensorN.
SourceFiles
TensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef TensorNFields_H
#define TensorNFields_H
#include "VectorTensorNFieldsFwd.H"
#include "Field.H"
#define TEMPLATE
#include "FieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType,diagTensorType, \
sphericalTensorType,vectorType,CmptType, \
args...) \
\
UNARY_FUNCTION(tensorType, tensorType, inv) \
UNARY_FUNCTION(diagTensorType, tensorType, diag) \
UNARY_FUNCTION(tensorType, tensorType, negSumDiag) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,83 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Include the header files for all the primitive types that Fields are
instantiated for.
\*---------------------------------------------------------------------------*/
#ifndef VectorNFieldTypes_H
#define VectorNFieldTypes_H
#include "vector2.H"
#include "vector4.H"
#include "vector6.H"
#include "vector8.H"
#include "tensor2.H"
#include "tensor4.H"
#include "tensor6.H"
#include "tensor8.H"
#include "diagTensor2.H"
#include "diagTensor4.H"
#include "diagTensor6.H"
#include "diagTensor8.H"
#define forAllVectorNTypes(m, args...) \
m(vector2, Vector2, args) \
m(vector4, Vector4, args) \
m(vector6, Vector6, args) \
m(vector8, Vector8, args)
#define forAllTensorNTypes(m, args...) \
m(tensor2, Tensor2, args) \
m(tensor4, Tensor4, args) \
m(tensor6, Tensor6, args) \
m(tensor8, Tensor8, args)
#define forAllDiagTensorNTypes(m, args...) \
m(diagTensor2, DiagTensor2, args) \
m(diagTensor4, DiagTensor4, args) \
m(diagTensor6, DiagTensor6, args) \
m(diagTensor8, DiagTensor8, args)
#define forAllSphericalTensorNTypes(m, args...) \
m(sphericalTensor2, SphericalTensor2, args) \
m(sphericalTensor4, SphericalTensor4, args) \
m(sphericalTensor6, SphericalTensor6, args) \
m(sphericalTensor8, SphericalTensor8, args)
#define forAllVectorTensorNTypes(m, args...) \
m(tensor2, diagTensor2, sphericalTensor2, vector2, scalar, args) \
m(tensor4, diagTensor4, sphericalTensor4, vector4, scalar, args) \
m(tensor6, diagTensor6, sphericalTensor6, vector6, scalar, args) \
m(tensor8, diagTensor8, sphericalTensor8, vector8, scalar, args)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "VectorNFields.H"
#define TEMPLATE
#include "FieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType,diagTensorType, \
sphericalTensorType,vectorType,CmptType, \
args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorNFields
Description
Specialisations of Field<T> for VectorN types.
SourceFiles
VectorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef VectorNFields_H
#define VectorNFields_H
#include "VectorTensorNFieldsFwd.H"
#include "Field.H"
#define TEMPLATE
#include "FieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType,diagTensorType, \
sphericalTensorType,vectorType,CmptType, \
args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /, divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /, divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +, add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -, subtract) \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorTensorNFields
Description
Specialisations of Field<T> for VectorN and TensorN types.
\*---------------------------------------------------------------------------*/
#ifndef VectorTensorNFields_H
#define VectorTensorNFields_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "VectorNFields.H"
#include "TensorNFields.H"
#include "DiagTensorNFields.H"
#include "SphericalTensorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorNFields
Description
Forward declarations of the specialisations of Field<T> for
TensorN types.
\*---------------------------------------------------------------------------*/
#ifndef VectorNFieldsFwd_H
#define VectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type> class Field;
#define makeTypedef(Type, args...) \
typedef Field<Type > Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "GeometricDiagTensorNFields.H"
#include "ExpandTensorNField.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType,diag,diag) \
UNARY_FUNCTION(CmptType, diagTensorType,contractScalar,contractScalar) \
UNARY_FUNCTION(vectorType, diagTensorType,contractLinear,contractLinear) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, *,'*',multiply) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+',add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'+', subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
GeometricDiagTensorNFields
Description
Specialisation of GeometricField<T> for DiagTensorN
SourceFiles
GeometricDiagTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef GeometricDiagTensorNFields_H
#define GeometricDiagTensorNFields_H
#include "GeometricField.H"
#include "DimensionedDiagTensorNFields.H"
#include "DiagTensorNFieldFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DiagTensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(diagTensorType, diagTensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, diagTensorType,diag,diag) \
UNARY_FUNCTION(CmptType, diagTensorType,contractScalar,contractScalar) \
UNARY_FUNCTION(vectorType, diagTensorType,contractLinear,contractLinear) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, CmptType, diagTensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(diagTensorType, CmptType, diagTensorType, *,'*',multiply) \
\
BINARY_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+',add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, sphericalTensorType, diagTensorType, -,'-', subtract) \
\
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'-', subtract) \
\
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, +,'+', add) \
BINARY_TYPE_OPERATOR(diagTensorType, diagTensorType, sphericalTensorType, -,'+', subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(DiagTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef DiagTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "GeometricDiagTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "GeometricSphericalTensorNFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,inv,inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,diag,diag) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, *,'*',multiply) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
GeometricSphericalTensorNFields
Description
Specialisation of GeometricField<T> for SphericalTensorN.
SourceFiles
GeometricSphericalTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef GeometricSphericalTensorNFields_H
#define GeometricSphericalTensorNFields_H
#include "GeometricField.H"
#include "DimensionedSphericalTensorNFields.H"
#include "SphericalTensorNFieldFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define SphericalTensorN_FieldFunctions(tensorType, diagTensorType, \
sphericalTensorType, vectorType, CmptType, args...) \
\
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,inv,inv) \
UNARY_FUNCTION(sphericalTensorType, sphericalTensorType,diag,diag) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, *,'*',multiply) \
\
BINARY_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, CmptType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(sphericalTensorType, sphericalTensorType, sphericalTensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(SphericalTensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef SphericalTensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "GeometricSphericalTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "GeometricTensorNFields.H"
#include "ExpandTensorNField.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, tensorType,diag,diag) \
UNARY_FUNCTION(tensorType, tensorType,negSumDiag,negSumDiag) \
UNARY_FUNCTION(CmptType, tensorType,contractScalar,contractScalar) \
UNARY_FUNCTION(vectorType, tensorType,contractLinear,contractLinear) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
GeometricTensorNFields
Description
Specialisation of GeometricField<T> for TensorN.
SourceFiles
GeometricTensorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef GeometricTensorNFields_H
#define GeometricTensorNFields_H
#include "GeometricField.H"
#include "DimensionedTensorNFields.H"
#include "TensorNFieldFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(tensorType, tensorType,inv,inv) \
UNARY_FUNCTION(diagTensorType, tensorType,diag,diag) \
UNARY_FUNCTION(tensorType, tensorType,negSumDiag,negSumDiag) \
UNARY_FUNCTION(CmptType, tensorType,contractScalar,contractScalar) \
UNARY_FUNCTION(vectorType, tensorType,contractLinear,contractLinear) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
\
BINARY_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
\
BINARY_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
\
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(TensorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef TensorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "GeometricTensorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "GeometricVectorNFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, *,'*',multiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
GeometricVectorNFields
Description
Specialisations of GeometricField<T> for VectorN types.
SourceFiles
GeometricVectorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef GeometricVectorNFields_H
#define GeometricVectorNFields_H
#include "GeometricField.H"
#include "DimensionedVectorNFields.H"
#include "VectorNFieldFields.H"
#define TEMPLATE template<template<class> class PatchField, class GeoMesh>
#include "GeometricFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define VectorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, CmptType, args...) \
\
UNARY_FUNCTION(CmptType, vectorType, cmptSum, cmptSum) \
\
BINARY_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
BINARY_TYPE_FUNCTION(vectorType, vectorType, vectorType, cmptMultiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, *,'*',multiply) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, *,'*',multiply) \
\
BINARY_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
BINARY_TYPE_OPERATOR(vectorType, CmptType, vectorType, /,'|',divide) \
\
BINARY_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract) \
\
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, +,'+',add) \
BINARY_TYPE_OPERATOR(vectorType, vectorType, vectorType, -,'-',subtract)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forAllVectorTensorNTypes(VectorN_FieldFunctions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef VectorN_FieldFunctions
#include "undefFieldFunctionsM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "GeometricVectorNFields.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Specialisation of List<T> for VectorN and TensorN types.
\*---------------------------------------------------------------------------*/
#include "VectorNLists.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#define makeListType(type, Type, args...) \
defineCompoundTypeName(List<type>, Type##List); \
addCompoundToRunTimeSelectionTable(List<type>, type##List);
forAllVectorNTypes(makeListType)
forAllTensorNTypes(makeListType)
forAllDiagTensorNTypes(makeListType)
forAllSphericalTensorNTypes(makeListType)
#undef makeListType
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
VectorNLists
Description
Specialisation of List<T> for VectorN and TensorN types.
\*---------------------------------------------------------------------------*/
#ifndef VectorNLists_H
#define VectorNLists_H
#include "VectorNFieldTypes.H"
#include "List.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#define makeListTypeDef(type, Type, args...) \
typedef List<type> type##List;
forAllVectorNTypes(makeListTypeDef)
forAllTensorNTypes(makeListTypeDef)
forAllDiagTensorNTypes(makeListTypeDef)
forAllSphericalTensorNTypes(makeListTypeDef)
#undef makeListTypeDef
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Global functions for expansion and contraction of tensorN coefficient
to diagonal and scalar type
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
\*---------------------------------------------------------------------------*/
#ifndef expandTensorN_H
#define expandTensorN_H
#include "VectorN.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define UNARY_TEMPLATE_FUNCTION(ReturnType, Type, Func) \
template<class Cmpt, int length> \
inline void Func(ReturnType<Cmpt,length>&, const Type<Cmpt,length>&);
#define UNARY_TEMPLATE_FUNCTION_VS(ReturnType, Func) \
template<class Cmpt, int length> \
inline void Func(ReturnType<Cmpt,length>&, const Cmpt&);
#define UNARY_TEMPLATE_FUNCTION_SV(Type, Func) \
template<class Cmpt, int length> \
inline void Func(Cmpt&, const Type<Cmpt,length>&);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
UNARY_TEMPLATE_FUNCTION_SV(TensorN, contractScalar)
UNARY_TEMPLATE_FUNCTION_SV(DiagTensorN, contractScalar)
UNARY_TEMPLATE_FUNCTION_SV(SphericalTensorN, contractScalar)
UNARY_TEMPLATE_FUNCTION_SV(VectorN, contractScalar)
UNARY_TEMPLATE_FUNCTION(VectorN, TensorN, contractLinear)
UNARY_TEMPLATE_FUNCTION(VectorN, DiagTensorN, contractLinear)
UNARY_TEMPLATE_FUNCTION(VectorN, SphericalTensorN, contractLinear)
UNARY_TEMPLATE_FUNCTION_VS(VectorN, expandScalar)
UNARY_TEMPLATE_FUNCTION_VS(TensorN, expandScalar)
UNARY_TEMPLATE_FUNCTION_VS(DiagTensorN, expandScalar)
UNARY_TEMPLATE_FUNCTION_VS(SphericalTensorN, expandScalar)
UNARY_TEMPLATE_FUNCTION(TensorN, VectorN, expandLinear)
UNARY_TEMPLATE_FUNCTION(DiagTensorN, VectorN, expandLinear)
UNARY_TEMPLATE_FUNCTION(SphericalTensorN, VectorN, expandLinear)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "ExpandTensorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef UNARY_TEMPLATE_FUNCTION
#undef UNARY_TEMPLATE_FUNCTION_VS
#undef UNARY_TEMPLATE_FUNCTION_SV
#endif
// ************************************************************************* //

View file

@ -0,0 +1,168 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Global functions for expansion and contraction of tensor field
to diagonal type
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
\*---------------------------------------------------------------------------*/
#include "ExpandTensorNField.H"
#include "ExpandTensorN.H"
#include "Field.H"
#include "VectorNFieldTypes.H"
#include "FieldM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define UNARY_FUNCTION(typeF1, typeF2, FUNC) \
\
void FUNC(Field<typeF1>& f1, const UList<typeF2>& f2) \
{ \
checkFields(f1, f2, #FUNC "(f1,f2)"); \
\
List_ACCESS(typeF1, f1, f1P); \
List_CONST_ACCESS(typeF2, f2, f2P); \
\
List_FOR_ALL(f1,i) \
FUNC(List_ELEM(f1, f1P, i), List_ELEM(f2, f2P, i)); \
List_END_FOR_ALL \
} \
\
void FUNC(Field<typeF1>& f1, const tmp<Field<typeF2> >& tf2) \
{ \
FUNC(f1,tf2()); \
tf2.clear(); \
}
#define ExpandFieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, cmptType, args...) \
\
UNARY_FUNCTION(cmptType, tensorType, contractScalar) \
UNARY_FUNCTION(cmptType, diagTensorType, contractScalar) \
UNARY_FUNCTION(cmptType, sphericalTensorType, contractScalar) \
UNARY_FUNCTION(cmptType, vectorType, contractScalar) \
\
UNARY_FUNCTION(vectorType, tensorType, contractLinear) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear) \
UNARY_FUNCTION(vectorType, sphericalTensorType, contractLinear) \
\
UNARY_FUNCTION(vectorType, cmptType, expandScalar) \
UNARY_FUNCTION(tensorType, cmptType, expandScalar) \
UNARY_FUNCTION(diagTensorType, cmptType, expandScalar) \
UNARY_FUNCTION(sphericalTensorType, cmptType, expandScalar) \
\
UNARY_FUNCTION(tensorType, vectorType, expandLinear) \
UNARY_FUNCTION(diagTensorType, vectorType, expandLinear) \
UNARY_FUNCTION(sphericalTensorType, vectorType, expandLinear)
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
forAllVectorTensorNTypes(ExpandFieldFunctions)
// template<class Cmpt, int length>
// void contractScalar
// (
// Field<Cmpt>& res,
// const UList<TensorN<Cmpt, length> >& f
// )
// {
// forAll (res, i)
// {
// contractScalar(res[i], f[i]);
// }
// }
//
//
// template <class Cmpt, int length>
// void contractLinear
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<TensorN<Cmpt, length> >& f
// )
// {
// forAll (res, i)
// {
// contractLinear(res[i], f[i]);
// }
// }
//
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// )
// {
// forAll (res, i)
// {
// expandScalar(res[i], f[i]);
// }
// }
//
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<TensorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// )
// {
// forAll (res, i)
// {
// expandScalar(res[i], f[i]);
// }
// }
//
//
// template <class Cmpt, int length>
// void expandLinear
// (
// Field<TensorN<Cmpt, length> >& res,
// const UList<VectorN<Cmpt, length> >& f
// )
// {
// forAll (res, i)
// {
// expandLinear(res[i], f[i]);
// }
// }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef UNARY_FUNCTION
#undef ExpandFieldFunctions
// ************************************************************************* //

View file

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Global functions for expansion and contraction of tensor field
to diagonal type
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
SourceFiles
ExpandTensorNField.C
\*---------------------------------------------------------------------------*/
#ifndef expandTensorNField_H
#define expandTensorNField_H
#include "Field.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define UNARY_FUNCTION(typeF1, typeF2, FUNC) \
void FUNC(Field<typeF1>& f1, const UList<typeF2>& f2); \
void FUNC(Field<typeF1>& f1, const tmp<Field<typeF2> >& tf2);
#define ExpandFieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
vectorType, cmptType, args...) \
\
UNARY_FUNCTION(cmptType, tensorType, contractScalar) \
UNARY_FUNCTION(cmptType, diagTensorType, contractScalar) \
UNARY_FUNCTION(cmptType, sphericalTensorType, contractScalar) \
UNARY_FUNCTION(cmptType, vectorType, contractScalar) \
\
UNARY_FUNCTION(vectorType, tensorType, contractLinear) \
UNARY_FUNCTION(vectorType, diagTensorType, contractLinear) \
UNARY_FUNCTION(vectorType, sphericalTensorType, contractLinear) \
\
UNARY_FUNCTION(vectorType, cmptType, expandScalar) \
UNARY_FUNCTION(tensorType, cmptType, expandScalar) \
UNARY_FUNCTION(diagTensorType, cmptType, expandScalar) \
UNARY_FUNCTION(sphericalTensorType, cmptType, expandScalar) \
\
UNARY_FUNCTION(tensorType, vectorType, expandLinear) \
UNARY_FUNCTION(diagTensorType, vectorType, expandLinear) \
UNARY_FUNCTION(sphericalTensorType, vectorType, expandLinear)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
forAllVectorTensorNTypes(ExpandFieldFunctions)
// template <class Cmpt, int length>
// void contractScalar
// (
// Field<Cmpt>& res,
// const UList<TensorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void contractScalar
// (
// Field<Cmpt>& res,
// const UList<DiagTensorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void contractScalar
// (
// Field<Cmpt>& res,
// const UList<SphericalTensorN<Cmpt, length> >& f
// );
//
// // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//
// template <class Cmpt, int length>
// void contractLinear
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<TensorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void contractLinear
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<DiagTensorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void contractLinear
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<SphericalTensorN<Cmpt, length> >& f
// );
//
// // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<VectorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// );
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<TensorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// );
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<DiagTensorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// );
//
// template <class Cmpt, int length>
// void expandScalar
// (
// Field<SphericalTensorN<Cmpt, length> >& res,
// const UList<Cmpt>& f
// );
//
// // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//
// template <class Cmpt, int length>
// void expandLinear
// (
// Field<TensorN<Cmpt, length> >& res,
// const UList<VectorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void expandLinear
// (
// Field<DiagTensorN<Cmpt, length> >& res,
// const UList<VectorN<Cmpt, length> >& f
// );
//
// template <class Cmpt, int length>
// void expandLinear
// (
// Field<SphericalTensorN<Cmpt, length> >& res,
// const UList<VectorN<Cmpt, length> >& f
// );
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef UNARY_FUNCTION
#undef ExpandFieldFunctions
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// #ifdef NoRepository
// # include "ExpandTensorNField.C"
// #endif
// ************************************************************************* //
#endif

View file

@ -0,0 +1,322 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
ExpandTensorN
Description
Author
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Return the Average of a vector of as a scalar
template <class Cmpt, int length>
inline void contractScalar(Cmpt& result, const VectorN<Cmpt, length>& t)
{
result = pTraits<Cmpt>::zero;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result += t[i];
}
//- Modified 2009/11/3 by I. Clifford
result *= 1.0/VectorN<Cmpt, length>::nComponents;
}
//- Return the Average of a vector of as a scalar
template <class Cmpt, int length>
inline Cmpt contractScalar(const VectorN<Cmpt, length>& t)
{
Cmpt result;
contractScalar(result, t);
return result;
}
//- Return the diagonal of a TensorN as a scalar
template <class Cmpt, int length>
inline void contractScalar(Cmpt& result, const TensorN<Cmpt, length>& t)
{
result = pTraits<Cmpt>::zero;
int j=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result += t[j];
j += TensorN<Cmpt, length>::rowLength+1;
}
//- Modified 2009/11/3 by I. Clifford
result *= 1.0/TensorN<Cmpt, length>::rowLength;
}
//- Return the diagonal of a TensorN as a scalar
template <class Cmpt, int length>
inline Cmpt contractScalar(const TensorN<Cmpt, length>& t)
{
Cmpt result;
contractScalar(result, t);
return result;
}
//- Return the diagonal of a DiagTensorN as a scalar
template <class Cmpt, int length>
inline void contractScalar(Cmpt& result, const DiagTensorN<Cmpt, length>& t)
{
result = pTraits<Cmpt>::zero;
for (int i = 0; i < DiagTensorN<Cmpt, length>::rowLength; i++)
{
result += t[i];
}
result *= 1.0/TensorN<Cmpt, length>::rowLength;
}
//- Return the diagonal of a DiagTensorN as a scalar
template <class Cmpt, int length>
inline Cmpt contractScalar(const DiagTensorN<Cmpt, length>& t)
{
Cmpt result;
contractScalar(result, t);
return result;
}
//- Return the diagonal of a SphericalTensorN as a scalar
template <class Cmpt, int length>
inline void contractScalar(Cmpt& result, const SphericalTensorN<Cmpt, length>& t)
{
result = t[0];
}
//- Return the diagonal of a SphericalTensorN as a scalar
template <class Cmpt, int length>
inline Cmpt contractScalar(const SphericalTensorN<Cmpt, length>& t)
{
Cmpt result;
contractScalar(result, t);
return result;
}
//- Return the diagonal of a TensorN as a vector
template <class Cmpt, int length>
inline void contractLinear
(
VectorN<Cmpt, length>& result,
const TensorN<Cmpt, length>& t
)
{
int j=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result[i] = t[j];
j += TensorN<Cmpt, length>::rowLength+1;
}
}
//- Return the diagonal of a TensorN as a vector
template <class Cmpt, int length>
inline VectorN<Cmpt, length> contractLinear(const TensorN<Cmpt, length>& t)
{
VectorN<Cmpt, length> result;
contractLinear(result, t);
return result;
}
//- Return the diagonal of a DiagTensorN as a vector
template <class Cmpt, int length>
inline void contractLinear
(
VectorN<Cmpt, length>& result,
const DiagTensorN<Cmpt, length>& t
)
{
for (int i = 0; i < DiagTensorN<Cmpt, length>::rowLength; i++)
{
result[i] = t[i];
}
}
//- Return the diagonal of a DiagTensorN as a vector
template <class Cmpt, int length>
inline VectorN<Cmpt, length> contractLinear(const DiagTensorN<Cmpt, length>& t)
{
VectorN<Cmpt, length> result;
contractLinear(result, t);
return result;
}
//- Return the diagonal of a SphericalTensorN as a vector
template <class Cmpt, int length>
inline void contractLinear
(
VectorN<Cmpt, length>& result,
const SphericalTensorN<Cmpt, length>& t
)
{
for (int i = 0; i < SphericalTensorN<Cmpt, length>::rowLength; i++)
{
result[i] = t[0];
}
}
//- Return the diagonal of a SphericalTensorN as a vector
template <class Cmpt, int length>
inline VectorN<Cmpt, length> contractLinear
(
const SphericalTensorN<Cmpt, length>& t
)
{
VectorN<Cmpt, length> result;
contractLinear(result, t);
return result;
}
//- Return the VectorN given a scalar
template <class Cmpt, int length>
inline void expandScalar(VectorN<Cmpt, length>& result, const Cmpt& v)
{
for (int i = 0; i < VectorN<Cmpt, length>::nComponents; i++)
{
result[i] = v;
}
}
//- Return the TensorN given a scalar
template <class Cmpt, int length>
inline void expandScalar(TensorN<Cmpt, length>& result, const Cmpt& v)
{
result = TensorN<Cmpt, length>::zero;
int j =0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result[j] = v;
j += TensorN<Cmpt, length>::rowLength+1;
}
}
//- Return the DiagTensorN given a scalar
template <class Cmpt, int length>
inline void expandScalar(DiagTensorN<Cmpt, length>& result, const Cmpt& v)
{
for (int i = 0; i < DiagTensorN<Cmpt, length>::rowLength; i++)
{
result[i] = v;
}
}
//- Return the SphericalTensorN given a scalar
template <class Cmpt, int length>
inline void expandScalar(SphericalTensorN<Cmpt, length>& result, const Cmpt& v)
{
result[0] = v;
}
//- Return the TensorN given a diagonal vectorN
template <class Cmpt, int length>
inline void expandLinear
(
TensorN<Cmpt, length>& result,
const VectorN<Cmpt, length>& v
)
{
result = TensorN<Cmpt, length>::zero;
int j=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result[j] = v[i];
j += TensorN<Cmpt, length>::rowLength+1;
}
}
//- Return the DiagTensorN given a diagonal vectorN
template <class Cmpt, int length>
inline void expandLinear
(
DiagTensorN<Cmpt, length>& result,
const VectorN<Cmpt, length>& v
)
{
for (int i = 0; i < DiagTensorN<Cmpt, length>::rowLength; i++)
{
result[i] = v[i];
}
}
//- Return the SphericalTensorN given a diagonal vectorN
template <class Cmpt, int length>
inline void expandLinear
(
SphericalTensorN<Cmpt, length>& result,
const VectorN<Cmpt, length>& v
)
{
result[0] = pTraits<Cmpt>::zero;
for (int i = 0; i < DiagTensorN<Cmpt, length>::rowLength; i++)
{
result[0] += v[i];
}
result[0] *= 1.0/DiagTensorN<Cmpt, length>::rowLength;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
DiagTensorN
Description
Templated NXN DiagTensor derived from VectorSpace adding construction from
N components, and the inner-product (dot-product) and outer-product operators.
SourceFiles
DiagTensorNI.H
\*---------------------------------------------------------------------------*/
#ifndef DiagTensorN_H
#define DiagTensorN_H
#include "VectorN.H"
#include "SphericalTensorN.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DiagTensor Declaration
\*---------------------------------------------------------------------------*/
template <class Cmpt, int length>
class DiagTensorN
:
public VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>
{
public:
// Member constants
enum
{
rank = 2, // Rank of DiagTensor is 2
rowLength = length
};
// Static data members
static const char* const typeName;
static const char* componentNames[];
static const DiagTensorN zero;
static const DiagTensorN one;
static const DiagTensorN I;
// Constructors
//- Construct null
inline DiagTensorN();
//- Construct given VectorSpace
inline DiagTensorN(const VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>&);
//- Construct from Istream
inline DiagTensorN(Istream&);
//- Construct given component value. Special use only!
explicit inline DiagTensorN(const Cmpt& tx);
// Member Functions
//- Diagonal
inline DiagTensorN<Cmpt, length> diag() const;
//- Transpose
inline DiagTensorN<Cmpt, length> T() const;
// Member Operators
//- Assign to a SphericalTensorN
inline void operator=(const SphericalTensorN<Cmpt, length>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "DiagTensorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,409 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Cmpt, int length>
const char* const DiagTensorN<Cmpt, length>::typeName =
("diagTensor" + name(length)).c_str();
template <class Cmpt, int length>
const DiagTensorN<Cmpt, length> DiagTensorN<Cmpt, length>::zero(0);
template <class Cmpt, int length>
const DiagTensorN<Cmpt, length> DiagTensorN<Cmpt, length>::one(1);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length>::DiagTensorN()
{}
// Construct given VectorSpace
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length>::DiagTensorN
(
const VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>& vs
)
:
VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>(vs)
{}
//- Construct from component
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length>::DiagTensorN(const Cmpt& tx)
{
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::eqOpS(*this, tx, eqOp<Cmpt>());
}
// Construct from Istream
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length>::DiagTensorN(Istream& is)
:
VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Return diagonal tensor diagonal
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> DiagTensorN<Cmpt, length>::diag() const
{
return *this;
}
//- Return diagonal tensor transpose
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> DiagTensorN<Cmpt, length>::T() const
{
return *this;
}
//- Assign to a SphericalTensorN
template <class Cmpt, int length>
inline void DiagTensorN<Cmpt, length>::operator=(const SphericalTensorN<Cmpt, length>& st)
{
const Cmpt& s = st.v_[0];
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::eqOpS(*this, s, eqOp<Cmpt>());
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Addition of DiagTensorN and DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator+(const DiagTensorN<Cmpt,length>& dt1, const DiagTensorN<Cmpt,length>& dt2)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::op(res, dt1, dt2, plusOp<Cmpt>());
return res;
}
//- Addition of DiagTensorN and SphericalTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator+(const DiagTensorN<Cmpt,length>& dt1, const SphericalTensorN<Cmpt,length>& st2)
{
const Cmpt& s = st2.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::opVS(res, dt1, s, plusOp<Cmpt>());
return res;
}
//- Addition of SphericalTensorN and DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator+(const SphericalTensorN<Cmpt,length>& st1, const DiagTensorN<Cmpt,length>& dt2)
{
const Cmpt& s = st1.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::opSV(res, s, dt2, plusOp<Cmpt>());
return res;
}
//- Subtraction of DiagTensorN and DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator-(const DiagTensorN<Cmpt,length>& dt1, const DiagTensorN<Cmpt,length>& dt2)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::op(res, dt1, dt2, minusOp<Cmpt>());
return res;
}
//- Subtraction of DiagTensorN and SphericalTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator-(const DiagTensorN<Cmpt,length>& dt1, const SphericalTensorN<Cmpt,length>& st2)
{
const Cmpt& s = st2.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::opVS(res, dt1, s, minusOp<Cmpt>());
return res;
}
//- Subtraction of SphericalTensorN and DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator-(const SphericalTensorN<Cmpt,length>& st1, const DiagTensorN<Cmpt,length>& dt2)
{
const Cmpt& s = st1.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt,length>::nComponents,0>::opSV(res, s, dt2, minusOp<Cmpt>());
return res;
}
//- Inner-product between a diagonal tensor and a diagonal tensor
template <class Cmpt, int length>
inline typename
innerProduct<DiagTensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >::type
operator&(const DiagTensorN<Cmpt, length>& dt1, const DiagTensorN<Cmpt, length>& dt2)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::op(res, dt1, dt2, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between spherical tensor and diagonal tensor
template <class Cmpt, int length>
inline typename
innerProduct<SphericalTensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >::type
operator&(const SphericalTensorN<Cmpt, length>& st1, const DiagTensorN<Cmpt, length>& dt2)
{
const Cmpt& s = st1.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opSV(res, s, dt2, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between diagonal tensor and spherical tensor
template <class Cmpt, int length>
inline typename
innerProduct<DiagTensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >::type
operator&(const DiagTensorN<Cmpt, length>& dt1, const SphericalTensorN<Cmpt, length>& st2)
{
const Cmpt& s = st2.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opVS(res, dt1, s, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between a diagonal tensor and a vector
template <class Cmpt, int length>
inline typename
innerProduct<DiagTensorN<Cmpt, length>, VectorN<Cmpt, length> >::type
operator&(const DiagTensorN<Cmpt, length>& dt, const VectorN<Cmpt, length>& v)
{
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opVV(res, dt, v, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between a vector and a tensor
template <class Cmpt, int length>
inline typename
innerProduct<VectorN<Cmpt, length>, DiagTensorN<Cmpt, length> >::type
operator&(const VectorN<Cmpt, length>& v, const DiagTensorN<Cmpt, length>& dt)
{
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opVV(res, v, dt, multiplyOp<Cmpt>());
return res;
}
//- Division of a scalar by a diagonalTensor
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length>
operator/(const scalar s, const DiagTensorN<Cmpt, length>& dt)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::opSV(res, s, dt, divideOp3<Cmpt, scalar, Cmpt>());
return res;
}
//- Inner Product of a VectorN by an inverse diagonalTensor
template <class Cmpt, int length>
inline VectorN<Cmpt,length>
operator/(const VectorN<Cmpt,length>& v, const DiagTensorN<Cmpt,length>& dt)
{
VectorN<Cmpt, length> res(v);
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::eqOp(res, dt, divideEqOp<Cmpt>());
return res;
}
//- Inner Product of a DiagTensorN and an inverse DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator/(const DiagTensorN<Cmpt,length>& dt1, const DiagTensorN<Cmpt,length>& dt2)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::op(res, dt1, dt2, divideOp<Cmpt>());
return res;
}
//- Inner Product of a SphericalTensorN and an inverse DiagTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator/(const SphericalTensorN<Cmpt,length>& st1, const DiagTensorN<Cmpt,length>& dt2)
{
const Cmpt& s = st1.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::opSV(res, s, dt2, divideOp<Cmpt>());
return res;
}
//- Inner Product of a DiagTensorN and an inverse SphericalTensorN
template <class Cmpt, int length>
inline DiagTensorN<Cmpt,length>
operator/(const DiagTensorN<Cmpt,length>& dt1, const SphericalTensorN<Cmpt,length>& st2)
{
const Cmpt& s = st2.v_[0];
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::opVS(res, dt1, s, divideOp<Cmpt>());
return res;
}
//- Return the inverse of a diagonal tensor
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> inv(const DiagTensorN<Cmpt, length>& dt)
{
DiagTensorN<Cmpt, length> res;
VectorSpaceOps<DiagTensorN<Cmpt, length>::nComponents,0>::opSV(res, 1.0, dt, divideOp<Cmpt>());
return res;
}
//- Return tensor diagonal
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> diag(const DiagTensorN<Cmpt, length>& dt)
{
return dt;
}
//- Return the component sum
// template <class Cmpt, int length>
// inline Cmpt sum(const DiagTensorN<Cmpt, length>& dt)
// {
// Cmpt result=Cmpt::zero;
// for(register label i=0; i<DiagTensorN<Cmpt, length>::nComponents; i++)
// {
// result += dt[i];
// }
// return result;
// }
//- Transform the spherical tensor
//- The components are assumed to be individual scalars
//- i.e. transform has no effect
template<class Cmpt, int length>
inline DiagTensorN<Cmpt, length> transform
(
const tensor& tt,
const DiagTensorN<Cmpt, length>& v
)
{
return v;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Cmpt, int length>
class outerProduct<DiagTensorN<Cmpt, length>, Cmpt>
{
public:
typedef DiagTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class outerProduct<Cmpt, DiagTensorN<Cmpt, length> >
{
public:
typedef DiagTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<DiagTensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >
{
public:
typedef DiagTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<SphericalTensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >
{
public:
typedef DiagTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<DiagTensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >
{
public:
typedef DiagTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<VectorN<Cmpt, length>, DiagTensorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<DiagTensorN<Cmpt, length>, VectorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,115 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
SphericalTensorN
Description
Templated NXN SphericalTensor derived from VectorSpace adding construction from
N components, and the inner-product (dot-product) and outer-product operators.
SourceFiles
SphericalTensorNI.H
\*---------------------------------------------------------------------------*/
#ifndef SphericalTensorN_H
#define SphericalTensorN_H
#include "VectorN.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DiagTensor Declaration
\*---------------------------------------------------------------------------*/
template <class Cmpt, int length>
class SphericalTensorN
:
public VectorSpace<SphericalTensorN<Cmpt, length>, Cmpt, 1>
{
public:
// Member constants
enum
{
rank = 2, // Rank of DiagTensor is 2
rowLength = length
};
// Static data members
static const char* const typeName;
static const char* componentNames[];
static const SphericalTensorN zero;
static const SphericalTensorN one;
static const SphericalTensorN I;
// Constructors
//- Construct null
inline SphericalTensorN();
//- Construct given VectorSpace
inline SphericalTensorN(const VectorSpace<SphericalTensorN<Cmpt, length>, Cmpt, 1>&);
//- Construct from Istream
inline SphericalTensorN(Istream&);
//- Construct given component value. Special use only!
explicit inline SphericalTensorN(const Cmpt& tx);
// Member Functions
//- Diagonal
inline SphericalTensorN<Cmpt, length> diag() const;
//- Transpose
inline SphericalTensorN<Cmpt, length> T() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SphericalTensorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,274 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Cmpt, int length>
const char* const SphericalTensorN<Cmpt, length>::typeName =
("sphericalTensor" + name(length)).c_str();
template <class Cmpt, int length>
const SphericalTensorN<Cmpt, length> SphericalTensorN<Cmpt, length>::zero(0);
template <class Cmpt, int length>
const SphericalTensorN<Cmpt, length> SphericalTensorN<Cmpt, length>::one(1);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>::SphericalTensorN()
{}
// Construct given VectorSpace
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>::SphericalTensorN
(
const VectorSpace<SphericalTensorN<Cmpt, length>, Cmpt, 1>& vs
)
:
VectorSpace<SphericalTensorN<Cmpt, length>, Cmpt, 1>(vs)
{}
//- Construct from component
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>::SphericalTensorN(const Cmpt& tx)
{
this->v_[0] = tx;
}
// Construct from Istream
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>::SphericalTensorN(Istream& is)
:
VectorSpace<SphericalTensorN<Cmpt, length>, Cmpt, 1>(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Return diagonal tensor diagonal
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length> SphericalTensorN<Cmpt, length>::diag() const
{
return *this;
}
//- Return spherical tensor transpose
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length> SphericalTensorN<Cmpt, length>::T() const
{
return *this;
}
//- Transform the spherical tensor
//- The components are assumed to be individual scalars
//- i.e. transform has no effect
template<class Cmpt, int length>
inline SphericalTensorN<Cmpt, length> transform
(
const tensor& tt,
const SphericalTensorN<Cmpt, length>& v
)
{
return v;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Addition of SphericalTensorN and SphericalTensorN
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt,length>
operator+(const SphericalTensorN<Cmpt,length>& st1, const SphericalTensorN<Cmpt,length>& st2)
{
return SphericalTensorN<Cmpt, length>(st1.v_[0] + st2.v_[0]);
}
//- Subtraction of SphericalTensorN and SphericalTensorN
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt,length>
operator-(const SphericalTensorN<Cmpt,length>& st1, const SphericalTensorN<Cmpt,length>& st2)
{
return SphericalTensorN<Cmpt, length>(st1.v_[0] - st2.v_[0]);
}
//- Inner-product between spherical tensor and spherical tensor
template <class Cmpt, int length>
inline typename
innerProduct<SphericalTensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >::type
operator&(const SphericalTensorN<Cmpt, length>& st1, const SphericalTensorN<Cmpt, length>& st2)
{
return SphericalTensorN<Cmpt, length>(st1.v_[0]*st2.v_[0]);
}
//- Inner-product between a spherical tensor and a vector
template <class Cmpt, int length>
inline typename
innerProduct<SphericalTensorN<Cmpt, length>, VectorN<Cmpt, length> >::type
operator&(const SphericalTensorN<Cmpt, length>& st, const VectorN<Cmpt, length>& v)
{
const Cmpt& s = st.v_[0];
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opSV(res, s, v, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between a vector and a spherical tensor
template <class Cmpt, int length>
inline typename
innerProduct<VectorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >::type
operator&(const VectorN<Cmpt, length>& v, const SphericalTensorN<Cmpt, length>& st)
{
const Cmpt& s = st.v_[0];
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opVS(res, v, s, multiplyOp<Cmpt>());
return res;
}
//- Product of a scalar and a spherical tensor
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>
operator*(const scalar s, const SphericalTensorN<Cmpt, length>& st)
{
return SphericalTensorN<Cmpt, length>(s*st.v_[0]);
}
//- Division of a scalar by a spherical tensor
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length>
operator/(const scalar s, const SphericalTensorN<Cmpt, length>& st)
{
return SphericalTensorN<Cmpt, length>(s/st.v_[0]);
}
//- Inner Product of a VectorN by an inverse SphericalTensorN
template <class Cmpt, int length>
inline VectorN<Cmpt,length>
operator/(const VectorN<Cmpt,length>& v, const SphericalTensorN<Cmpt,length>& st)
{
return v/st.v_[0];
}
//- Inner Product of a SphericalTensorN and an inverse SphericalTensorN
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt,length>
operator/(const SphericalTensorN<Cmpt,length>& st1, const SphericalTensorN<Cmpt,length>& st2)
{
return SphericalTensorN<Cmpt, length>(st1.v_[0]/st2.v_[0]);
}
//- Return the inverse of a spherical tensor
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length> inv(const SphericalTensorN<Cmpt, length>& st)
{
return SphericalTensorN<Cmpt, length>(pTraits<Cmpt>::one/st.v_[0]);
}
//- Return tensor diagonal
template <class Cmpt, int length>
inline SphericalTensorN<Cmpt, length> diag(const SphericalTensorN<Cmpt, length>& st)
{
return st;
}
//- Return the component sum
template <class Cmpt, int length>
inline Cmpt sum(const SphericalTensorN<Cmpt, length>& st)
{
return SphericalTensorN<Cmpt, length>::rowLength*st.v_[0];
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Cmpt, int length>
class outerProduct<Cmpt, SphericalTensorN<Cmpt, length> >
{
public:
typedef SphericalTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class outerProduct<SphericalTensorN<Cmpt, length>, Cmpt>
{
public:
typedef SphericalTensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<SphericalTensorN<Cmpt, length>, VectorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<VectorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<SphericalTensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >
{
public:
typedef SphericalTensorN<Cmpt, length> type;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
TensorN
Description
SourceFiles
TensorNI.H
\*---------------------------------------------------------------------------*/
#ifndef TensorN_H
#define TensorN_H
#include "VectorN.H"
#include "SphericalTensorN.H"
#include "DiagTensorN.H"
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
template <class Cmpt, int length>
class DiagTensorN;
template <class Cmpt, int length>
class SphericalTensorN;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class TensorN Declaration
\*---------------------------------------------------------------------------*/
template <class Cmpt, int length>
class TensorN
:
public VectorSpace<TensorN<Cmpt, length>, Cmpt, length*length>
{
public:
// Member constants
enum
{
rank = 2, // Rank of TensorN is 2
rowLength = length // Number of components in a row
};
// Static data members
static const char* const typeName;
static const TensorN zero;
static const TensorN one;
// Constructors
//- Construct null
inline TensorN();
//- Construct given VectorSpace
inline TensorN
(
const VectorSpace<TensorN<Cmpt, length>, Cmpt, length*length>&
);
//- Construct given component value. Special use only!
explicit inline TensorN(const Cmpt& tx);
//- Construct from Istream
TensorN(Istream&);
// Member Functions
//- Return (i, j) component
inline const Cmpt& operator()
(
const direction i,
const direction j
) const;
//- Return access to (i, j) component
inline Cmpt& operator()
(
const direction i,
const direction j
);
//- Diagonal
inline DiagTensorN<Cmpt, length> diag() const;
//- Transpose
inline TensorN<Cmpt, length> T() const;
//- Negative sum the vertical off-diagonal components
inline TensorN<Cmpt, length> negSumDiag() const;
// Member Operators
//- Assign to a SphericalTensorN
inline void operator=(const SphericalTensorN<Cmpt, length>&);
//- Assign to a DiagTensorN
inline void operator=(const DiagTensorN<Cmpt, length>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "TensorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,985 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Cmpt, int length>
const char* const TensorN<Cmpt, length>::typeName =
("tensor" + name(length)).c_str();
template <class Cmpt, int length>
const TensorN<Cmpt, length> TensorN<Cmpt, length>::zero(0);
template <class Cmpt, int length>
const TensorN<Cmpt, length> TensorN<Cmpt, length>::one(1);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct null
template <class Cmpt, int length>
inline TensorN<Cmpt, length>::TensorN()
{}
//- Construct given VectorSpace
template <class Cmpt, int length>
inline TensorN<Cmpt, length>::TensorN
(
const VectorSpace<TensorN<Cmpt, length>, Cmpt, length*length>& vs
)
:
VectorSpace<TensorN<Cmpt, length>, Cmpt, length*length>(vs)
{}
//- Construct from component
template <class Cmpt, int length>
inline TensorN<Cmpt, length>::TensorN(const Cmpt& tx)
{
VectorSpaceOps<TensorN<Cmpt, length>::nComponents,0>::eqOpS(*this, tx, eqOp<Cmpt>());
}
//- Construct from Istream
template <class Cmpt, int length>
inline TensorN<Cmpt, length>::TensorN(Istream& is)
:
VectorSpace<TensorN<Cmpt, length>, Cmpt, length*length>(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Return tensor transpose
template <class Cmpt, int length>
inline TensorN<Cmpt, length> TensorN<Cmpt, length>::T() const
{
TensorN<Cmpt, length> transpose;
int i = 0;
for (int row = 0; row < TensorN<Cmpt, length>::rowLength; row++)
{
int j=row;
for (int col = 0; col < TensorN<Cmpt, length>::rowLength; col++)
{
transpose.v_[i] = this->v_[j];
i++;
j += TensorN<Cmpt, length>::rowLength;
}
}
return transpose;
}
//- Return tensor diagonal
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> TensorN<Cmpt, length>::diag() const
{
DiagTensorN<Cmpt, length> dt;
int diagI=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
dt[i] = this->v_[diagI];
diagI += TensorN<Cmpt, length>::rowLength + 1;
}
return dt;
}
//- Negative sum the vertical off-diagonal components
template <class Cmpt, int length>
inline TensorN<Cmpt, length> TensorN<Cmpt, length>::negSumDiag() const
{
TensorN<Cmpt, length> negsumdiag;
// Zero main diagonal
int diagI=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
negsumdiag.v_[diagI] = 0.0;
diagI += TensorN<Cmpt, length>::rowLength + 1;
}
int k=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
diagI = 0;
for (int j = 0; j < TensorN<Cmpt, length>::rowLength; j++)
{
if (k != diagI)
{
negsumdiag.v_[k] = this->v_[k];
negsumdiag.v_[diagI] -= this->v_[k];
}
k++;
diagI += TensorN<Cmpt, length>::rowLength + 1;
}
}
return negsumdiag;
}
//- Assign to a SphericalTensorN
template <class Cmpt, int length>
inline void TensorN<Cmpt, length>::operator=(const SphericalTensorN<Cmpt, length>& st)
{
int diag=0;
for (int i = 0; i < TensorN<Cmpt, length>::nComponents; i++)
{
if (i == diag)
{
this->v_[i] = st[0];
diag += TensorN<Cmpt, length>::rowLength + 1;
}
else
{
this->v_[i] = pTraits<Cmpt>::zero;
}
}
}
//- Assign to a DiagTensorN
template <class Cmpt, int length>
inline void TensorN<Cmpt, length>::operator=(const DiagTensorN<Cmpt, length>& dt)
{
int diag=0;
int k=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
for (int j = 0; j < TensorN<Cmpt, length>::rowLength; j++)
{
if (j == diag)
{
this->v_[k] = dt[i];
}
else
{
this->v_[k] = pTraits<Cmpt>::zero;
}
k++;
}
diag++;
}
}
//- Transform the tensor
//- The components are assumed to be individual scalars
//- i.e. transform has no effect
template<class Cmpt, int length>
inline TensorN<Cmpt, length> transform
(
const tensor& tt,
const TensorN<Cmpt, length>& v
)
{
return v;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template <class Cmpt, int length>
inline const Cmpt& TensorN<Cmpt, length>::operator()
(
const direction i,
const direction j
) const
{
return this->operator[](i*TensorN<Cmpt, length>::rowLength + j);
}
template <class Cmpt, int length>
inline Cmpt& TensorN<Cmpt, length>::operator()
(
const direction i,
const direction j
)
{
return this->operator[](i*TensorN<Cmpt, length>::rowLength + j);
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two tensors
template <class Cmpt, int length>
inline typename
innerProduct<TensorN<Cmpt, length>, TensorN<Cmpt, length> >::type
operator&(const TensorN<Cmpt, length>& t1, const TensorN<Cmpt, length>& t2)
{
TensorN<Cmpt, length> result(TensorN<Cmpt, length>::zero);
int i = 0;
int j = 0;
for (int row = 0; row < TensorN<Cmpt, length>::rowLength; row++)
{
for (int col = 0; col < TensorN<Cmpt, length>::rowLength; col++)
{
Cmpt& r = result.v_[i];
int m = j;
int n = col;
for (int row2=0; row2 < TensorN<Cmpt, length>::rowLength; row2++)
{
r += t1.v_[m]*t2.v_[n];
m++;
n += TensorN<Cmpt, length>::rowLength;
}
i++;
}
j += TensorN<Cmpt, length>::rowLength;
}
return result;
}
//- Inner-product between diagonal tensor and tensor
template <class Cmpt, int length>
inline typename
innerProduct<DiagTensorN<Cmpt, length>, TensorN<Cmpt, length> >::type
operator&(const DiagTensorN<Cmpt, length>& dt1, const TensorN<Cmpt, length>& t2)
{
TensorN<Cmpt, length> result;
int k=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
const Cmpt& xx = dt1.v_[i];
for (int j = 0; j < TensorN<Cmpt, length>::rowLength; j++)
{
result.v_[k] = xx*t2.v_[k];
k++;
}
}
return result;
}
//- Inner-product between tensor and diagonal tensor
template <class Cmpt, int length>
inline typename
innerProduct<TensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >::type
operator&(const TensorN<Cmpt, length>& t1, const DiagTensorN<Cmpt, length>& dt2)
{
TensorN<Cmpt, length> result;
int k=0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
for (int j = 0; j < TensorN<Cmpt, length>::rowLength; j++)
{
result.v_[k] = t1.v_[k]*dt2.v_[j];
k++;
}
}
return result;
}
//- Inner-product between spherical tensor and tensor
template <class Cmpt, int length>
inline typename
innerProduct<SphericalTensorN<Cmpt, length>, TensorN<Cmpt, length> >::type
operator&(const SphericalTensorN<Cmpt, length>& st1, const TensorN<Cmpt, length>& t2)
{
const Cmpt& s = st1.v_[0];
TensorN<Cmpt, length> res;
VectorSpaceOps<TensorN<Cmpt, length>::nComponents,0>::opSV(res, s, t2, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between tensor and spherical tensor
template <class Cmpt, int length>
inline typename
innerProduct<TensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >::type
operator&(const TensorN<Cmpt, length>& t1, const SphericalTensorN<Cmpt, length>& st2)
{
const Cmpt& s = st2.v_[0];
TensorN<Cmpt, length> res;
VectorSpaceOps<TensorN<Cmpt, length>::nComponents,0>::opVS(res, t1, s, multiplyOp<Cmpt>());
return res;
}
//- Inner-product between a tensor and a vector
template <class Cmpt, int length>
inline typename
innerProduct<TensorN<Cmpt, length>, VectorN<Cmpt, length> >::type
operator&(const TensorN<Cmpt, length>& t, const VectorN<Cmpt, length>& v)
{
VectorN<Cmpt, length> result(VectorN<Cmpt, length>::zero);
int i=0;
for (int row = 0; row < TensorN<Cmpt, length>::rowLength; row++)
{
Cmpt& r = result.v_[row];
for (int col = 0; col < TensorN<Cmpt, length>::rowLength; col++)
{
r += t.v_[i]*v.v_[col];
i++;
}
}
return result;
}
//- Inner-product between a vector and a tensor
template <class Cmpt, int length>
inline typename
innerProduct<VectorN<Cmpt, length>, TensorN<Cmpt, length> >::type
operator&(const VectorN<Cmpt, length>& v, const TensorN<Cmpt, length>& t)
{
VectorN<Cmpt, length> result(VectorN<Cmpt, length>::zero);
for (int col = 0; col < TensorN<Cmpt, length>::rowLength; col++)
{
int j=col;
Cmpt& r = result.v_[col];
for (int row = 0; row < TensorN<Cmpt, length>::rowLength; row++)
{
r += v.v_[row]*t.v_[j];
j += TensorN<Cmpt, length>::rowLength;
}
}
return result;
}
//- Outer-product between two vectors
template <class Cmpt, int length>
inline typename
outerProduct<VectorN<Cmpt, length>, VectorN<Cmpt, length> >::type
operator*(const VectorN<Cmpt, length>& v1, const VectorN<Cmpt, length>& v2)
{
TensorN<Cmpt, length> result(TensorN<Cmpt, length>::zero);
int i=0;
for (int row = 0; row < TensorN<Cmpt, length>::rowLength; row++)
{
for (int col = 0; col < TensorN<Cmpt, length>::rowLength; col++)
{
result.v_[i] = v1.v_[row]*v2.v_[col];
i++;
}
}
return result;
}
//- Addition of TensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator+(const TensorN<Cmpt,length>& t1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt,length> res;
VectorSpaceOps<TensorN<Cmpt,length>::nComponents,0>::op(res, t1, t2, plusOp<Cmpt>());
return res;
}
//- Addition of TensorN and DiagTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator+(const TensorN<Cmpt,length>& t1, const DiagTensorN<Cmpt,length>& dt2)
{
TensorN<Cmpt, length> result(t1);
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += dt2.v_[i];
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Addition of DiagTensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator+(const DiagTensorN<Cmpt,length>& dt1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt, length> result(t2);
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += dt1.v_[i];
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Addition of TensorN and SphericalTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator+(const TensorN<Cmpt,length>& t1, const SphericalTensorN<Cmpt,length>& st2)
{
TensorN<Cmpt, length> result(t1);
const Cmpt& s = st2.v_[0];
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += s;
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Addition of SphericalTensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator+(const SphericalTensorN<Cmpt,length>& st1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt, length> result(t2);
const Cmpt& s = st1.v_[0];
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += s;
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Subtraction of TensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator-(const TensorN<Cmpt,length>& t1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt,length> res;
VectorSpaceOps<TensorN<Cmpt,length>::nComponents,0>::op(res, t1, t2, minusOp<Cmpt>());
return res;
}
//- Subtraction of TensorN and DiagTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator-(const TensorN<Cmpt,length>& t1, const DiagTensorN<Cmpt,length>& dt2)
{
TensorN<Cmpt, length> result(t1);
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] -= dt2.v_[i];
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Subtraction of DiagTensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator-(const DiagTensorN<Cmpt,length>& dt1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt, length> result(-t2);
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += dt1.v_[i];
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Subtraction of TensorN and SphericalTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator-(const TensorN<Cmpt,length>& t1, const SphericalTensorN<Cmpt,length>& st2)
{
TensorN<Cmpt, length> result(t1);
const Cmpt& s = st2.v_[0];
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] -= s;
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Subtraction of SphericalTensorN and TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator-(const SphericalTensorN<Cmpt,length>& st1, const TensorN<Cmpt,length>& t2)
{
TensorN<Cmpt, length> result(-t2);
const Cmpt& s = st1.v_[0];
int diag = 0;
for (int i = 0; i < TensorN<Cmpt, length>::rowLength; i++)
{
result.v_[diag] += s;
diag += TensorN<Cmpt, length>::rowLength + 1;
}
return result;
}
//- Division of a scalar by a TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const scalar s, const TensorN<Cmpt,length>& t)
{
return s*inv(t);
}
//- Inner Product of a VectorN by an inverse TensorN
template <class Cmpt, int length>
inline VectorN<Cmpt,length>
operator/(const VectorN<Cmpt,length>& v, const TensorN<Cmpt,length>& t)
{
return v & inv(t);
}
//- Inner Product of a TensorN by an inverse TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const TensorN<Cmpt,length>& t1, const TensorN<Cmpt,length>& t2)
{
return t1 & inv(t2);
}
//- Inner Product of a DiagTensorN and an inverse TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const DiagTensorN<Cmpt,length>& dt1, const TensorN<Cmpt,length>& t2)
{
return dt1 & inv(t2);
}
//- Inner Product of a TensorN and an inverse DiagTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const TensorN<Cmpt,length>& t1, const DiagTensorN<Cmpt,length>& dt2)
{
return t1 & inv(dt2);
}
//- Inner Product of a SphericalTensorN and an inverse TensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const SphericalTensorN<Cmpt,length>& st1, const TensorN<Cmpt,length>& t2)
{
return st1.v_[0] * inv(t2);
}
//- Inner Product of a TensorN and an inverse SphericalTensorN
template <class Cmpt, int length>
inline TensorN<Cmpt,length>
operator/(const TensorN<Cmpt,length>& t1, const SphericalTensorN<Cmpt,length>& st2)
{
TensorN<Cmpt, length> result;
const Cmpt& s = st2[0];
for (int i = 0; i < TensorN<Cmpt, length>::nComponents; i++)
{
result.v_[i] = t1.v_[i]/s;
}
return result;
}
// UNOPTIMIZED VERSION
/*
//- Return the inverse of a tensor give the determinant
// Uses Gauss-Jordan Elimination with full pivoting
template <class Cmpt, int length>
inline TensorN<Cmpt, length> inv(const TensorN<Cmpt, length>& t)
{
TensorN<Cmpt, length> result(t);
label i, j, k, iRow=0, iCol=0;
Cmpt bigValue, temp, pivotInv;
// Lists used for bookkeeping on the pivoting
List<label> indexCol(length), indexRow(length), iPivot(length);
iPivot=0;
// Main loop over columns to be reduced
for (i=0; i<length; i++)
{
bigValue = pTraits<Cmpt>::zero;
//Search for pivot element
for (j=0; j<length; j++)
{
if (iPivot[j] != 1)
{
for (k=0; k<length; k++)
{
if (iPivot[k] == 0)
{
if (Foam::mag(result(j,k)) >= bigValue)
{
bigValue = Foam::mag(result(j,k));
iRow = j;
iCol = k;
}
}
}
}
}
++(iPivot[iCol]);
// We now have the pivot element
// Interchange rows if needed
if (iRow != iCol)
{
for (j=0; j<length; j++)
{
Swap(result(iRow,j), result(iCol,j));
}
}
indexRow[i] = iRow;
indexCol[i] = iCol;
//Check for singularity
if (result(iCol, iCol) == 0.0)
{
FatalErrorIn("inline TensorN<Cmpt, length> inv(const TensorN<Cmpt, length>& t)")
<< "Singular tensor" << length << Foam::abort(FatalError);
}
// Divide the pivot row by pivot element
pivotInv = pTraits<Cmpt>::one/result(iCol, iCol);
result(iCol, iCol) = pTraits<Cmpt>::one;
// Multiply all row elements by inverse
for (j=0; j<length; j++)
{
result(iCol,j) *= pivotInv;
}
// Reduce the rows
for (j=0; j<length; j++)
{
if (j != iCol)
{
temp=result(j,iCol);
result(j,iCol) = pTraits<Cmpt>::zero;
for (k=0; k<length; k++)
{
result(j,k) -= result(iCol,k)*temp;
}
}
}
}
// Unscamble the solution
for (i=length-1; i>=0; i--)
{
if (indexRow[i] != indexCol[i])
{
for (j=0; j<length; j++)
{
Swap(result(j,indexRow[i]), result(j,indexCol[i]));
}
}
}
return result;
}
*/
//- Return the inverse of a tensor give the determinant
// Uses Gauss-Jordan Elimination with full pivoting
template <class Cmpt, int length>
inline TensorN<Cmpt, length> inv(const TensorN<Cmpt, length>& t)
{
TensorN<Cmpt, length> result(t);
label iRow=0, iCol=0;
Cmpt largestCoeff, temp;
Cmpt __restrict__ *srcIter, *destIter;
// Lists used for bookkeeping on the pivoting
List<label> indexCol(length), indexRow(length), iPivot(length);
iPivot=0;
// Main loop over columns to be reduced
for (int i=0; i<length; i++)
{
largestCoeff = pTraits<Cmpt>::zero;
//Search for pivot element
int curRowOffset = 0;
for (int j=0; j<length; j++)
{
if (iPivot[j] != 1)
{
for (int k=0; k<length; k++)
{
if (iPivot[k] == 0)
{
if ((temp = Foam::mag(result[curRowOffset+k])) >= largestCoeff)
{
largestCoeff = temp;
iRow = j;
iCol = k;
}
}
}
}
curRowOffset += length;
}
++(iPivot[iCol]);
// We now have the pivot element
// Interchange rows if needed
if (iRow != iCol)
{
srcIter = &result(iRow,0);
destIter = &result(iCol,0);
for (int j=0; j<length; j++)
{
Swap((*srcIter), (*destIter));
srcIter++;
destIter++;
}
}
indexRow[i] = iRow;
indexCol[i] = iCol;
//Check for singularity
srcIter = &result(iCol, iCol); //Dummy pointer to reduce indexing
if ((*srcIter) == Cmpt(0.0))
{
FatalErrorIn("inline TensorN<Cmpt, length> inv(const TensorN<Cmpt, length>& t)")
<< "Singular tensor" << length << Foam::abort(FatalError);
}
// Divide the pivot row by pivot element
temp = pTraits<Cmpt>::one/(*srcIter);
(*srcIter) = pTraits<Cmpt>::one;
srcIter = &result(iCol,0);
for (int j=0; j<length; j++)
{
(*srcIter) *= temp;
srcIter++;
}
// Reduce the rows, excluding the pivot row
for (int j=0; j<length; j++)
{
if (j != iCol)
{
destIter = &result(j,0);
srcIter = &result(iCol,0);
temp=destIter[iCol];
destIter[iCol] = pTraits<Cmpt>::zero;
for (int k=0; k<length; k++)
{
(*destIter) -= (*srcIter)*temp;
srcIter++;
destIter++;
}
}
}
}
// Unscamble the solution
for (int i=length-1; i>=0; i--)
{
if (indexRow[i] != indexCol[i])
{
srcIter = &result[indexRow[i]];
destIter = &result[indexCol[i]];
for (int j=0; j<length; j++)
{
Swap((*srcIter), (*destIter));
srcIter += length;
destIter += length;
}
}
}
return result;
}
//- Return tensor diagonal
template <class Cmpt, int length>
inline DiagTensorN<Cmpt, length> diag(const TensorN<Cmpt, length>& t)
{
return t.diag();
}
//- Return tensor diagonal
template <class Cmpt, int length>
inline TensorN<Cmpt, length> negSumDiag(const TensorN<Cmpt, length>& t)
{
return t.negSumDiag();
}
//- Return the component sum
// template <class Cmpt, int length>
// inline Cmpt sum(const TensorN<Cmpt, length>& t)
// {
// Cmpt result=Cmpt::zero;
// for(int i=0; i<TensorN<Cmpt, length>::nComponents; i++)
// {
// result += t[i];
// }
// return result;
// }
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Cmpt, int length>
class outerProduct<TensorN<Cmpt, length>, Cmpt>
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class outerProduct<Cmpt, TensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<DiagTensorN<Cmpt, length>, TensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<TensorN<Cmpt, length>, DiagTensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<SphericalTensorN<Cmpt, length>, TensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<TensorN<Cmpt, length>, SphericalTensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<VectorN<Cmpt, length>, TensorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<TensorN<Cmpt, length>, VectorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class innerProduct<TensorN<Cmpt, length>, TensorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
VectorN
Description
Templated 2D Vector derived from VectorSpace adding construction from
2 components, element access using x() and y() member functions and
the inner-product (dot-product).
SourceFiles
VectorNI.H
\*---------------------------------------------------------------------------*/
#ifndef VectorN_H
#define VectorN_H
#include "VectorSpace.H"
#include "tensor.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class VectorN Declaration
\*---------------------------------------------------------------------------*/
template <class Cmpt, int length>
class VectorN
:
public VectorSpace<VectorN<Cmpt, length>, Cmpt, length>
{
public:
// Member constants
enum
{
rank = 1 // Rank of VectorN is 1
};
// Static data members
static const char* const typeName;
static const VectorN zero;
static const VectorN one;
// Constructors
//- Construct null
inline VectorN();
//- Construct given VectorSpace
inline VectorN(const VectorSpace<VectorN<Cmpt, length>, Cmpt, length>&);
//- Construct given component value. Special use only!
explicit inline VectorN(const Cmpt& vx);
//- Construct from Istream
inline VectorN(Istream&);
// Member Functions
//- Return ith component
inline const Cmpt& operator()(const direction i) const;
//- Return access to ith component
inline Cmpt& operator()(const direction i);
//- Componentwise multiply
inline VectorN<Cmpt, length> cmptMultiply(const VectorN<Cmpt, length>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "VectorNI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,204 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Cmpt, int length>
class TensorN;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Cmpt, int length>
const char* const VectorN<Cmpt, length>::typeName =
("vector" + name(length)).c_str();
template <class Cmpt, int length>
const VectorN<Cmpt, length> VectorN<Cmpt, length>::zero(0);
template <class Cmpt, int length>
const VectorN<Cmpt, length> VectorN<Cmpt, length>::one(1);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template <class Cmpt, int length>
inline VectorN<Cmpt, length>::VectorN()
{}
// Construct given VectorSpace
template <class Cmpt, int length>
inline VectorN<Cmpt, length>::VectorN
(
const VectorSpace<VectorN<Cmpt, length>, Cmpt, length>& vs
)
:
VectorSpace<VectorN<Cmpt, length>, Cmpt, length>(vs)
{}
// Construct given Cmpts
template <class Cmpt, int length>
inline VectorN<Cmpt, length>::VectorN(const Cmpt& vx)
{
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::eqOpS(*this, vx, eqOp<Cmpt>());
}
// Construct from Istream
template <class Cmpt, int length>
inline VectorN<Cmpt, length>::VectorN(Istream& is)
:
VectorSpace<VectorN<Cmpt, length>, Cmpt, length>(is)
{}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template <class Cmpt, int length>
inline const Cmpt& VectorN<Cmpt, length>::operator()(const direction i) const
{
return this->operator[](i);
}
template <class Cmpt, int length>
inline Cmpt& VectorN<Cmpt, length>::operator()(const direction i)
{
return this->operator[](i);
}
//- Multiply components of VectorN by VectorN
template<class Cmpt, int length>
inline VectorN<Cmpt, length> VectorN<Cmpt, length>::cmptMultiply(const VectorN<Cmpt, length>& v)
{
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::op(res, *this, v, multiplyOp<Cmpt>());
return res;
}
//- Transform the spherical tensor
//- The components are assumed to be individual scalars
//- i.e. transform has no effect
template<class Cmpt, int length>
inline VectorN<Cmpt, length> transform
(
const tensor& tt,
const VectorN<Cmpt, length>& v
)
{
return v;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Cmpt, int length>
class outerProduct<Cmpt, VectorN<Cmpt, length> >
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class outerProduct<VectorN<Cmpt, length>, Cmpt>
{
public:
typedef VectorN<Cmpt, length> type;
};
template<class Cmpt, int length>
class outerProduct<VectorN<Cmpt, length>, VectorN<Cmpt, length> >
{
public:
typedef TensorN<Cmpt, length> type;
};
//- Inner-product between a vector and a vector
template <class Cmpt, int length>
inline Cmpt operator&
(
const VectorN<Cmpt, length>& v1,
const VectorN<Cmpt, length>& v2
)
{
Cmpt res = pTraits<Cmpt>::zero;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::SopEqOpVV
(res, v1, v2, plusEqOp<Cmpt>(), multiplyOp<Cmpt>());
return res;
}
//- Componentwise division of scalar by VectorN
template<class Cmpt, int length>
inline VectorN<Cmpt, length>
operator/(const scalar s, const VectorN<Cmpt, length>& v)
{
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::opSV(res, s, v, divideOp3<Cmpt, scalar, Cmpt>());
return res;
}
//- Multiply components of VectorN by VectorN
template<class Cmpt, int length>
inline VectorN<Cmpt, length> cmptMultiply(const VectorN<Cmpt, length>& v1, const VectorN<Cmpt, length>& v2)
{
VectorN<Cmpt, length> res;
VectorSpaceOps<VectorN<Cmpt, length>::nComponents,0>::op(res, v1, v2, multiplyOp<Cmpt>());
return res;
}
//- Return the component sum
// template <class Cmpt, int length>
// inline Cmpt sum(const VectorN<Cmpt, length>& v)
// {
// Cmpt result = pTraits<Cmpt>::zero;
// for(register label i=0; i<VectorN<Cmpt, length>::nComponents; i++)
// {
// result += v[i];
// }
// return result;
// }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
diagTensor2
Description
DiagTensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
#ifndef diagTensor2_H
#define diagTensor2_H
#include "DiagTensorN.H"
#include "vector2.H"
#include "sphericalTensor2.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef DiagTensorN<scalar, 2> diagTensor2;
//- Specify data associated with diagTensor2 type is contiguous
template<>
inline bool contiguous<diagTensor2>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// Include inline implementations
#include "diagTensor2I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,151 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
diagTensor2
Description
DiagTensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Assign to a SphericalTensorN
template<>
inline void diagTensor2::operator=(const sphericalTensor2& st)
{
this->v_[0] = st[0];
this->v_[1] = st[0];
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two diagonal tensors
inline diagTensor2
operator&(const diagTensor2& dt1, const diagTensor2& dt2)
{
diagTensor2 result;
result[0] = dt1[0]*dt2[0];
result[1] = dt1[1]*dt2[1];
return result;
}
//- Inner-product between a spherical tensor and a diagonal tensor
inline diagTensor2
operator&(const sphericalTensor2& st1, const diagTensor2& dt2)
{
diagTensor2 result;
result[0] = st1[0]*dt2[0];
result[1] = st1[0]*dt2[1];
return result;
}
//- Inner-product between a diagonal tensor and a spherical tensor
inline diagTensor2
operator&(const diagTensor2& dt1, const sphericalTensor2& st2)
{
diagTensor2 result;
result[0] = dt1[0]*st2[0];
result[1] = dt1[1]*st2[0];
return result;
}
//- Inner-product between a diagonal tensor and a vector
inline vector2
operator&(const diagTensor2& dt, const vector2& v)
{
vector2 result;
result[0] = dt[0]*v[0];
result[1] = dt[1]*v[1];
return result;
}
//- Inner-product between a vector and a diagonal tensor
inline vector2
operator&(const vector2& v, const diagTensor2& dt)
{
vector2 result;
result[0] = v[0]*dt[0];
result[1] = v[1]*dt[1];
return result;
}
//- Division of a scalar by a diagTensor2
inline diagTensor2 operator/(const scalar s, const diagTensor2& dt)
{
diagTensor2 result;
result[0] = s/dt[0];
result[1] = s/dt[1];
return result;
}
//- Return the inverse of a diagTensor2
inline diagTensor2 inv(const diagTensor2& dt)
{
diagTensor2 result;
result[0] = 1.0/dt[0];
result[1] = 1.0/dt[1];
return result;
}
//- Return the component sum
inline scalar sum(const diagTensor2& dt)
{
return dt[0] + dt[1];
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
sphericalTensor2
Description
SphericalTensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
#ifndef sphericalTensor2_H
#define sphericalTensor2_H
#include "SphericalTensorN.H"
#include "vector2.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef SphericalTensorN<scalar, 2> sphericalTensor2;
//- Specify data associated with sphericalTensor2 type is contiguous
template<>
inline bool contiguous<sphericalTensor2>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// Include inline implementations
#include "sphericalTensor2I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
sphericalTensor2
Description
SphericalTensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two spherical tensors
inline sphericalTensor2
operator&(const sphericalTensor2& st1, const sphericalTensor2& st2)
{
return sphericalTensor2(st1[0]*st2[0]);
}
//- Inner-product between a spherical tensor and a vector
inline vector2
operator&(const sphericalTensor2& st, const vector2& v)
{
vector2 result;
result[0] = st[0]*v[0];
result[1] = st[0]*v[1];
return result;
}
//- Inner-product between a vector and a spherical tensor
inline vector2
operator&(const vector2& v, const sphericalTensor2& st)
{
vector2 result;
result[0] = v[0]*st[0];
result[1] = v[1]*st[0];
return result;
}
//- Return the inverse of a tensor given the determinant
inline sphericalTensor2 inv(const sphericalTensor2& st)
{
return sphericalTensor2(1/st[0]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor2
Description
TensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
#ifndef tensor2_H
#define tensor2_H
#include "TensorN.H"
#include "vector2.H"
#include "sphericalTensor2.H"
#include "diagTensor2.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef TensorN<scalar, 2> tensor2;
//- Specify data associated with tensor2 type is contiguous
template<>
inline bool contiguous<tensor2>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// Include inline implementations
#include "tensor2I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,221 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor2
Description
TensorN of 2 scalars.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Return tensor transpose
template<>
inline tensor2 tensor2::T() const
{
tensor2 transpose;
transpose[0] = this->operator[](0);
transpose[1] = this->operator[](2);
transpose[2] = this->operator[](1);
transpose[3] = this->operator[](3);
return transpose;
}
//- Assign to a sphericalTensor2
template<>
inline void tensor2::operator=(const sphericalTensor2& st)
{
this->v_[0] = st[0];
this->v_[1] = 0.0;
this->v_[2] = 0.0;
this->v_[3] = st[0];
}
//- Assign to a diagTensor2
template<>
inline void tensor2::operator=(const diagTensor2& dt)
{
this->v_[0] = dt[0];
this->v_[1] = 0.0;
this->v_[2] = 0.0;
this->v_[3] = dt[1];
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
//- Inner-product between two tensors
inline tensor2
operator&(const tensor2& t1, const tensor2& t2)
{
tensor2 result;
result[0] = t1[0]*t2[0] + t1[1]*t2[2];
result[1] = t1[0]*t2[1] + t1[1]*t2[3];
result[2] = t1[2]*t2[0] + t1[3]*t2[2];
result[3] = t1[2]*t2[1] + t1[3]*t2[3];
return result;
}
//- Inner-product between a diagonal tensors and a tensor
inline tensor2
operator&(const diagTensor2& dt1, const tensor2& t2)
{
tensor2 result;
result[0] = dt1[0]*t2[0];
result[1] = dt1[0]*t2[1];
result[2] = dt1[1]*t2[2];
result[3] = dt1[1]*t2[3];
return result;
}
//- Inner-product between a tensor and diagonal tensor
inline tensor2
operator&(const tensor2& t1, const diagTensor2& dt2)
{
tensor2 result;
result[0] = t1[0]*dt2[0];
result[1] = t1[1]*dt2[1];
result[2] = t1[2]*dt2[0];
result[3] = t1[3]*dt2[1];
return result;
}
//- Inner-product between a spherical tensor and a tensor
inline tensor2
operator&(const sphericalTensor2& st1, const tensor2& t2)
{
tensor2 result;
result[0] = st1[0]*t2[0];
result[1] = st1[0]*t2[1];
result[2] = st1[0]*t2[2];
result[3] = st1[0]*t2[3];
return result;
}
//- Inner-product between a tensor and spherical tensor
inline tensor2
operator&(const tensor2& t1, const sphericalTensor2& st2)
{
tensor2 result;
result[0] = t1[0]*st2[0];
result[1] = t1[1]*st2[0];
result[2] = t1[2]*st2[0];
result[3] = t1[3]*st2[0];
return result;
}
//- Inner-product between a tensor and a vector
inline vector2
operator&(const tensor2& t, const vector2& v)
{
vector2 result;
result[0] = t[0]*v[0] + t[1]*v[1];
result[1] = t[2]*v[0] + t[3]*v[1];
return result;
}
//- Inner-product between a vector and a tensor
inline vector2
operator&(const vector2& v, const tensor2& t)
{
vector2 result;
result[0] = v[0]*t[0] + v[1]*t[2];
result[1] = v[0]*t[1] + v[1]*t[3];
return result;
}
//- Outer-product between two vectors
inline tensor2
operator*(const vector2& v1, const vector2& v2)
{
tensor2 result;
result[0] = v1[0]*v2[0];
result[1] = v1[0]*v2[1];
result[2] = v1[1]*v2[0];
result[3] = v1[1]*v2[1];
return result;
}
//- Return the determinant of a tensor
inline scalar det(const tensor2& t)
{
return
(
t[0]*t[3]-t[1]*t[2]
);
}
//- Return the inverse of a tensor given the determinant
inline tensor2 inv(const tensor2& t)
{
tensor2 cofactor;
cofactor[0] = t[3];
cofactor[1] = -t[1];
cofactor[2] = -t[2];
cofactor[3] = t[0];
return cofactor/det(t);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
Vector2
Description
Vector2 obtained from generic VectorN
SourceFiles
Vector2.C
\*---------------------------------------------------------------------------*/
#ifndef Vector2_H
#define Vector2_H
#include "scalar.H"
#include "VectorN.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef VectorN<scalar, 2> vector2;
//- Specify data associated with vector2 type is contiguous
template<>
inline bool contiguous<vector2>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
diagTensor4
Description
DiagTensorN of 4 scalars.
\*---------------------------------------------------------------------------*/
#ifndef diagTensor4_H
#define diagTensor4_H
#include "DiagTensorN.H"
#include "vector4.H"
#include "sphericalTensor4.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef DiagTensorN<scalar, 4> diagTensor4;
//- Specify data associated with diagTensor4 type is contiguous
template<>
inline bool contiguous<diagTensor4>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
sphericalTensor4
Description
SphericalTensorN of 4 scalars.
\*---------------------------------------------------------------------------*/
#ifndef sphericalTensor4_H
#define sphericalTensor4_H
#include "SphericalTensorN.H"
#include "vector4.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef SphericalTensorN<scalar, 4> sphericalTensor4;
//- Specify data associated with sphericalTensor4 type is contiguous
template<>
inline bool contiguous<sphericalTensor4>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor4
Description
TensorN of 4 scalars.
\*---------------------------------------------------------------------------*/
#ifndef tensor4_H
#define tensor4_H
#include "TensorN.H"
#include "vector4.H"
#include "sphericalTensor4.H"
#include "diagTensor4.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef TensorN<scalar, 4> tensor4;
//- Specify data associated with tensor4 type is contiguous
template<>
inline bool contiguous<tensor4>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// Include inline implementations
#include "tensor4I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor4
Description
TensorN of 4 scalars.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Return the determinant of a tensor
inline scalar det(const tensor4& t)
{
return
(
t[3]*t[6]*t[9]*t[12] - t[2]*t[7]*t[9]*t[12] - t[3]*t[5]*t[10]*t[12] + t[1]*t[7]*t[10]*t[12] +
t[2]*t[5]*t[11]*t[12] - t[1]*t[6]*t[11]*t[12] - t[3]*t[6]*t[8]*t[13] + t[2]*t[7]*t[8]*t[13] +
t[3]*t[4]*t[10]*t[13] - t[0]*t[7]*t[10]*t[13] - t[2]*t[4]*t[11]*t[13] + t[0]*t[6]*t[11]*t[13] +
t[3]*t[5]*t[8]*t[14] - t[1]*t[7]*t[8]*t[14] - t[3]*t[4]*t[9]*t[14] + t[0]*t[7]*t[9]*t[14] +
t[1]*t[4]*t[11]*t[14] - t[0]*t[5]*t[11]*t[14] - t[2]*t[5]*t[8]*t[15] + t[1]*t[6]*t[8]*t[15] +
t[2]*t[4]*t[9]*t[15] - t[0]*t[6]*t[9]*t[15] - t[1]*t[4]*t[10]*t[15] + t[0]*t[5]*t[10]*t[15]
);
}
//- Return the inverse of a tensor given the determinant
inline tensor4 inv(const tensor4& t)
{
tensor4 cofactor;
cofactor[0] = t[6]*t[11]*t[13] - t[7]*t[10]*t[13] + t[7]*t[9]*t[14]
- t[5]*t[11]*t[14] - t[6]*t[9]*t[15] + t[5]*t[10]*t[15];
cofactor[1] = t[3]*t[10]*t[13] - t[2]*t[11]*t[13] - t[3]*t[9]*t[14]
+ t[1]*t[11]*t[14] + t[2]*t[9]*t[15] - t[1]*t[10]*t[15];
cofactor[2] = t[2]*t[7]*t[13] - t[3]*t[6]*t[13] + t[3]*t[5]*t[14]
- t[1]*t[7]*t[14] - t[2]*t[5]*t[15] + t[1]*t[6]*t[15];
cofactor[3] = t[3]*t[6]*t[9] - t[2]*t[7]*t[9] - t[3]*t[5]*t[10]
+ t[1]*t[7]*t[10] + t[2]*t[5]*t[11] - t[1]*t[6]*t[11];
cofactor[4] = t[7]*t[10]*t[12] - t[6]*t[11]*t[12] - t[7]*t[8]*t[14]
+ t[4]*t[11]*t[14] + t[6]*t[8]*t[15] - t[4]*t[10]*t[15];
cofactor[5] = t[2]*t[11]*t[12] - t[3]*t[10]*t[12] + t[3]*t[8]*t[14]
- t[0]*t[11]*t[14] - t[2]*t[8]*t[15] + t[0]*t[10]*t[15];
cofactor[6] = t[3]*t[6]*t[12] - t[2]*t[7]*t[12] - t[3]*t[4]*t[14]
+ t[0]*t[7]*t[14] + t[2]*t[4]*t[15] - t[0]*t[6]*t[15];
cofactor[7] = t[2]*t[7]*t[8] - t[3]*t[6]*t[8] + t[3]*t[4]*t[10]
- t[0]*t[7]*t[10] - t[2]*t[4]*t[11] + t[0]*t[6]*t[11];
cofactor[8] = t[5]*t[11]*t[12] - t[7]*t[9]*t[12] + t[7]*t[8]*t[13]
- t[4]*t[11]*t[13] - t[5]*t[8]*t[15] + t[4]*t[9]*t[15];
cofactor[9] = t[3]*t[9]*t[12] - t[1]*t[11]*t[12] - t[3]*t[8]*t[13]
+ t[0]*t[11]*t[13] + t[1]*t[8]*t[15] - t[0]*t[9]*t[15];
cofactor[10] = t[1]*t[7]*t[12] - t[3]*t[5]*t[12] + t[3]*t[4]*t[13]
- t[0]*t[7]*t[13] - t[1]*t[4]*t[15] + t[0]*t[5]*t[15];
cofactor[11] = t[3]*t[5]*t[8] - t[1]*t[7]*t[8] - t[3]*t[4]*t[9]
+ t[0]*t[7]*t[9] + t[1]*t[4]*t[11] - t[0]*t[5]*t[11];
cofactor[12] = t[6]*t[9]*t[12] - t[5]*t[10]*t[12] - t[6]*t[8]*t[13]
+ t[4]*t[10]*t[13] + t[5]*t[8]*t[14] - t[4]*t[9]*t[14];
cofactor[13] = t[1]*t[10]*t[12] - t[2]*t[9]*t[12] + t[2]*t[8]*t[13]
- t[0]*t[10]*t[13] - t[1]*t[8]*t[14] + t[0]*t[9]*t[14];
cofactor[14] = t[2]*t[5]*t[12] - t[1]*t[6]*t[12] - t[2]*t[4]*t[13]
+ t[0]*t[6]*t[13] + t[1]*t[4]*t[14] - t[0]*t[5]*t[14];
cofactor[15] = t[1]*t[6]*t[8] - t[2]*t[5]*t[8] + t[2]*t[4]*t[9]
- t[0]*t[6]*t[9] - t[1]*t[4]*t[10] + t[0]*t[5]*t[10];
return cofactor/det(t);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
Vector4
Description
Vector4 obtained from generic VectorN
SourceFiles
Vector4.C
\*---------------------------------------------------------------------------*/
#ifndef Vector4_H
#define Vector4_H
#include "scalar.H"
#include "VectorN.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef VectorN<scalar, 4> vector4;
//- Specify data associated with vector4 type is contiguous
template<>
inline bool contiguous<vector4>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
diagTensor6
Description
DiagTensorN of 6 scalars.
\*---------------------------------------------------------------------------*/
#ifndef diagTensor6_H
#define diagTensor6_H
#include "DiagTensorN.H"
#include "vector6.H"
#include "sphericalTensor6.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef DiagTensorN<scalar, 6> diagTensor6;
//- Specify data associated with diagTensor6 type is contiguous
template<>
inline bool contiguous<diagTensor6>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
sphericalTensor6
Description
SphericalTensorN of 6 scalars.
\*---------------------------------------------------------------------------*/
#ifndef sphericalTensor6_H
#define sphericalTensor6_H
#include "SphericalTensorN.H"
#include "vector6.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef SphericalTensorN<scalar, 6> sphericalTensor6;
//- Specify data associated with sphericalTensor6 type is contiguous
template<>
inline bool contiguous<sphericalTensor6>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,64 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor6
Description
TensorN of 6 scalars.
\*---------------------------------------------------------------------------*/
#ifndef tensor6_H
#define tensor6_H
#include "TensorN.H"
#include "vector6.H"
#include "sphericalTensor6.H"
#include "diagTensor6.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef TensorN<scalar, 6> tensor6;
//- Specify data associated with tensor6 type is contiguous
template<>
inline bool contiguous<tensor6>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
Vector6
Description
Vector6 obtained from generic VectorN
SourceFiles
Vector6.C
\*---------------------------------------------------------------------------*/
#ifndef Vector6_H
#define Vector6_H
#include "scalar.H"
#include "VectorN.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef VectorN<scalar, 6> vector6;
//- Specify data associated with vector6 type is contiguous
template<>
inline bool contiguous<vector6>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
diagTensor8
Description
DiagTensorN of 8 scalars.
\*---------------------------------------------------------------------------*/
#ifndef diagTensor8_H
#define diagTensor8_H
#include "DiagTensorN.H"
#include "vector8.H"
#include "sphericalTensor8.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef DiagTensorN<scalar, 8> diagTensor8;
//- Specify data associated with diagTensor8 type is contiguous
template<>
inline bool contiguous<diagTensor8>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
sphericalTensor8
Description
SphericalTensorN of 8 scalars.
\*---------------------------------------------------------------------------*/
#ifndef sphericalTensor8_H
#define sphericalTensor8_H
#include "SphericalTensorN.H"
#include "vector6.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef SphericalTensorN<scalar, 8> sphericalTensor8;
//- Specify data associated with sphericalTensor8 type is contiguous
template<>
inline bool contiguous<sphericalTensor8>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,64 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
tensor8
Description
TensorN of 8 scalars.
\*---------------------------------------------------------------------------*/
#ifndef tensor8_H
#define tensor8_H
#include "TensorN.H"
#include "vector8.H"
#include "sphericalTensor8.H"
#include "diagTensor8.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef TensorN<scalar, 8> tensor8;
//- Specify data associated with tensor8 type is contiguous
template<>
inline bool contiguous<tensor8>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Type
Vector8
Description
Vector8 obtained from generic VectorN
SourceFiles
Vector8.C
\*---------------------------------------------------------------------------*/
#ifndef Vector8_H
#define Vector8_H
#include "scalar.H"
#include "VectorN.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef VectorN<scalar, 8> vector8;
//- Specify data associated with vector4 type is contiguous
template<>
inline bool contiguous<vector8>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "calculatedFvPatchVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, calculatedFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
forAllTensorNTypes(doMakePatchTypeField)
forAllDiagTensorNTypes(doMakePatchTypeField)
forAllSphericalTensorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef calculatedFvPatchVectorNFields_H
#define calculatedFvPatchVectorNFields_H
#include "volVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "calculatedFvPatchVectorNFieldsFwd.H"
#include "calculatedFvPatchField.H"
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef calculatedFvPatchVectorNFieldsFwd_H
#define calculatedFvPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class calculatedFvPatchField;
#define makeTypedef(type, Type, args...) \
typedef calculatedFvPatchField<type> calculatedFvPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "coupledFvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeFieldTypeName(coupledFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
forAllTensorNTypes(doMakePatchTypeField)
forAllDiagTensorNTypes(doMakePatchTypeField)
forAllSphericalTensorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef coupledFvPatchVectorNFields_H
#define coupledFvPatchVectorNFields_H
#include "volVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "coupledFvPatchVectorNFieldsFwd.H"
#include "coupledFvPatchField.H"
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef coupledFvPatchFieldsFwd_H
#define coupledFvPatchFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class coupledFvPatchField;
#define makeTypedef(type, Type, args...) \
typedef coupledFvPatchField<type> coupledFvPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "emptyFvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, emptyFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
forAllTensorNTypes(doMakePatchTypeField)
forAllDiagTensorNTypes(doMakePatchTypeField)
forAllSphericalTensorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef emptyFvPatchVectorNFields_H
#define emptyFvPatchVectorNFields_H
#include "volVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "emptyFvPatchVectorNFieldsFwd.H"
#include "emptyFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef emptyFvPatchVectorNFieldsFwd_H
#define emptyFvPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class emptyFvPatchField;
#define makeTypedef(type, Type, args...) \
typedef emptyFvPatchField<type> emptyFvPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "fixedValueFvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, fixedValueFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
forAllTensorNTypes(doMakePatchTypeField)
forAllDiagTensorNTypes(doMakePatchTypeField)
forAllSphericalTensorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef fixedValueFvPatchVectorNFields_H
#define fixedValueFvPatchVectorNFields_H
#include "volVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "fixedValueFvPatchVectorNFieldsFwd.H"
#include "fixedValueFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef fixedValueFvPatchVectorNFieldsFwd_H
#define fixedValueFvPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedValueFvPatchField;
#define makeTypedef(type, Type, args...) \
typedef fixedValueFvPatchField<type> fixedValueFvPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "fvPatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeFvPatchField(fvPatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
template<> \
int fvPatchTypeField::disallowGenericFvPatchField \
( \
debug::debugSwitch("disallowGenericFvPatchField", 0) \
); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
#define doMakeFvPatchField(type, Type, args...) \
makeFvPatchField(fvPatch##Type##Field)
forAllVectorNTypes(doMakeFvPatchField)
forAllTensorNTypes(doMakeFvPatchField)
forAllDiagTensorNTypes(doMakeFvPatchField)
forAllSphericalTensorNTypes(doMakeFvPatchField)
#undef doMakeFvPatchField
#undef makeFvPatchField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef fvPatchVectorNFields_H
#define fvPatchVectorNFields_H
#include "fvPatchVectorNFieldsFwd.H"
#include "fvPatchField.H"
#include "fvPatchFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef fvPatchVectorNFieldsFwd_H
#define fvPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fvPatchField;
#define doMakeTypedef(type, Type, args...) \
typedef fvPatchField<type > fvPatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "genericFvPatchVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeFieldTypeName(genericFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
forAllTensorNTypes(doMakePatchTypeField)
forAllDiagTensorNTypes(doMakePatchTypeField)
forAllSphericalTensorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef genericFvPatchVectorNFields_H
#define genericFvPatchVectorNFields_H
#include "genericFvPatchField.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define doMakeTypedef(type, Type, args...) \
typedef genericFvPatchField<type > genericFvPatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,108 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "processorFvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
#define VectorNMatrixInterfaceFunc(Type) \
template <> \
void processorFvPatchField<Type>::initInterfaceMatrixUpdate \
( \
const Field<Type>& psiInternal, \
Field<Type>&, \
const BlockLduMatrix<Type>&, \
const CoeffField<Type>&, \
const Pstream::commsTypes commsType \
) const \
{ \
procPatch_.compressedSend \
( \
commsType, \
this->patch().patchInternalField(psiInternal)() \
); \
} \
\
template <> \
void processorFvPatchField<Type>::updateInterfaceMatrix \
( \
const Field<Type>& psiInternal, \
Field<Type>& result, \
const BlockLduMatrix<Type>&, \
const CoeffField<Type>& coeffs, \
const Pstream::commsTypes commsType \
) const \
{ \
Field<Type> pnf(this->size()); \
\
if (coeffs.activeType() == blockCoeffBase::SCALAR) \
{ \
pnf = coeffs.asScalar() * \
procPatch_.compressedReceive<Type>(commsType, this->size())(); \
} \
else if (coeffs.activeType() == blockCoeffBase::LINEAR) \
{ \
pnf = cmptMultiply(coeffs.asLinear(), \
procPatch_.compressedReceive<Type>(commsType, this->size())() \
); \
} \
else if (coeffs.activeType() == blockCoeffBase::SQUARE) \
{ \
pnf = coeffs.asSquare() & \
procPatch_.compressedReceive<Type>(commsType, this->size())(); \
} \
\
const unallocLabelList& faceCells = this->patch().faceCells(); \
\
forAll(faceCells, facei) \
{ \
result[faceCells[facei]] -= pnf[facei]; \
} \
}
#define doMakePatchTypeField(type, Type, args...) \
VectorNMatrixInterfaceFunc(type) \
\
makePatchTypeField(fvPatch##Type##Field, processorFvPatch##Type##Field);
forAllVectorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
#undef VectorNMatrixInterfaceFunc
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef processorFvPatchVectorNFields_H
#define processorFvPatchVectorNFields_H
#include "volVectorNFields.H"
#include "fvPatchVectorNFields.H"
#include "processorFvPatchVectorNFieldsFwd.H"
#include "processorFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef processorFvPatchVectorNFieldsFwd_H
#define processorFvPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class processorFvPatchField;
#define makeTypedef(type, Type, args...) \
typedef processorFvPatchField<type> processorFvPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "transformFvPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
#define makePatch(type, Type, args...) \
defineNamedTemplateTypeNameAndDebug(transformFvPatch##Type##Field, 0);
forAllVectorNTypes(makePatch)
forAllTensorNTypes(makePatch)
forAllDiagTensorNTypes(makePatch)
forAllSphericalTensorNTypes(makePatch)
#undef makePatch
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show more