From 1f89e3b5d4e555bb121b787d34d0e4d05fd2a8c9 Mon Sep 17 00:00:00 2001 From: laurence <laurence> Date: Fri, 31 May 2013 09:34:22 +0100 Subject: [PATCH] ENH: Add Field and IOField for quaternion --- src/OpenFOAM/Make/files | 2 + .../Fields/quaternionField/quaternionField.C | 45 +++++++++++++ .../Fields/quaternionField/quaternionField.H | 64 +++++++++++++++++++ .../quaternionField/quaternionIOField.C | 43 +++++++++++++ .../quaternionField/quaternionIOField.H | 49 ++++++++++++++ 5 files changed, 203 insertions(+) create mode 100644 src/OpenFOAM/fields/Fields/quaternionField/quaternionField.C create mode 100644 src/OpenFOAM/fields/Fields/quaternionField/quaternionField.H create mode 100644 src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.C create mode 100644 src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.H diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 8fbcde54bc5..6fca790005e 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -555,6 +555,7 @@ $(Fields)/sphericalTensorField/sphericalTensorField.C $(Fields)/diagTensorField/diagTensorField.C $(Fields)/symmTensorField/symmTensorField.C $(Fields)/tensorField/tensorField.C +$(Fields)/quaternionField/quaternionField.C $(Fields)/triadField/triadField.C $(Fields)/complexFields/complexFields.C @@ -574,6 +575,7 @@ $(Fields)/symmTensorField/symmTensorIOField.C $(Fields)/symmTensorField/symmTensorFieldIOField.C $(Fields)/tensorField/tensorIOField.C $(Fields)/tensorField/tensorFieldIOField.C +$(Fields)/quaternionField/quaternionIOField.C $(Fields)/triadField/triadIOField.C $(Fields)/transformField/transformField.C diff --git a/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.C b/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.C new file mode 100644 index 00000000000..ed415a60e1a --- /dev/null +++ b/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "quaternionField.H" + +#define TEMPLATE +#include "FieldFunctionsM.C" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "undefFieldFunctionsM.H" + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.H b/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.H new file mode 100644 index 00000000000..acb8251ffea --- /dev/null +++ b/src/OpenFOAM/fields/Fields/quaternionField/quaternionField.H @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::quaternionField + +Description + Specialisation of Field\<T\> for quaternion. + +SourceFiles + quaternionField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef quaternionField_H +#define quaternionField_H + +#include "Field.H" +#include "quaternion.H" + +#define TEMPLATE +#include "FieldFunctionsM.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +typedef Field<quaternion> quaternionField; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "undefFieldFunctionsM.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.C b/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.C new file mode 100644 index 00000000000..1bc1cb52a78 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. + +Description + quaternionField with IO. + +\*---------------------------------------------------------------------------*/ + +#include "quaternionIOField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTemplateTypeNameAndDebugWithName + ( + quaternionIOField, + "quaternionField", + 0 + ); +} + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.H b/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.H new file mode 100644 index 00000000000..62b69c9731a --- /dev/null +++ b/src/OpenFOAM/fields/Fields/quaternionField/quaternionIOField.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::quaternionIOField + +Description + quaternionField with IO. + +\*---------------------------------------------------------------------------*/ + +#ifndef quaternionIOField_H +#define quaternionIOField_H + +#include "quaternionField.H" +#include "IOField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOField<quaternion> quaternionIOField; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // -- GitLab