Skip to content
Snippets Groups Projects
Commit 3000d2c8 authored by Matti Pellika's avatar Matti Pellika
Browse files

Added Geo/CellCompelex.cpp and Geo/CellComplex.h

They construct a cell complex of a finite elemement mesh of a model,
and are able to reduce and coreduce it in order to compute model's
homology groups.

Also added contrib/kbipack to by Saku Suuriniemi for future use to
compute Smith normal forms of the boundary operator matrices of the
reduced cell complex.

Modified Makefiles and configure.in accordingly.
parent 36597822
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,7 @@ MFace::MFace(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3) ...@@ -74,6 +74,7 @@ MFace::MFace(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3)
} }
else else
_si[3] = 3; _si[3] = 3;
} }
SVector3 MFace::normal() const SVector3 MFace::normal() const
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <functional> #include <functional>
#include <vector> #include <vector>
#include "MVertex.h" #include "MVertex.h"
#include "MEdge.h"
#include "SVector3.h" #include "SVector3.h"
// A mesh face. // A mesh face.
......
...@@ -10,6 +10,7 @@ LIB = ../lib/libGmshGeo${LIBEXT} ...@@ -10,6 +10,7 @@ LIB = ../lib/libGmshGeo${LIBEXT}
INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\
${DASH}I../Post ${DASH}I../Numeric ${DASH}I../Parser\ ${DASH}I../Post ${DASH}I../Numeric ${DASH}I../Parser\
${DASH}I../contrib/ANN/include\ ${DASH}I../contrib/ANN/include\
${DASH}I../contrib/kbipack\
${DASH}I../contrib/MathEval ${DASH}I../contrib/gmm ${DASH}I../contrib/MathEval ${DASH}I../contrib/gmm
CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE}
...@@ -37,7 +38,9 @@ SRC = GEntity.cpp\ ...@@ -37,7 +38,9 @@ SRC = GEntity.cpp\
MElement.cpp\ MElement.cpp\
MLine.cpp MTriangle.cpp MQuadrangle.cpp MTetrahedron.cpp\ MLine.cpp MTriangle.cpp MQuadrangle.cpp MTetrahedron.cpp\
MHexahedron.cpp MPrism.cpp MPyramid.cpp\ MHexahedron.cpp MPrism.cpp MPyramid.cpp\
MZone.cpp MZoneBoundary.cpp MZone.cpp MZoneBoundary.cpp\
CellComplex.cpp
OBJ = ${SRC:.cpp=${OBJEXT}} OBJ = ${SRC:.cpp=${OBJEXT}}
...@@ -375,3 +378,5 @@ MPyramid${OBJEXT}: MPyramid.cpp MPyramid.h MElement.h ../Common/GmshDefines.h \ ...@@ -375,3 +378,5 @@ MPyramid${OBJEXT}: MPyramid.cpp MPyramid.h MElement.h ../Common/GmshDefines.h \
../Numeric/Numeric.h ../Numeric/GmshMatrix.h ../Numeric/Numeric.h ../Numeric/GmshMatrix.h
MZone${OBJEXT}: MZone.cpp ../Common/GmshConfig.h MZone${OBJEXT}: MZone.cpp ../Common/GmshConfig.h
MZoneBoundary${OBJEXT}: MZoneBoundary.cpp ../Common/GmshConfig.h MZoneBoundary${OBJEXT}: MZoneBoundary.cpp ../Common/GmshConfig.h
CellComplex${OBJEXT}: CellComplex.cpp CellComplex.h
...@@ -26,6 +26,8 @@ GMSH_API =\ ...@@ -26,6 +26,8 @@ GMSH_API =\
Geo/MTetrahedron.h Geo/MHexahedron.h Geo/MPrism.h Geo/MPyramid.h\ Geo/MTetrahedron.h Geo/MHexahedron.h Geo/MPrism.h Geo/MPyramid.h\
Geo/discreteVertex.h Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h\ Geo/discreteVertex.h Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h\
Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h Geo/Pair.h Geo/Range.h\ Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h Geo/Pair.h Geo/Range.h\
Geo/CellComplex.h\
contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h contrib/kbipack/gmp_blas.h\
Numeric/Gauss.h Numeric/FunctionSpace.h Numeric/GmshMatrix.h\ Numeric/Gauss.h Numeric/FunctionSpace.h Numeric/GmshMatrix.h\
Numeric/gmshAssembler.h Numeric/gmshTermOfFormulation.h Numeric/gmshLaplace.h\ Numeric/gmshAssembler.h Numeric/gmshTermOfFormulation.h Numeric/gmshLaplace.h\
Numeric/gmshElasticity.h Numeric/gmshLinearSystem.h Numeric/gmshLinearSystemGmm.h\ Numeric/gmshElasticity.h Numeric/gmshLinearSystem.h Numeric/gmshLinearSystemGmm.h\
...@@ -34,6 +36,7 @@ GMSH_API =\ ...@@ -34,6 +36,7 @@ GMSH_API =\
Common/VertexArray.h Common/GmshMessage.h\ Common/VertexArray.h Common/GmshMessage.h\
Common/Gmsh.h Common/GmshConfig.h Common/GmshDefines.h Common/GmshVersion.h Common/Gmsh.h Common/GmshConfig.h Common/GmshDefines.h Common/GmshVersion.h
GMSH_EMBEDDED = ${GMSH_API}\ GMSH_EMBEDDED = ${GMSH_API}\
Geo/GModel.cpp Geo/GModelIO_Mesh.cpp Geo/GEntity.cpp\ Geo/GModel.cpp Geo/GModelIO_Mesh.cpp Geo/GEntity.cpp\
Geo/GVertex.cpp Geo/GEdge.cpp Geo/GEdgeLoop.cpp Geo/GFace.cpp Geo/GRegion.cpp\ Geo/GVertex.cpp Geo/GEdge.cpp Geo/GEdgeLoop.cpp Geo/GFace.cpp Geo/GRegion.cpp\
......
...@@ -1277,6 +1277,7 @@ Optional Features: ...@@ -1277,6 +1277,7 @@ Optional Features:
--enable-chaco compile Chaco partitioner (default=yes) --enable-chaco compile Chaco partitioner (default=yes)
--enable-tetgen compile Tetgen if available (default=yes) --enable-tetgen compile Tetgen if available (default=yes)
--enable-matheval compile MathEval if available (default=yes) --enable-matheval compile MathEval if available (default=yes)
--enable-kbipack compile kbipack if available (default=yes)
--enable-gmm use gmm++ if available (default=yes) --enable-gmm use gmm++ if available (default=yes)
--enable-osmesa use OSMesa for offscreen rendering (default=no) --enable-osmesa use OSMesa for offscreen rendering (default=no)
--enable-cgns enable CGNS output (default=no) --enable-cgns enable CGNS output (default=no)
...@@ -1911,6 +1912,11 @@ if test "${enable_matheval+set}" = set; then ...@@ -1911,6 +1912,11 @@ if test "${enable_matheval+set}" = set; then
enableval=$enable_matheval; enableval=$enable_matheval;
fi fi
# Check whether --enable-kbipack was given.
if test "${enable_kbipack+set}" = set; then
enableval=$enable_kbipack;
fi
# Check whether --enable-gmm was given. # Check whether --enable-gmm was given.
if test "${enable_gmm+set}" = set; then if test "${enable_gmm+set}" = set; then
enableval=$enable_gmm; enableval=$enable_gmm;
...@@ -1978,6 +1984,7 @@ if test "x$enable_minimal" = "xyes"; then ...@@ -1978,6 +1984,7 @@ if test "x$enable_minimal" = "xyes"; then
enable_netgen=no; enable_netgen=no;
enable_tetgen=no; enable_tetgen=no;
enable_matheval=no; enable_matheval=no;
enable_kbipack=no;
enable_gmm=no; enable_gmm=no;
enable_ann=no; enable_ann=no;
enable_metis=no; enable_metis=no;
...@@ -4746,6 +4753,39 @@ _ACEOF ...@@ -4746,6 +4753,39 @@ _ACEOF
fi fi
fi fi
if test "x$enable_kbipack" != "xno"; then
{ echo "$as_me:$LINENO: checking for ./contrib/kbipack/gmp_normal_form.h" >&5
echo $ECHO_N "checking for ./contrib/kbipack/gmp_normal_form.h... $ECHO_C" >&6; }
if test "${ac_cv_file___contrib_kbipack_gmp_normal_form_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
test "$cross_compiling" = yes &&
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
if test -r "./contrib/kbipack/gmp_normal_form.h"; then
ac_cv_file___contrib_kbipack_gmp_normal_form_h=yes
else
ac_cv_file___contrib_kbipack_gmp_normal_form_h=no
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_file___contrib_kbipack_gmp_normal_form_h" >&5
echo "${ECHO_T}$ac_cv_file___contrib_kbipack_gmp_normal_form_h" >&6; }
if test $ac_cv_file___contrib_kbipack_gmp_normal_form_h = yes; then
KBIPACK="yes"
fi
if test "x${KBIPACK}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/kbipack"
GMSH_LIBS="${GMSH_LIBS} -lGmshKbi -lgmp"
cat >>confdefs.h <<\_ACEOF
#define HAVE_kbipack 1
_ACEOF
BO="${BO} kbipack"
fi
fi
fi fi
if test "x${OCC_PREFIX}" != "x"; then if test "x${OCC_PREFIX}" != "x"; then
......
...@@ -109,6 +109,9 @@ AC_ARG_ENABLE(tetgen, ...@@ -109,6 +109,9 @@ AC_ARG_ENABLE(tetgen,
AC_ARG_ENABLE(matheval, AC_ARG_ENABLE(matheval,
AC_HELP_STRING([--enable-matheval], AC_HELP_STRING([--enable-matheval],
[compile MathEval if available (default=yes)])) [compile MathEval if available (default=yes)]))
AC_ARG_ENABLE(kbipack,
AC_HELP_STRING([--enable-kbipack],
[compile kbipack if available (default=yes)]))
AC_ARG_ENABLE(gmm, AC_ARG_ENABLE(gmm,
AC_HELP_STRING([--enable-gmm], AC_HELP_STRING([--enable-gmm],
[use gmm++ if available (default=yes)])) [use gmm++ if available (default=yes)]))
...@@ -153,6 +156,7 @@ if test "x$enable_minimal" = "xyes"; then ...@@ -153,6 +156,7 @@ if test "x$enable_minimal" = "xyes"; then
enable_netgen=no; enable_netgen=no;
enable_tetgen=no; enable_tetgen=no;
enable_matheval=no; enable_matheval=no;
enable_kbipack=no;
enable_gmm=no; enable_gmm=no;
enable_ann=no; enable_ann=no;
enable_metis=no; enable_metis=no;
...@@ -501,6 +505,17 @@ if test "x$enable_contrib" != "xno"; then ...@@ -501,6 +505,17 @@ if test "x$enable_contrib" != "xno"; then
fi fi
fi fi
dnl Check for kbipack
if test "x$enable_kbipack" != "xno"; then
AC_CHECK_FILE(./contrib/kbipack/gmp_normal_form.h,KBIPACK="yes")
if test "x${KBIPACK}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/kbipack"
GMSH_LIBS="${GMSH_LIBS} -lGmshKbi -lgmp"
AC_DEFINE(HAVE_kbipack)
BO="${BO} kbipack"
fi
fi
fi fi
dnl Check for OpenCascade dnl Check for OpenCascade
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment