Commit 9c5daa06 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Some more or less important changes

parent edb60cbf
...@@ -19,7 +19,8 @@ if USE_PARALLEL_AMDIS ...@@ -19,7 +19,8 @@ if USE_PARALLEL_AMDIS
$(PARALLEL_DIR)/ParallelDomainProblem.h $(PARALLEL_DIR)/ParallelDomainProblem.cc \ $(PARALLEL_DIR)/ParallelDomainProblem.h $(PARALLEL_DIR)/ParallelDomainProblem.cc \
$(PARALLEL_DIR)/ParMetisPartitioner.h $(PARALLEL_DIR)/ParMetisPartitioner.cc \ $(PARALLEL_DIR)/ParMetisPartitioner.h $(PARALLEL_DIR)/ParMetisPartitioner.cc \
$(PARALLEL_DIR)/PartitionElementData.h $(PARALLEL_DIR)/PartitionElementData.h
PARALLEL_INCLUDES = -I$(MPI_DIR)/include -I$(PARMETIS_DIR) PARALLEL_INCLUDES = -I/work/home7/witkowsk/local/include \
-I$(MPI_DIR)/include -I$(PARMETIS_DIR)
else else
PARALLEL_AMDIS_SOURCES = PARALLEL_AMDIS_SOURCES =
PARALLEL_INCLUDES = PARALLEL_INCLUDES =
...@@ -27,6 +28,10 @@ endif ...@@ -27,6 +28,10 @@ endif
libamdis_la_CXXFLAGS = libamdis_la_CXXFLAGS =
if USE_PARALLEL_AMDIS
libamdis_la_CXXFLAGS += -DHAVE_PARALLEL_AMDIS=1
endif
if ENABLE_UMFPACK if ENABLE_UMFPACK
libamdis_la_CXXFLAGS += -DHAVE_UMFPACK=1 libamdis_la_CXXFLAGS += -DHAVE_UMFPACK=1
AMDIS_INCLUDES += -I$(LIB_DIR)/UFconfig \ AMDIS_INCLUDES += -I$(LIB_DIR)/UFconfig \
......
...@@ -36,17 +36,18 @@ PRE_UNINSTALL = : ...@@ -36,17 +36,18 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
@ENABLE_UMFPACK_TRUE@am__append_1 = -DHAVE_UMFPACK=1 @USE_PARALLEL_AMDIS_TRUE@am__append_1 = -DHAVE_PARALLEL_AMDIS=1
@ENABLE_UMFPACK_TRUE@am__append_2 = -I$(LIB_DIR)/UFconfig \ @ENABLE_UMFPACK_TRUE@am__append_2 = -DHAVE_UMFPACK=1
@ENABLE_UMFPACK_TRUE@am__append_3 = -I$(LIB_DIR)/UFconfig \
@ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/AMD/Include \ @ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/AMD/Include \
@ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/UMFPACK/Include @ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/UMFPACK/Include
@ENABLE_MKL_TRUE@am__append_3 = -DHAVE_MKL=1 -I${MKL_INC} @ENABLE_MKL_TRUE@am__append_4 = -DHAVE_MKL=1 -I${MKL_INC}
@ENABLE_DUNE_TRUE@am__append_4 = -DHAVE_DUNE=1 @ENABLE_DUNE_TRUE@am__append_5 = -DHAVE_DUNE=1
@ENABLE_DUNE_TRUE@am__append_5 = -I$(DUNE_DIR) @ENABLE_DUNE_TRUE@am__append_6 = -I$(DUNE_DIR)
@ENABLE_BOOST_TRUE@am__append_6 = -DHAVE_BOOST=1 @ENABLE_BOOST_TRUE@am__append_7 = -DHAVE_BOOST=1
@AMDIS_DEBUG_TRUE@am__append_7 = -g -O0 -Wall -DDEBUG=1 $(OPENMP_FLAG) -ftemplate-depth-30 $(INCLUDES) #-pedantic @AMDIS_DEBUG_TRUE@am__append_8 = -g -O0 -Wall -DDEBUG=1 $(OPENMP_FLAG) -ftemplate-depth-30 $(INCLUDES) #-pedantic
@AMDIS_DEBUG_FALSE@am__append_8 = -O2 -Wall -DDEBUG=0 $(OPENMP_FLAG) -ftemplate-depth-30 $(INCLUDES) #-pedantic @AMDIS_DEBUG_FALSE@am__append_9 = -O2 -Wall -DDEBUG=0 $(OPENMP_FLAG) -ftemplate-depth-30 $(INCLUDES) #-pedantic
subdir = bin subdir = bin
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
...@@ -484,7 +485,7 @@ SOURCE_DIR = ../src ...@@ -484,7 +485,7 @@ SOURCE_DIR = ../src
LIB_DIR = ../lib LIB_DIR = ../lib
PARALLEL_DIR = $(SOURCE_DIR) PARALLEL_DIR = $(SOURCE_DIR)
PARMETIS_DIR = ../lib/ParMetis-3.1 PARMETIS_DIR = ../lib/ParMetis-3.1
AMDIS_INCLUDES = -I$(SOURCE_DIR) $(am__append_2) $(am__append_5) AMDIS_INCLUDES = -I$(SOURCE_DIR) $(am__append_3) $(am__append_6)
@USE_PARALLEL_AMDIS_FALSE@PARALLEL_AMDIS_SOURCES = @USE_PARALLEL_AMDIS_FALSE@PARALLEL_AMDIS_SOURCES =
@USE_PARALLEL_AMDIS_TRUE@PARALLEL_AMDIS_SOURCES = \ @USE_PARALLEL_AMDIS_TRUE@PARALLEL_AMDIS_SOURCES = \
@USE_PARALLEL_AMDIS_TRUE@ $(PARALLEL_DIR)/ConditionalEstimator.h $(PARALLEL_DIR)/ConditionalEstimator.cc \ @USE_PARALLEL_AMDIS_TRUE@ $(PARALLEL_DIR)/ConditionalEstimator.h $(PARALLEL_DIR)/ConditionalEstimator.cc \
...@@ -498,9 +499,12 @@ AMDIS_INCLUDES = -I$(SOURCE_DIR) $(am__append_2) $(am__append_5) ...@@ -498,9 +499,12 @@ AMDIS_INCLUDES = -I$(SOURCE_DIR) $(am__append_2) $(am__append_5)
@USE_PARALLEL_AMDIS_TRUE@ $(PARALLEL_DIR)/PartitionElementData.h @USE_PARALLEL_AMDIS_TRUE@ $(PARALLEL_DIR)/PartitionElementData.h
@USE_PARALLEL_AMDIS_FALSE@PARALLEL_INCLUDES = @USE_PARALLEL_AMDIS_FALSE@PARALLEL_INCLUDES =
@USE_PARALLEL_AMDIS_TRUE@PARALLEL_INCLUDES = -I$(MPI_DIR)/include -I$(PARMETIS_DIR) @USE_PARALLEL_AMDIS_TRUE@PARALLEL_INCLUDES = -I/work/home7/witkowsk/local/include \
libamdis_la_CXXFLAGS = $(am__append_1) $(am__append_3) $(am__append_4) \ @USE_PARALLEL_AMDIS_TRUE@ -I$(MPI_DIR)/include -I$(PARMETIS_DIR)
$(am__append_6) $(am__append_7) $(am__append_8)
libamdis_la_CXXFLAGS = $(am__append_1) $(am__append_2) $(am__append_4) \
$(am__append_5) $(am__append_7) $(am__append_8) \
$(am__append_9)
INCLUDES = $(AMDIS_INCLUDES) $(PARALLEL_INCLUDES) INCLUDES = $(AMDIS_INCLUDES) $(PARALLEL_INCLUDES)
libamdis_la_SOURCES = \ libamdis_la_SOURCES = \
$(PARALLEL_AMDIS_SOURCES) \ $(PARALLEL_AMDIS_SOURCES) \
......
...@@ -44,7 +44,7 @@ available_tags=" CXX F77" ...@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG # ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host p2s148: # Libtool was configured on host p2s256:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` ...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End: # End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX # ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host p2s148: # Libtool was configured on host p2s256:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -7065,7 +7065,7 @@ include_expsyms="" ...@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77 # ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host p2s148: # Libtool was configured on host p2s256:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
......
...@@ -55,27 +55,19 @@ namespace AMDiS { ...@@ -55,27 +55,19 @@ namespace AMDiS {
public: public:
MEMORY_MANAGED(AdaptStationary); MEMORY_MANAGED(AdaptStationary);
/** \brief /// Creates a AdaptStationary object with given name.
* Creates a AdaptStationary object with given name.
*/
AdaptStationary(const std::string &name, AdaptStationary(const std::string &name,
ProblemIterationInterface *prob, ProblemIterationInterface *prob,
AdaptInfo *info); AdaptInfo *info);
/** \brief /// Destructor
* Destructor
*/
virtual ~AdaptStationary() {} virtual ~AdaptStationary() {}
/** \brief /// Implementation of AdaptBase::adapt()
* Implementation of AdaptBase::adapt()
*/
virtual int adapt(); virtual int adapt();
protected: protected:
/** \brief /// Initialisation
* Initialisation
*/
void initialize(); void initialize();
}; };
......
...@@ -47,6 +47,10 @@ namespace AMDiS { ...@@ -47,6 +47,10 @@ namespace AMDiS {
colFESpace->getBasisFcts()->getNumber()); colFESpace->getBasisFcts()->getNumber());
applyDBCs.clear(); applyDBCs.clear();
#ifdef HAVE_PARALLEL_AMDIS
applicationOrdering = NULL;
#endif
} }
DOFMatrix::DOFMatrix(const DOFMatrix& rhs) DOFMatrix::DOFMatrix(const DOFMatrix& rhs)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <set> #include <set>
#include <memory> #include <memory>
#include <list> #include <list>
#include "Global.h" #include "Global.h"
#include "Flag.h" #include "Flag.h"
#include "RCNeighbourList.h" #include "RCNeighbourList.h"
...@@ -40,6 +41,10 @@ ...@@ -40,6 +41,10 @@
#include "Boundary.h" #include "Boundary.h"
#include "Serializable.h" #include "Serializable.h"
#ifdef HAVE_PARALLEL_AMDIS
#include "petscao.h"
#endif
namespace AMDiS { namespace AMDiS {
// ============================================================================ // ============================================================================
...@@ -420,23 +425,17 @@ namespace AMDiS { ...@@ -420,23 +425,17 @@ namespace AMDiS {
return rowFESpace; return rowFESpace;
} }
/** \brief /// Returns const \ref colFESpace
* Returns const \ref colFESpace
*/
const FiniteElemSpace* getColFESpace() const { const FiniteElemSpace* getColFESpace() const {
return colFESpace; return colFESpace;
} }
/** \brief /// Returns const \ref rowFESpace
* Returns const \ref rowFESpace
*/
const FiniteElemSpace* getFESpace() const { const FiniteElemSpace* getFESpace() const {
return rowFESpace; return rowFESpace;
} }
/** \brief /// Returns number of rows (\ref matrix.size())
* Returns number of rows (\ref matrix.size())
*/
inline int getSize() const { inline int getSize() const {
return matrix.size(); return matrix.size();
} }
...@@ -455,58 +454,44 @@ namespace AMDiS { ...@@ -455,58 +454,44 @@ namespace AMDiS {
*/ */
int getNumCols() const; int getNumCols() const;
/** \brief /// Returns \ref name
* Returns \ref name
*/
inline const std::string& getName() const { inline const std::string& getName() const {
return name; return name;
} }
/** \brief /// Resizes \ref matrix to n rows
* Resizes \ref matrix to n rows
*/
inline void resize(int n) { inline void resize(int n) {
TEST_EXIT_DBG(n >= 0)("Can't resize DOFMatrix to negative size\n"); TEST_EXIT_DBG(n >= 0)("Can't resize DOFMatrix to negative size\n");
matrix.resize(n); matrix.resize(n);
} }
/** \brief /// Returns \ref matrix[i] which is the i-th row
* Returns \ref matrix[i] which is the i-th row
*/
inline const std::vector<MatEntry>& operator[](int i) const { inline const std::vector<MatEntry>& operator[](int i) const {
TEST_EXIT_DBG((i >= 0) && (i < (static_cast<int>(matrix.size())))) TEST_EXIT_DBG((i >= 0) && (i < (static_cast<int>(matrix.size()))))
("Illegal matrix index %d.\n",i); ("Illegal matrix index %d.\n",i);
return matrix[i]; return matrix[i];
} }
/** \brief /// Returns \ref matrix[i] which is the i-th row
* Returns \ref matrix[i] which is the i-th row
*/
inline std::vector<MatEntry>& operator[](int i) { inline std::vector<MatEntry>& operator[](int i) {
TEST_EXIT_DBG((i >= 0) && (i < (static_cast<int>(matrix.size())))) TEST_EXIT_DBG((i >= 0) && (i < (static_cast<int>(matrix.size()))))
("Illegal vector index %d.\n", i); ("Illegal vector index %d.\n", i);
return matrix[i]; return matrix[i];
} }
/** \brief /// Access to \ref matrix[a][b].entry
* Access to \ref matrix[a][b].entry
*/
inline double physAcc(DegreeOfFreedom a, DegreeOfFreedom b) const { inline double physAcc(DegreeOfFreedom a, DegreeOfFreedom b) const {
return matrix[a][b].entry; return matrix[a][b].entry;
} }
/** \brief /// Access to \ref matrix[a][b].col
* Access to \ref matrix[a][b].col
*/
inline DegreeOfFreedom physToLogIndex(DegreeOfFreedom a, inline DegreeOfFreedom physToLogIndex(DegreeOfFreedom a,
DegreeOfFreedom b) const DegreeOfFreedom b) const
{ {
return matrix[a][b].col; return matrix[a][b].col;
} }
/** \brief /// Returns physical column index of logical index b in row a
* Returns physical column index of logical index b in row a
*/
inline DegreeOfFreedom logToPhysIndex(DegreeOfFreedom a, DegreeOfFreedom b) const inline DegreeOfFreedom logToPhysIndex(DegreeOfFreedom a, DegreeOfFreedom b) const
{ {
int size = static_cast<int>(matrix[a].size()); int size = static_cast<int>(matrix[a].size());
...@@ -517,19 +502,13 @@ namespace AMDiS { ...@@ -517,19 +502,13 @@ namespace AMDiS {
return -1; return -1;
} }
/** \brief /// Returns value at logical indices a,b
* Returns value at logical indices a,b
*/
double logAcc(DegreeOfFreedom a, DegreeOfFreedom b) const; double logAcc(DegreeOfFreedom a, DegreeOfFreedom b) const;
/** \brief /// Changes col at logical indices a,b to c
* Changes col at logical indices a,b to c
*/
void changeColOfEntry(DegreeOfFreedom a, DegreeOfFreedom b, DegreeOfFreedom c); void changeColOfEntry(DegreeOfFreedom a, DegreeOfFreedom b, DegreeOfFreedom c);
/** \brief /// Changes col of \ref matrix[a][b] to c
* Changes col of \ref matrix[a][b] to c
*/
inline void changePhysColOfEntry(DegreeOfFreedom a, inline void changePhysColOfEntry(DegreeOfFreedom a,
DegreeOfFreedom b, DegreeOfFreedom b,
DegreeOfFreedom c) DegreeOfFreedom c)
...@@ -565,24 +544,16 @@ namespace AMDiS { ...@@ -565,24 +544,16 @@ namespace AMDiS {
void removeRowsWithDBC(std::set<int> *rows); void removeRowsWithDBC(std::set<int> *rows);
/** \brief /// Prints \ref matrix to stdout
* Prints \ref matrix to stdout
*/
void print() const; void print() const;
/** \brief /// Prints a row of \ref matrix to stdout
* Prints a row of \ref matrix to stdout
*/
void printRow(int i) const; void printRow(int i) const;
/** \brief /// Removes all matrix entries
* Removes all matrix entries
*/
void clear(); void clear();
/** \brief /// Test whether \ref matrix is symmetric. Exits if not.
* Test whether \ref matrix is symmetric. Exits if not.
*/
void test(); void test();
bool symmetric(); bool symmetric();
...@@ -612,9 +583,7 @@ namespace AMDiS { ...@@ -612,9 +583,7 @@ namespace AMDiS {
} }
void createPictureFile(const char* filename, int dim); void createPictureFile(const char* filename, int dim);
// ===== Serializable implementation =====
void serialize(std::ostream &out) void serialize(std::ostream &out)
{ {
unsigned int matrixSize = matrix.size(); unsigned int matrixSize = matrix.size();
...@@ -640,13 +609,15 @@ namespace AMDiS { ...@@ -640,13 +609,15 @@ namespace AMDiS {
} }
} }
///
int memsize(); int memsize();
protected: #ifdef HAVE_PARALLEL_AMDIS
/** \brief /// Sets the petsc application ordering object to map dof indices.
* Used by updateMatrix void useApplicationOrdering(AO *ao) {
*/ applicationOrdering = ao;
//static int assembleFct(ElInfo *el_info); }
#endif
protected: protected:
/** \brief /** \brief
...@@ -661,19 +632,13 @@ namespace AMDiS { ...@@ -661,19 +632,13 @@ namespace AMDiS {
*/ */
const FiniteElemSpace *colFESpace; const FiniteElemSpace *colFESpace;
/** \brief /// Name of the DOFMatrix
* Name of the DOFMatrix
*/
std::string name; std::string name;
/** \brief /// Sparse matrix stored in an STL vector of MatrixRow objects
* Sparse matrix stored in an STL vector of MatrixRow objects
*/
std::vector<MatrixRow> matrix; std::vector<MatrixRow> matrix;
/** \brief /// Used while mesh traversal
* Used while mesh traversal
*/
static DOFMatrix *traversePtr; static DOFMatrix *traversePtr;
/** \brief /** \brief
...@@ -688,28 +653,26 @@ namespace AMDiS { ...@@ -688,28 +653,26 @@ namespace AMDiS {
*/ */
std::vector<double*> operatorFactor; std::vector<double*> operatorFactor;
/** \brief ///
*
*/
std::vector<double*> operatorEstFactor; std::vector<double*> operatorEstFactor;
/** \brief ///
*
*/
BoundaryManager *boundaryManager; BoundaryManager *boundaryManager;
/** \brief ///
*
*/
bool coupleMatrix; bool coupleMatrix;
/** \brief /// Temporary variable used in assemble()
* Temporary variable used in assemble()
*/
ElementMatrix *elementMatrix; ElementMatrix *elementMatrix;
///
std::set<int> applyDBCs; std::set<int> applyDBCs;
#ifdef HAVE_PARALLEL_AMDIS
/// Petsc application ordering to map dof indices.
AO *applicationOrdering;
#endif
friend class DOFAdmin; friend class DOFAdmin;
friend class DOFVector<double>; friend class DOFVector<double>;
friend class DOFVector<unsigned char>; friend class DOFVector<unsigned char>;
...@@ -718,7 +681,8 @@ namespace AMDiS { ...@@ -718,7 +681,8 @@ namespace AMDiS {
}; };
inline DegreeOfFreedom logToPhysIndex(DOFMatrix *m, DegreeOfFreedom a, DegreeOfFreedom b) inline DegreeOfFreedom logToPhysIndex(DOFMatrix *m,
DegreeOfFreedom a, DegreeOfFreedom b)
{ {
return m->logToPhysIndex(a, b); return m->logToPhysIndex(a, b);
} }
...@@ -729,16 +693,11 @@ namespace AMDiS { ...@@ -729,16 +693,11 @@ namespace AMDiS {
double max(std::vector<MatEntry> *row); double max(std::vector<MatEntry> *row);
/** \brief /// Addes two matrices. The result matrix is overwritten.
* Addes two matrices. The result matrix is overwritten.
*/
void addDOFMatrix(DOFMatrix *result, const DOFMatrix *a, const DOFMatrix *b); void addDOFMatrix(DOFMatrix *result, const DOFMatrix *a, const DOFMatrix *b);
/** \brief /// Addes matrix a to matrix result.
* Addes matrix a to matrix result.
*/
void addDOFMatrix(DOFMatrix *result, const DOFMatrix *a); void addDOFMatrix(DOFMatrix *result, const DOFMatrix *a);
} }
#endif // AMDIS_DOFMATRIX_H #endif // AMDIS_DOFMATRIX_H
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
// ===== includes ============================================================ // ===== includes ============================================================
// =========================================================================== // ===========================================================================
#include <vector>
#include <memory>
#include <list>
#include "FixVec.h" #include "FixVec.h"
#include "Global.h" #include "Global.h"
#include "Flag.h" #include "Flag.h"
...@@ -39,9 +43,10 @@ ...@@ -39,9 +43,10 @@
#include "Serializable.h" #include "Serializable.h"
#include "DOFMatrix.h" #include "DOFMatrix.h"
#include "BasisFunction.h" #include "BasisFunction.h"
#include <vector>
#include <memory> #ifdef HAVE_PARALLEL_AMDIS
#include <list> #include "petscao.h"
#endif
namespace AMDiS { namespace AMDiS {
...@@ -584,24 +589,16 @@ namespace AMDiS { ...@@ -584,24 +589,16 @@ namespace AMDiS {
*/ */
T max() const; T max() const;