Commit 8c473a87 authored by Franjo's avatar Franjo

Added utility for scaling back the volume mesh.

parent 07979425
backScaleMesh.C
EXE = $(FOAM_USER_APPBIN)/backScaleMesh
EXE_INC = \
-I../../meshLibrary/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-ltriSurface \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary \
-lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | cfMesh: A library for mesh generation
\\ / O peration |
\\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
\\/ M anipulation | Copyright (C) Creative Fields, Ltd.
-------------------------------------------------------------------------------
License
This file is part of cfMesh.
cfMesh 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.
cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
Reads the specified surface and writes it in the fms format.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "polyMeshGen.H"
#include "coordinateModifier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
using namespace Foam;
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
IOdictionary meshDict
(
IOobject
(
"meshDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
polyMeshGen pmg(runTime);
pmg.read();
pointFieldPMG& pts = pmg.points();
if( !meshDict.found("geometryModification") )
FatalError << "Cannot backward scale mesh. geometryModification"
<< " does not exist in meshDict" << exit(FatalError);
coordinateModifier cMod(meshDict.subDict("geometryModification"));
//- apply backward transformation
forAll(pts, i)
pts[i] = cMod.backwardModifiedPoint(pts[i]);
Info << "Writting mesh with backward transformed points" << endl;
pmg.write();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
Markdown is supported
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