From cd2f614a48932c7c567bbe497205bb0948ffe301 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 31 Mar 2022 23:46:50 +0100 Subject: [PATCH] Added new polyTopoChangeMap and polyDistributionMap directories --- .../polyDistributionMap/IOdistributionMap.C | 158 ++ .../polyDistributionMap/IOdistributionMap.H | 98 ++ .../polyDistributionMap/distributionMap.C | 556 +++++++ .../polyDistributionMap/distributionMap.H | 672 ++++++++ .../polyDistributionMap/distributionMapBase.C | 1272 +++++++++++++++ .../polyDistributionMap/distributionMapBase.H | 495 ++++++ .../distributionMapBaseTemplates.C | 1420 +++++++++++++++++ .../distributionMapTemplates.C | 271 ++++ .../lagrangianDistributionMap.H | 122 ++ .../polyDistributionMap/polyDistributionMap.C | 366 +++++ .../polyDistributionMap/polyDistributionMap.H | 312 ++++ .../polyTopoChangeMap/cellMapper/cellMapper.C | 463 ++++++ .../polyTopoChangeMap/cellMapper/cellMapper.H | 165 ++ .../polyTopoChangeMap/faceMapper/faceMapper.C | 401 +++++ .../polyTopoChangeMap/faceMapper/faceMapper.H | 181 +++ .../polyTopoChangeMap/mapAddedPolyMesh.C | 81 + .../polyTopoChangeMap/mapAddedPolyMesh.H | 245 +++ .../mapPatchChange/mapPatchChange.H | 152 ++ .../mapSubsetMesh/mapSubsetMesh.H | 202 +++ .../polyTopoChangeMap/morphFieldMapper.H | 87 + .../polyTopoChangeMap/objectMap/objectMap.H | 121 ++ .../polyTopoChangeMap/objectMap/objectMapI.H | 142 ++ .../polyTopoChangeMap/polyTopoChangeMap.C | 210 +++ .../polyTopoChangeMap/polyTopoChangeMap.H | 662 ++++++++ 24 files changed, 8854 insertions(+) create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMap.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMap.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMapBase.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMapBase.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMapBaseTemplates.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMapTemplates.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/lagrangianDistributionMap.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/polyDistributionMap.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyDistributionMap/polyDistributionMap.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/faceMapper/faceMapper.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/faceMapper/faceMapper.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/mapAddedPolyMesh.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/mapAddedPolyMesh.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/mapPatchChange/mapPatchChange.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/mapSubsetMesh/mapSubsetMesh.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/morphFieldMapper.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/objectMap/objectMap.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/objectMap/objectMapI.H create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.C create mode 100644 src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.H diff --git a/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.C b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.C new file mode 100644 index 0000000000..9efc758d7c --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2014-2022 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 "IOdistributionMap.H" + +/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(IOdistributionMap, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::IOdistributionMap::IOdistributionMap(const IOobject& io) +: + regIOobject(io) +{ + // Temporary warning + if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED) + { + WarningInFunction + << "IOdistributionMap " << name() + << " constructed with IOobject::MUST_READ_IF_MODIFIED" + " but IOdistributionMap does not support automatic rereading." + << endl; + } + + if + ( + ( + io.readOpt() == IOobject::MUST_READ + || io.readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk()) + ) + { + readStream(typeName) >> *this; + close(); + } +} + + +Foam::IOdistributionMap::IOdistributionMap +( + const IOobject& io, + const distributionMap& map +) +: + regIOobject(io) +{ + // Temporary warning + if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED) + { + WarningInFunction + << "IOdistributionMap " << name() + << " constructed with IOobject::MUST_READ_IF_MODIFIED" + " but IOdistributionMap does not support automatic rereading." + << endl; + } + + if + ( + ( + io.readOpt() == IOobject::MUST_READ + || io.readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk()) + ) + { + readStream(typeName) >> *this; + close(); + } + else + { + distributionMap::operator=(map); + } +} + + +Foam::IOdistributionMap::IOdistributionMap +( + const IOobject& io, + distributionMap&& map +) +: + regIOobject(io), + distributionMap(move(map)) +{ + // Temporary warning + if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED) + { + WarningInFunction + << "IOdistributionMap " << name() + << " constructed with IOobject::MUST_READ_IF_MODIFIED" + " but IOdistributionMap does not support automatic rereading." + << endl; + } + + if + ( + ( + io.readOpt() == IOobject::MUST_READ + || io.readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk()) + ) + { + readStream(typeName) >> *this; + close(); + } +} + + +// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // + +Foam::IOdistributionMap::~IOdistributionMap() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::IOdistributionMap::readData(Istream& is) +{ + return (is >> *this).good(); +} + + +bool Foam::IOdistributionMap::writeData(Ostream& os) const +{ + return (os << *this).good(); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.H b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.H new file mode 100644 index 0000000000..e78a31307e --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/IOdistributionMap.H @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::IOdistributionMap + +Description + IOdistributionMap is derived from distributionMap and + IOobject to give the distributionMap + automatic IO functionality via the objectRegistry. + +SourceFiles + IOdistributionMap.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IOdistributionMap_H +#define IOdistributionMap_H + +#include "distributionMap.H" +#include "regIOobject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class IOdistributionMap Declaration +\*---------------------------------------------------------------------------*/ + +class IOdistributionMap +: + public regIOobject, + public distributionMap +{ + +public: + + //- Runtime type information + TypeName("distributionMap"); + + // Constructors + + //- Construct given an IOobject + IOdistributionMap(const IOobject&); + + //- Construct given an IOobject and distributionMap + IOdistributionMap(const IOobject&, const distributionMap&); + + //- Move constructor transferring the distributionMap contents + IOdistributionMap(const IOobject&, distributionMap&&); + + + //- Destructor + virtual ~IOdistributionMap(); + + + // Member Functions + + //- ReadData function required for regIOobject read operation + virtual bool readData(Istream&); + + //- WriteData function required for regIOobject write operation + virtual bool writeData(Ostream&) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMap.C b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMap.C new file mode 100644 index 0000000000..21626cbaeb --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyDistributionMap/distributionMap.C @@ -0,0 +1,556 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 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 "distributionMap.H" +#include "globalIndexAndTransform.H" +#include "transformField.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(distributionMap, 0); +} + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<> +void Foam::distributionMap::transform::operator() +( + const transformer&, + const bool, + List