From 9a49cf746f46f871d8986c4340488f89a28e55e6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 5 Mar 2012 16:37:28 +0000 Subject: [PATCH 1/7] COMP: zoltanRenumber: do not link against static libzoltan.a --- src/renumber/zoltanRenumber/Make/options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renumber/zoltanRenumber/Make/options b/src/renumber/zoltanRenumber/Make/options index ef48897a08..c637f39ba9 100644 --- a/src/renumber/zoltanRenumber/Make/options +++ b/src/renumber/zoltanRenumber/Make/options @@ -9,5 +9,5 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan \ + /* -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan */ \ -lmeshTools From 42069b50777b5ecd4a588f8408832aaf9b8b7946 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 6 Mar 2012 16:38:51 +0000 Subject: [PATCH 2/7] ENH: multiSolidBodyMotionFvMesh: multiple solid body rotations --- src/dynamicFvMesh/Make/files | 1 + .../multiSolidBodyMotionFvMesh.C | 219 ++++++++++++++++++ .../multiSolidBodyMotionFvMesh.H | 115 +++++++++ .../solidBodyMotionFvMesh.C | 4 +- 4 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C create mode 100644 src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.H diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files index ecfb8bc9f7..31036fca6e 100644 --- a/src/dynamicFvMesh/Make/files +++ b/src/dynamicFvMesh/Make/files @@ -6,6 +6,7 @@ dynamicInkJetFvMesh/dynamicInkJetFvMesh.C dynamicRefineFvMesh/dynamicRefineFvMesh.C solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C solidBodyMotionFunctions = solidBodyMotionFvMesh/solidBodyMotionFunctions $(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C $(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C new file mode 100644 index 0000000000..d5d37fc4bc --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C @@ -0,0 +1,219 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 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 "multiSolidBodyMotionFvMesh.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" +#include "transformField.H" +#include "cellZoneMesh.H" +#include "boolList.H" +#include "syncTools.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(multiSolidBodyMotionFvMesh, 0); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + multiSolidBodyMotionFvMesh, + IOobject + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io) +: + dynamicFvMesh(io), + dynamicMeshCoeffs_ + ( + IOdictionary + ( + IOobject + ( + "dynamicMeshDict", + io.time().constant(), + *this, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ).subDict(typeName + "Coeffs") + ), + undisplacedPoints_ + ( + IOobject + ( + "points", + io.time().constant(), + meshSubDir, + *this, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ) +{ + if (undisplacedPoints_.size() != nPoints()) + { + FatalIOErrorIn + ( + "multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh" + "(const IOobject&)", + dynamicMeshCoeffs_ + ) << "Read " << undisplacedPoints_.size() + << " undisplaced points from " << undisplacedPoints_.objectPath() + << " but the current mesh has " << nPoints() + << exit(FatalIOError); + } + + + zoneIDs_.setSize(dynamicMeshCoeffs_.size()); + SBMFs_.setSize(dynamicMeshCoeffs_.size()); + pointIDs_.setSize(dynamicMeshCoeffs_.size()); + label zoneI = 0; + + forAllConstIter(dictionary, dynamicMeshCoeffs_, iter) + { + if (iter().isDict()) + { + zoneIDs_[zoneI] = cellZones().findZoneID(iter().keyword()); + + if (zoneIDs_[zoneI] == -1) + { + FatalIOErrorIn + ( + "multiSolidBodyMotionFvMesh::" + "multiSolidBodyMotionFvMesh(const IOobject&)", + dynamicMeshCoeffs_ + ) << "Cannot find cellZone named " << iter().keyword() + << ". Valid zones are " << cellZones().names() + << exit(FatalIOError); + } + + const dictionary& subDict = iter().dict(); + + SBMFs_.set + ( + zoneI, + solidBodyMotionFunction::New(subDict, io.time()) + ); + + // Collect points of cell zone. + const cellZone& cz = cellZones()[zoneIDs_[zoneI]]; + + boolList movePts(nPoints(), false); + + forAll(cz, i) + { + label cellI = cz[i]; + const cell& c = cells()[cellI]; + forAll(c, j) + { + const face& f = faces()[c[j]]; + forAll(f, k) + { + label pointI = f[k]; + movePts[pointI] = true; + } + } + } + + syncTools::syncPointList(*this, movePts, orEqOp(), false); + + DynamicList