Commit 4415bf4f authored by Franjo's avatar Franjo

Merge branch 'release'

parents a6640eb0 5d6ec63b
ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
ifeq (Int,$(findstring Int,$(WM_LABEL_OPTION)))
CFMESH_MACROS = -DNoSizeType
else
CFMESH_MACROS =
endif
endif
ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1)
CFMESH_LIBS = -lmeshTools -lfiniteVolume -ledgeMesh
CFMESH_MACROS = -DExtendSpecific
else
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
CFMESH_MACROS =
endif
endif
EXE_INC = \
$(CFMESH_MACROS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
......@@ -6,9 +27,6 @@ EXE_INC = \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-ledgeMesh \
$(CFMESH_LIBS) \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
ifeq (Int,$(findstring Int,$(WM_LABEL_OPTION)))
CFMESH_MACROS = -DNoSizeType
else
CFMESH_MACROS =
endif
endif
ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1)
CFMESH_LIBS = -lmeshTools -lfiniteVolume -ledgeMesh
CFMESH_MACROS = -DExtendSpecific
else
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
CFMESH_MACROS =
endif
endif
EXE_INC = \
$(CFMESH_MACROS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
......@@ -6,9 +27,6 @@ EXE_INC = \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-ledgeMesh \
$(CFMESH_LIBS) \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
......@@ -30,8 +30,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "objectRegistry.H"
#include "Time.H"
#include "cartesianMeshGenerator.H"
using namespace Foam;
......
ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
ifeq (Int,$(findstring Int,$(WM_LABEL_OPTION)))
CFMESH_MACROS = -DNoSizeType
else
CFMESH_MACROS =
endif
endif
ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1)
CFMESH_LIBS = -lmeshTools -lfiniteVolume -ledgeMesh
CFMESH_MACROS = -DExtendSpecific
else
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
CFMESH_MACROS =
endif
endif
EXE_INC = \
$(CFMESH_MACROS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
......@@ -6,9 +27,6 @@ EXE_INC = \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-ledgeMesh \
$(CFMESH_LIBS) \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
ifeq (Int,$(findstring Int,$(WM_LABEL_OPTION)))
CFMESH_MACROS = -DNoSizeType
else
CFMESH_MACROS =
endif
endif
ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1)
CFMESH_LIBS = -lmeshTools -lfiniteVolume -ledgeMesh
CFMESH_MACROS = -DExtendSpecific
else
CFMESH_LIBS = -lmeshTools -ltriSurface -lfiniteVolume -ledgeMesh
CFMESH_MACROS =
endif
endif
EXE_INC = \
$(CFMESH_MACROS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
......@@ -6,9 +27,6 @@ EXE_INC = \
-I../../meshLibrary/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-lfiniteVolume \
-ledgeMesh \
$(CFMESH_LIBS) \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
#if defined(__GNUC__)
# if defined(darwinIntel64)
OMP_FLAGS =
# else
OMP_FLAGS = -DUSE_OMP -fopenmp
# endif
#else
OMP_FLAGS =
#endif
ifeq (Gcc,$(findstring Gcc,$(WM_COMPILER)))
OMP_FLAGS = -DUSE_OMP -fopenmp
else
OMP_FLAGS =
endif
ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
ifeq (Int,$(findstring Int,$(WM_LABEL_OPTION)))
CFMESH_MACROS = -DNoSizeType
LIBS =
else
CFMESH_MACROS =
LIBS =
endif
endif
ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1)
CFMESH_MACROS = -DExtendSpecific
LIBS = -lmeshTools -ledgeMesh
else
CFMESH_MACROS =
endif
endif
EXE_INC = \
$(OMP_FLAGS) \
$(OMP_FLAGS) $(CFMESH_MACROS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = $(LIBS)
......@@ -32,7 +32,6 @@ Description
#include "triSurfacePatchManipulator.H"
#include "triSurfaceCleanupDuplicateTriangles.H"
#include "demandDrivenData.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "cartesianMeshExtractor.H"
#include "meshSurfaceEngine.H"
......
......@@ -29,7 +29,6 @@ Description
#include "triSurf.H"
#include "triSurfacePatchManipulator.H"
#include "demandDrivenData.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "cartesianMeshExtractor.H"
#include "meshSurfaceEngine.H"
......
......@@ -28,7 +28,6 @@ Description
#include "tetMeshGenerator.H"
#include "triSurf.H"
#include "demandDrivenData.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "tetMeshExtractorOctree.H"
#include "meshSurfaceEngine.H"
......
......@@ -35,8 +35,6 @@ SourceFiles
#ifndef boundaryLayers_H
#define boundaryLayers_H
#include "objectRegistry.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
#include "meshSurfaceEngine.H"
#include "meshSurfacePartitioner.H"
......
......@@ -36,8 +36,6 @@ SourceFiles
#ifndef extrudeLayer_H
#define extrudeLayer_H
#include "objectRegistry.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
#include "VRWGraphList.H"
#include "labelPair.H"
......@@ -54,51 +52,51 @@ namespace Foam
class extrudeLayer
{
// Private data
//- Reference to the mesh
polyMeshGen& mesh_;
//- thickness
const scalar thickness_;
const scalar thickness_;
//- number of points in the original mesh
const label nOrigPoints_;
//- number of faces in the original mesh
const label nOrigFaces_;
//- number of cells in the original mesh
const label nOrigCells_;
//- pairs of faces making the extruded front
LongList<labelPair> extrudedFaces_;
//- store the orientation of the extruded front
//- true if the pair has the same orientation and false otherwise
LongList<bool> pairOrientation_;
//- original point label
labelLongList origPointLabel_;
// Private member functions
//- duplicate faces which will be extruded
void createDuplicateFrontFaces(const LongList<labelPair>&);
//- create new vertices and open the mesh
void createNewVertices();
//- move points to make space for the new cells
void movePoints();
//- create layer cells
void createLayerCells();
//- create new faces at parallel boundaries
void createNewFacesParallel();
//- update boundary patches
void updateBoundary();
// Nested classes
//- this class provides addressing data needed for generating
//- cells emerging as a consequence of self-intersecting layers
......@@ -107,18 +105,18 @@ class extrudeLayer
// Private data
//- const reference to mesh faces
const faceListPMG& faces_;
//- const reference to extruded face pairs
const LongList<labelPair>& extrudedFaces_;
//- const reference telling the orientation of each face pair
LongList<bool> pairOrientation_;
//- const reference to the extruded faces at points
const VRWGraph& pointExtruded_;
public:
// Construct from faces, extruded face pairs and
// point-extrudedfaces addressing
addressingCalculator
......@@ -128,41 +126,41 @@ class extrudeLayer
const LongList<bool>& pairOrientation,
const VRWGraph& pointFaces
);
// Destructor
~addressingCalculator();
// Member functions
//- return label of the original face for the given face
inline label origFaceLabel(const label extrudedI) const;
//- return position of point in extruded face
inline label positionInFace
(
const label extrudedI,
const label pointI
) const;
//- return point label in the original face
inline label origPointLabel
(
const label extrudedI,
const label pos
) const;
inline label origPoint
(
const label extrudedI,
const label pointI
) const;
//- find face sharing an edge with the given face
inline label faceSharingEdge
(
const label extrudedI,
const label eI
) const;
//- find faces attached to both points
inline void facesSharingEdge
(
......@@ -171,7 +169,7 @@ class extrudeLayer
DynList<label>&
) const;
};
// Enumerators
enum extrudeLayerTypes_
{
......@@ -179,17 +177,17 @@ class extrudeLayer
FRONTVERTEX = 1,
FRONTVERTEXPROCBND = 2
};
//- Disallow bitwise copy construct
extrudeLayer(const extrudeLayer&);
//- Disallow bitwise assignment
void operator=(const extrudeLayer&);
public:
// Constructors
//- Construct from mesh, extrusion faces, thickness and number of layers
extrudeLayer
(
......@@ -197,10 +195,10 @@ class extrudeLayer
const LongList<labelPair>& extrusionFront,
const scalar thickness = -1.0
);
// Destructor
~extrudeLayer();
// Public member functions
};
......
......@@ -36,8 +36,6 @@ SourceFiles
#ifndef refineBoundaryLayers_H
#define refineBoundaryLayers_H
#include "objectRegistry.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
#include "meshSurfaceEngine.H"
#include "DynList.H"
......
......@@ -36,8 +36,6 @@ SourceFiles
#ifndef triangulateNonPlanarBaseFaces_H
#define triangulateNonPlanarBaseFaces_H
#include "objectRegistry.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -35,8 +35,6 @@ SourceFiles
#ifndef checkMeshDict_H
#define checkMeshDict_H
#include "objectRegistry.H"
#include "Time.H"
#include "IOdictionary.H"
#include <map>
......
......@@ -29,9 +29,11 @@ License
// Construct from Istream
template<class T, Foam::label staticSize>
Foam::DynList<T, staticSize>::DynList(Istream& is)
Foam::DynList<T, staticSize>::DynList(Istream&)
:
UList<T>(),
dataPtr_(NULL),
nAllocated_(0),
staticData_(),
nextFree_(0)
{
FatalErrorIn
......@@ -39,11 +41,6 @@ Foam::DynList<T, staticSize>::DynList(Istream& is)
"template<class T, Foam::label staticSize>"
"\nFoam::DynList<T, staticSize>::DynList(Istream& is)"
) << "Not implemented" << exit(FatalError);
List<T> helper(is);
nextFree_ = helper.size();
UList<T>::swap(helper);
}
......@@ -54,7 +51,7 @@ Foam::Ostream& Foam::operator<<
const Foam::DynList<T, staticSize>& DL
)
{
UList<T> helper(const_cast<T*>(DL.begin()), DL.nextFree_);
UList<T> helper(DL.dataPtr_, DL.nextFree_);
os << helper;
return os;
......@@ -74,9 +71,11 @@ Foam::Istream& Foam::operator>>
"\nFoam::Istream& Foam::operator>>"
"(Foam::Istream& is, Foam::DynList<T, staticSize>& DL)"
) << "Not implemented" << exit(FatalError);
is >> static_cast<List<T>&>(DL);
DL.nextFree_ = DL.List<T>::size();
UList<T> helper(DL.dataPtr_, DL.nextFree_);
//is >> static_cast<List<T>&>(DL);
is >> helper;
DL.nextFree_ = helper.size();
return is;
}
......
......@@ -73,10 +73,14 @@ Istream& operator>>
template<class T, label staticSize = 16>
class DynList
:
public UList<T>
{
// Private data
//- pointer to the data
T* dataPtr_;
//- size of the allocated data
label nAllocated_;
//- statically allocated data (used for short lists)
T staticData_[staticSize];
......@@ -84,12 +88,21 @@ class DynList
label nextFree_;
// Private member functions
//- access to the data pointer
inline T* data();
//- const access to the data pointer
inline const T* data() const;
//- allocate list size
inline void allocateSize(const label);
//- check if index is inside the scope (used for debugging only)
inline void checkIndex(const label) const;
//- check if nAllocated_ is greater or equal to nextFree_
inline void checkAllocation() const;
public:
// Constructors
......@@ -205,6 +218,10 @@ public:
template<class ListType>
inline void operator=(const ListType&);
//- Compare the list with the another one
inline bool operator==(const DynList<T, staticSize>&) const;
inline bool operator!=(const DynList<T, staticSize>&) const;
// IOstream operators
......
......@@ -23,48 +23,66 @@ License
\*---------------------------------------------------------------------------*/
template<class T, Foam::label staticSize>
inline T* Foam::DynList<T, staticSize>::data()
{
return dataPtr_;
}
template<class T, Foam::label staticSize>
inline const T* Foam::DynList<T, staticSize>::data() const
{
return dataPtr_;
}
template<class T, Foam::label staticSize>
inline void Foam::DynList<T, staticSize>::allocateSize(const label s)
{
if( s > UList<T>::size() )
checkAllocation();
if( s > staticSize )
{
T* newData = new T[s];
if( s > nAllocated_ )
{
//- allocates enough space for the elements
T* newData = new T[s];
for(label i=0;i<nextFree_;++i)
newData[i] = this->operator[](i);
for(label i=0;i<nextFree_;++i)
newData[i] = this->operator[](i);
T* data = UList<T>::begin();
if( data && (data != staticData_) )
delete [] data;
if( nAllocated_ > staticSize )
delete [] dataPtr_;
//UList<T>::reset(newData, s);
this->UList<T>::operator=(UList<T>(newData, s));
}
else if( (s > staticSize) && (s < UList<T>::size()) )
{
T* newData = new T[s];
dataPtr_ = newData;
nAllocated_ = s;
}
else if( s < nAllocated_ )
{
//- shrinks the list
T* newData = new T[s];
for(label i=0;i<s;++i)
newData[i] = this->operator[](i);
for(label i=0;i<s;++i)
newData[i] = this->operator[](i);
T* data = UList<T>::begin();
delete [] data;
delete [] dataPtr_;
//UList<T>::reset(newData, s);
this->UList<T>::operator=(UList<T>(newData, s));
dataPtr_ = newData;
nAllocated_ = s;
}