Skip to content
Snippets Groups Projects
Commit 5de5ae35 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

ENH: add labelVector2D definition

- can be useful for 2D mesh dimensioning or possibly for matrices
parent bdf57fb4
Branches
Tags
No related merge requests found
......@@ -88,6 +88,7 @@ primitives/Vector/lists/vectorListIOList.C
primitives/Tensor2D/tensor2D/tensor2D.C
primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
primitives/SymmTensor2D/symmTensor2D/symmTensor2D.C
primitives/Vector2D/labelVector2D/labelVector2D.C
primitives/Vector2D/vector2D/vector2D.C
primitives/complex/complex.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "labelVector2D.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const char* const Foam::labelVector2D::vsType::typeName = "labelVector2D";
template<>
const char* const Foam::labelVector2D::vsType::componentNames[] = { "x", "y" };
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::zero
(
labelVector2D::uniform(0)
);
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::one
(
labelVector2D::uniform(1)
);
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::max
(
labelVector2D::uniform(labelMax)
);
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::min
(
labelVector2D::uniform(-labelMax)
);
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::rootMax
(
labelVector2D::uniform(sqrt(scalar(labelMax)))
);
template<>
const Foam::labelVector2D Foam::labelVector2D::vsType::rootMin
(
labelVector2D::uniform(-sqrt(scalar(labelMax)))
);
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::labelVector2D
Description
A 2D vector of labels obtained from the generic Vector2D.
SourceFiles
labelVector2D.C
\*---------------------------------------------------------------------------*/
#ifndef labelVector2D_H
#define labelVector2D_H
#include "label.H"
#include "Vector2D.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef Vector2D<label> labelVector2D;
//- Data associated with labelVector2D type are contiguous
template<>
inline bool contiguous<labelVector2D>() {return true;}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -27,7 +27,7 @@ Typedef
Foam::vector2D
Description
vector2D obtained from generic Vector2D
A 2D vector of scalars obtained from the generic Vector2D.
SourceFiles
vector2D.C
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment