diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index df5381fcf5..0dd52536e9 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -609,6 +609,8 @@ Fields = fields/Fields $(Fields)/labelField/labelField.C $(Fields)/scalarField/scalarField.C +$(Fields)/vectorField/vectorField.C +$(Fields)/vector2DField/vector2DField.C $(Fields)/sphericalTensorField/sphericalTensorField.C $(Fields)/diagTensorField/diagTensorField.C $(Fields)/symmTensorField/symmTensorField.C diff --git a/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.C b/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.C new file mode 100644 index 0000000000..edacb39cbe --- /dev/null +++ b/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "vector2DField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::tmp Foam::zip +( + const tmp& x, + const tmp& y +) +{ + tmp txy(new vector2DField(x->size())); + vector2DField& xy = txy.ref(); + xy.replace(0, x); + xy.replace(1, y); + return txy; +} + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.H b/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.H index 91d84a0d9c..2a4c7edb24 100644 --- a/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.H +++ b/src/OpenFOAM/fields/Fields/vector2DField/vector2DField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,6 +37,19 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +tmp zip(const tmp& x, const tmp& y); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/vectorField/vectorField.C b/src/OpenFOAM/fields/Fields/vectorField/vectorField.C new file mode 100644 index 0000000000..078381d8ec --- /dev/null +++ b/src/OpenFOAM/fields/Fields/vectorField/vectorField.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "vectorField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::tmp Foam::zip +( + const tmp& x, + const tmp& y, + const tmp& z +) +{ + tmp txyz(new vectorField(x->size())); + vectorField& xyz = txyz.ref(); + xyz.replace(0, x); + xyz.replace(1, y); + xyz.replace(2, z); + return txyz; +} + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/vectorField/vectorField.H b/src/OpenFOAM/fields/Fields/vectorField/vectorField.H index beb6541d11..c3a5a3e807 100644 --- a/src/OpenFOAM/fields/Fields/vectorField/vectorField.H +++ b/src/OpenFOAM/fields/Fields/vectorField/vectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,6 +49,15 @@ typedef Field vectorField; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +tmp zip +( + const tmp& x, + const tmp& y, + const tmp& z +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //