Commit e0f8dbda authored by Franjo's avatar Franjo

Initial commit

parents
#!/bin/sh
# Compile mesh library
wclean libso meshLibrary
# Compile executables
wclean all executables
# Compile utilities
wclean all utilities
#!/bin/sh
# Compile mesh library
wmake libso meshLibrary
# Compile executables
wmake all executables
# Compile utilities
wmake all utilities
# -*- mode: org; -*-
#
#+TITLE: *cfMesh README for version 1.0*
#+AUTHOR: Franjo Juretic.
#+DATE: May 2014
#+LINK: http://www.c-fields.com
#+OPTIONS:
cfMesh is a library for mesh generation built on OpenFOAM.
* License
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.
* System requirements
cfMesh is developed and tested on Linux and MS Windows.
* Installation
The binaries can be downloaded from www.c-fields.com
* Building from Sources (Optional)
cfMesh can be built with recent versions of OpenFOAM and foam-extend. In order to build the library, a working OpenFOAM environment is needed. The build started by the Allwmake script located in this folder. It can be built with gcc and mingw compilers which support OpenMP (gcc-4.2.4 and above). Other compilers are not tested.
* Getting Started
Copy the 'tutorials' examples directory in the cfMesh distribution to the
'run' directory. If the OpenFOAM environment variables are set correctly,
then the following command will work correctly:
+ cp -r tutorials $FOAM_RUN
Run the first example case of a simplified car body:
+ cd $FOAM_RUN/tutorials/asmoOctree
+ cartesianMesh
* Documentation
http://www.c-fields.com
\ No newline at end of file
cartesian2DMesh.C
EXE = $(FOAM_USER_APPBIN)/cartesian2DMesh
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Application
Generates cartesian mesh
Description
Generates a 2D cartesian mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "cartesian2DMeshGenerator.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
//- 2d cartesian mesher cannot be run in parallel
argList::noParallel();
cartesian2DMeshGenerator cmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
cmg.writeMesh();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
cartesianMesh.C
EXE = $(FOAM_USER_APPBIN)/cartesianMesh
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Application
Generates cartesian mesh
Description
- takes a triangulated surface and generates a cartesian mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "objectRegistry.H"
#include "Time.H"
#include "cartesianMeshGenerator.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
cartesianMeshGenerator cmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
cmg.writeMesh();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
tetMesh.C
EXE = $(FOAM_USER_APPBIN)/tetMesh
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Application
Generates tetrahedral mesh
Description
- takes a triangulated surface and generates a tetrahedral mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "tetMeshGenerator.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
//- tetrahedral mesher cannot be run in parallel yet
argList::noParallel();
tetMeshGenerator tmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << endl;
tmg.writeMesh();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
This diff is collapsed.
#if defined(__GNUC__)
OMP_FLAGS = -DUSE_OMP -fopenmp
#else
OMP_FLAGS =
#endif
EXE_INC = \
$(OMP_FLAGS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "cartesian2DMeshGenerator.H"
#include "polyMeshGen2DEngine.H"
#include "triSurf.H"
#include "triSurfacePatchManipulator.H"
#include "demandDrivenData.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "cartesianMeshExtractor.H"
#include "meshSurfaceEngine.H"
#include "meshSurfaceMapper2D.H"
#include "meshSurfaceEdgeExtractor2D.H"
#include "meshSurfaceOptimizer.H"
#include "topologicalCleaner.H"
#include "boundaryLayers.H"
#include "refineBoundaryLayers.H"
#include "renameBoundaryPatches.H"
#include "checkMeshDict.H"
#include "checkCellConnectionsOverFaces.H"
#include "checkIrregularSurfaceConnections.H"
#include "checkNonMappableCellConnections.H"
#include "checkBoundaryFacesSharingTwoEdges.H"
#include "triSurfaceMetaData.H"
//#define DEBUG
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * Private member functions * * * * * * * * * * * * //
void cartesian2DMeshGenerator::createCartesianMesh()
{
//- create polyMesh from octree boxes
cartesianMeshExtractor cme(*octreePtr_, meshDict_, mesh_);
if( meshDict_.found("decomposePolyhedraIntoTetsAndPyrs") )
{
if( readBool(meshDict_.lookup("decomposePolyhedraIntoTetsAndPyrs")) )
cme.decomposeSplitHexes();
}
cme.createMesh();
# ifdef DEBUG
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
}
void cartesian2DMeshGenerator::surfacePreparation()
{
//- removes unnecessary cells and morph the boundary
//- such that there is only one boundary face per cell
//- It also checks topology of cells after morphing is performed
bool changed;
do
{
changed = false;