Commit 02ff3473 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

NULL replaced by nullptr and a lot of small changes

parent 0b697d70
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
# message(WARNING "the environment variable LIBRARY_PATH is set. this can lead to problems during linking. \n You can unset it in your CMakeLists.txt with the command unset(ENV{LIBRARY_PATH}).\n") # message(WARNING "the environment variable LIBRARY_PATH is set. this can lead to problems during linking. \n You can unset it in your CMakeLists.txt with the command unset(ENV{LIBRARY_PATH}).\n")
#endif() #endif()
################################################################## ##################################################################
#try to detect the AMDiS include directory
# try to detect the AMDiS include directory
# -------------------------------------------
find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_INCLUDE_DIR} ${AMDIS_DIR}/../../include/amdis/ /usr/include/amdis/) find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_INCLUDE_DIR} ${AMDIS_DIR}/../../include/amdis/ /usr/include/amdis/)
if(_AMDIS_H) if(_AMDIS_H)
get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE) get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
...@@ -38,32 +40,46 @@ else() ...@@ -38,32 +40,46 @@ else()
message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.") message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif() endif()
unset(_AMDIS_H CACHE) unset(_AMDIS_H CACHE)
set(MTL_DIR ${AMDIS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory") set(MTL_DIR @MTL_INCLUDE_DIR@ CACHE PATH "the mtl directory")
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${MTL_DIR})
if(WIN32) # AMDiS base libraries
set(LIBEXT lib) # --------------------
else()
set(LIBEXT so)
endif()
find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/ /usr/include/amdis) find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/ /usr/include/amdis)
if(_AMDIS_LIB) if(_AMDIS_LIB)
get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE) get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE)
set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR}) set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR})
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libmuparser.${LIBEXT}" CACHE STRING "amdis libraries") set(AMDIS_LIBRARIES "${_AMDIS_LIB}" CACHE STRING "amdis libraries")
else() else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library") message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library")
endif() endif()
unset(_AMDIS_LIB CACHE) unset(_AMDIS_LIB CACHE)
find_package(Boost 1.42 REQUIRED system iostreams filesystem program_options) # Boost libraries
# ---------------
if(WIN32)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.42 REQUIRED system iostreams filesystem program_options date_time zlib bzip2)
else()
set(Boost_USE_STATIC_LIBS OFF)
find_package(Boost 1.42 REQUIRED system iostreams filesystem program_options date_time)
endif()
if(Boost_FOUND) if(Boost_FOUND)
list(APPEND AMDIS_LIBRARIES ${Boost_LIBRARIES}) list(APPEND AMDIS_LIBRARIES ${Boost_LIBRARIES})
list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS}) list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
else()
message(ERROR "Boost libraries not found")
endif(Boost_FOUND) endif(Boost_FOUND)
# more libraries and include-directories added by default
# -------------------------------------------------------
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
# ------------------------------------------------------------------
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@) set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@) set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_OPENMP @ENABLE_OPENMP@) set(AMDIS_OPENMP @ENABLE_OPENMP@)
...@@ -95,6 +111,61 @@ if(AMDIS_OPENMP) ...@@ -95,6 +111,61 @@ if(AMDIS_OPENMP)
endif() endif()
endif(AMDIS_OPENMP) endif(AMDIS_OPENMP)
# AMDiS-Extensions library
# ------------------------
if(AMDIS_NEED_EXTENSIONS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/time)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/nanoflann)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/pugixml)
find_library(_EXTENSIONS_LIB extensions PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/)
if(_EXTENSIONS_LIB)
list(APPEND AMDIS_LIBRARIES ${_EXTENSIONS_LIB})
endif()
unset(_EXTENSIONS_LIB CACHE)
endif(AMDIS_NEED_EXTENSIONS)
# AMDiS BaseProblems libraries
# ----------------------------
if(AMDIS_NEED_BASE_PROBLEMS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/base_problems)
find_library(_BASE_PROBLEMS_LIB base_problems PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/)
if(_BASE_PROBLEMS_LIB)
list(APPEND AMDIS_LIBRARIES ${_BASE_PROBLEMS_LIB})
endif()
unset(_BASE_PROBLEMS_LIB CACHE)
endif(AMDIS_NEED_BASE_PROBLEMS)
# ----------------------------
find_library(_REINIT_LIB reinit PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/)
find_library(_COMPOSITE_FEM_LIB compositeFEM PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/)
find_library(_MUPARSER_LIB muparser PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/)
if(_REINIT_LIB)
list(APPEND AMDIS_LIBRARIES ${_REINIT_LIB})
else()
message(ERROR "Reinit library not found")
endif()
unset(_REINIT_LIB CACHE)
if(_COMPOSITE_FEM_LIB)
list(APPEND AMDIS_LIBRARIES ${_COMPOSITE_FEM_LIB})
else()
message(ERROR "CompositeFEM library not found")
endif()
unset(_COMPOSITE_FEM_LIB CACHE)
if(_MUPARSER_LIB)
list(APPEND AMDIS_LIBRARIES ${_MUPARSER_LIB})
else()
message(ERROR "MuParser library not found")
endif()
unset(_MUPARSER_LIB CACHE)
# ----------------------------
if(AMDIS_NEED_UMFPACK) if(AMDIS_NEED_UMFPACK)
set(AMDIS_UMFPACK_PATH @UMFPACK_PATH@) set(AMDIS_UMFPACK_PATH @UMFPACK_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_UMFPACK_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_UMFPACK_PATH})
...@@ -121,11 +192,11 @@ if(AMDIS_NEED_UMFPACK) ...@@ -121,11 +192,11 @@ if(AMDIS_NEED_UMFPACK)
list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARY}) list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARY})
list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR}) list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR})
else() else()
find_package(BLAS REQUIRED) find_package(BLAS)
if(BLAS_FOUND) if(BLAS_FOUND)
list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARIES}) list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARIES})
else() else()
message(FATAL_ERROR "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path") message(STATUS "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path")
endif() endif()
endif() endif()
endif("$ENV{BLA_VENDOR}" STREQUAL "ACML") endif("$ENV{BLA_VENDOR}" STREQUAL "ACML")
...@@ -207,6 +278,8 @@ return (0) ; ...@@ -207,6 +278,8 @@ return (0) ;
endif() endif()
endif(AMDIS_NEED_UMFPACK) endif(AMDIS_NEED_UMFPACK)
# PNG library
# -----------
if(AMDIS_NEED_PNG) if(AMDIS_NEED_PNG)
set(AMDIS_PNG_PATH @PNG_PATH@) set(AMDIS_PNG_PATH @PNG_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_PNG_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_PNG_PATH})
...@@ -221,6 +294,8 @@ if(AMDIS_NEED_PNG) ...@@ -221,6 +294,8 @@ if(AMDIS_NEED_PNG)
endif() endif()
endif(AMDIS_NEED_PNG) endif(AMDIS_NEED_PNG)
# BDDCML-library
# --------------
if(AMDIS_NEED_BDDCML) if(AMDIS_NEED_BDDCML)
set(AMDIS_BDDCML_PATH @BDDCML_PATH@) set(AMDIS_BDDCML_PATH @BDDCML_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH})
...@@ -232,34 +307,8 @@ if(AMDIS_NEED_BDDCML) ...@@ -232,34 +307,8 @@ if(AMDIS_NEED_BDDCML)
list(APPEND AMDIS_LIBRARIES ${AMDIS_BDDCML_LINK_LIST}) list(APPEND AMDIS_LIBRARIES ${AMDIS_BDDCML_LINK_LIST})
endif(AMDIS_NEED_BDDCML) endif(AMDIS_NEED_BDDCML)
if(AMDIS_NEED_EXTENSIONS) # Zoltan library
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions) # --------------
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/time)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/nanoflann)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/pugixml)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libextensions.${LIBEXT})
endif(AMDIS_NEED_EXTENSIONS)
if(AMDIS_NEED_BASE_PROBLEMS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/base_problems)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libbase_problems.${LIBEXT})
endif(AMDIS_NEED_BASE_PROBLEMS)
#add directories for reinit
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libcompositeFEM.${LIBEXT})
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libreinit.${LIBEXT})
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
if(NOT AMDIS_NEED_UMFPACK)
set(AMDIS_umfpack_FOUND FALSE)
message(SEND_ERROR "The selected amdis was not compiled with umfpack")
endif()
endif()
if(AMDIS_NEED_ZOLTAN) if(AMDIS_NEED_ZOLTAN)
find_library(ZOLTAN_LIB zoltan find_library(ZOLTAN_LIB zoltan
HINTS ENV LIBRARY_PATH HINTS ENV LIBRARY_PATH
...@@ -272,3 +321,10 @@ if(AMDIS_NEED_ZOLTAN) ...@@ -272,3 +321,10 @@ if(AMDIS_NEED_ZOLTAN)
endif() endif()
endif() endif()
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
if(NOT AMDIS_NEED_UMFPACK)
set(AMDIS_umfpack_FOUND FALSE)
message(SEND_ERROR "The selected amdis was not compiled with umfpack")
endif()
endif()
...@@ -414,6 +414,7 @@ if(ENABLE_EXTENSIONS) ...@@ -414,6 +414,7 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/BackgroundMesh.cc ${EXTENSIONS_DIR}/BackgroundMesh.cc
${EXTENSIONS_DIR}/GeometryTools.cc ${EXTENSIONS_DIR}/GeometryTools.cc
${EXTENSIONS_DIR}/POperators.cc ${EXTENSIONS_DIR}/POperators.cc
${EXTENSIONS_DIR}/SingularDirichletBC2.cc
${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc ${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc
${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp) ${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp)
...@@ -423,6 +424,14 @@ if(ENABLE_EXTENSIONS) ...@@ -423,6 +424,14 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/preconditioner/PetscPreconCahnHilliard.cc) ${EXTENSIONS_DIR}/preconditioner/PetscPreconCahnHilliard.cc)
endif(ENABLE_PETSC) endif(ENABLE_PETSC)
if(ENABLE_PARALLEL_DOMAIN)
list(APPEND EXTENSIONS_SRC
${EXTENSIONS_DIR}/preconditioner/PetscSolverNavierStokes2.cc
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc.cc
${EXTENSIONS_DIR}/preconditioner/PhaseFieldCrystal_.cc
${EXTENSIONS_DIR}/preconditioner/CahnHilliard_.cc)
endif(ENABLE_PARALLEL_DOMAIN)
list(APPEND COMPILEFLAGS "-DHAVE_EXTENSIONS=1") list(APPEND COMPILEFLAGS "-DHAVE_EXTENSIONS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR})
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/time) list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/time)
......
...@@ -31,7 +31,7 @@ namespace AMDiS { ...@@ -31,7 +31,7 @@ namespace AMDiS {
using namespace std; using namespace std;
#if defined(HAVE_PARALLEL_MTL4) #if defined(HAVE_PARALLEL_MTL4)
mtl::par::environment* mtl_environment = NULL; mtl::par::environment* mtl_environment = nullptr;
#endif #endif
void init(int argc, char **argv, std::string initFileName) void init(int argc, char **argv, std::string initFileName)
...@@ -44,7 +44,7 @@ namespace AMDiS { ...@@ -44,7 +44,7 @@ namespace AMDiS {
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) #if defined(HAVE_PARALLEL_DOMAIN_AMDIS)
Parallel::mpi::startRand(); Parallel::mpi::startRand();
#else #else
srand(time(NULL)); srand(time(0));
#endif #endif
#endif #endif
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <string> #include <string>
#include "AMDiS_fwd.h" #include "AMDiS_fwd.h"
#include "Global.h"
namespace AMDiS { namespace AMDiS {
...@@ -40,8 +41,8 @@ namespace AMDiS { ...@@ -40,8 +41,8 @@ namespace AMDiS {
AdaptBase(string sname, AdaptBase(string sname,
ProblemIterationInterface *problemIteration_, ProblemIterationInterface *problemIteration_,
AdaptInfo *adapt, AdaptInfo *adapt,
ProblemTimeInterface *problemTime_ = NULL, ProblemTimeInterface *problemTime_ = nullptr,
AdaptInfo *initialAdaptInfo_ = NULL) AdaptInfo *initialAdaptInfo_ = nullptr)
: name(sname), : name(sname),
problemIteration(problemIteration_), problemIteration(problemIteration_),
adaptInfo(adapt), adaptInfo(adapt),
......
...@@ -80,7 +80,7 @@ namespace AMDiS { ...@@ -80,7 +80,7 @@ namespace AMDiS {
fixedTimestep = (info->getMinTimestep() == info->getMaxTimestep()); fixedTimestep = (info->getMinTimestep() == info->getMaxTimestep());
if (initialTimestampSet == 0) if (initialTimestampSet == 0)
initialTimestamp = time(NULL); initialTimestamp = time(0);
else else
initialTimestamp = initialTimestampSet; initialTimestamp = initialTimestampSet;
...@@ -345,7 +345,7 @@ namespace AMDiS { ...@@ -345,7 +345,7 @@ namespace AMDiS {
} }
while (!adaptInfo->reachedEndTime()) { while (!adaptInfo->reachedEndTime()) {
iterationTimestamp = time(NULL); iterationTimestamp = time(0);
problemTime->initTimestep(adaptInfo); problemTime->initTimestep(adaptInfo);
oneTimestep(); oneTimestep();
...@@ -417,7 +417,7 @@ namespace AMDiS { ...@@ -417,7 +417,7 @@ namespace AMDiS {
return false; return false;
// Get the current time. // Get the current time.
time_t currentTimestamp = time(NULL); time_t currentTimestamp = time(0);
// Update list with the last iteration runtimes. // Update list with the last iteration runtimes.
lastIterationsDuration.push(currentTimestamp - iterationTimestamp); lastIterationsDuration.push(currentTimestamp - iterationTimestamp);
......
...@@ -91,7 +91,7 @@ namespace AMDiS { ...@@ -91,7 +91,7 @@ namespace AMDiS {
} }
/// Implementation of AdaptBase::adapt() /// Implementation of AdaptBase::adapt()
virtual int adapt(); int adapt() override;
/// Serialization /// Serialization
virtual void serialize(ostream &out); virtual void serialize(ostream &out);
......
...@@ -64,7 +64,7 @@ namespace AMDiS { ...@@ -64,7 +64,7 @@ namespace AMDiS {
virtual ~AdaptStationary() {} virtual ~AdaptStationary() {}
/// Implementation of AdaptBase::adapt() /// Implementation of AdaptBase::adapt()
virtual int adapt(); int adapt() override;
protected: protected:
/// Initialisation /// Initialisation
......
...@@ -44,8 +44,8 @@ namespace AMDiS { ...@@ -44,8 +44,8 @@ namespace AMDiS {
elementMatrix(nRow, nCol), elementMatrix(nRow, nCol),
elementVector(nRow), elementVector(nRow),
tmpMat(nRow, nCol), tmpMat(nRow, nCol),
lastMatEl(NULL), lastMatEl(nullptr),
lastVecEl(NULL), lastVecEl(nullptr),
lastTraverseId(-1) lastTraverseId(-1)
{} {}
...@@ -105,7 +105,7 @@ namespace AMDiS { ...@@ -105,7 +105,7 @@ namespace AMDiS {
rememberElMat = true; rememberElMat = true;
Element *el = smallElInfo->getElement(); Element *el = smallElInfo->getElement();
lastVecEl = lastMatEl = NULL; lastVecEl = lastMatEl = nullptr;
if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized())
initElement(smallElInfo, largeElInfo); initElement(smallElInfo, largeElInfo);
...@@ -426,8 +426,8 @@ namespace AMDiS { ...@@ -426,8 +426,8 @@ namespace AMDiS {
void Assembler::finishAssembling() void Assembler::finishAssembling()
{ {
lastVecEl = NULL; lastVecEl = nullptr;
lastMatEl = NULL; lastMatEl = nullptr;
} }
......
...@@ -57,7 +57,7 @@ namespace AMDiS { ...@@ -57,7 +57,7 @@ namespace AMDiS {
/// Constructor /// Constructor
Assembler(Operator *op, Assembler(Operator *op,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = NULL); const FiniteElemSpace *colFeSpace = nullptr);
/// Destructor /// Destructor
~Assembler(); ~Assembler();
...@@ -155,8 +155,8 @@ namespace AMDiS { ...@@ -155,8 +155,8 @@ namespace AMDiS {
/// Initialisation for the given ElInfo. The call is deligated to the sub assemblers. /// Initialisation for the given ElInfo. The call is deligated to the sub assemblers.
void initElement(const ElInfo *smallElInfo, void initElement(const ElInfo *smallElInfo,
const ElInfo *largeElInfo = NULL, const ElInfo *largeElInfo = nullptr,
Quadrature *quad = NULL); Quadrature *quad = nullptr);
/// Sets quadratures of all sub assemblers. /// Sets quadratures of all sub assemblers.
void setQuadratures(Quadrature *quad2, void setQuadratures(Quadrature *quad2,
...@@ -287,7 +287,7 @@ namespace AMDiS { ...@@ -287,7 +287,7 @@ namespace AMDiS {
Quadrature *quad1GrdPhi, Quadrature *quad1GrdPhi,
Quadrature *quad0, Quadrature *quad0,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = NULL); const FiniteElemSpace *colFeSpace = nullptr);
}; };
/** /**
...@@ -306,7 +306,7 @@ namespace AMDiS { ...@@ -306,7 +306,7 @@ namespace AMDiS {
Quadrature *quad1GrdPhi, Quadrature *quad1GrdPhi,
Quadrature *quad0, Quadrature *quad0,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = NULL); const FiniteElemSpace *colFeSpace = nullptr);
}; };
} }
......
...@@ -40,6 +40,12 @@ namespace AMDiS { ...@@ -40,6 +40,12 @@ namespace AMDiS {
BoundaryType newBound(BoundaryType oldBound, BoundaryType newBound); BoundaryType newBound(BoundaryType oldBound, BoundaryType newBound);
struct BoundaryTypeContainer
{
BoundaryTypeContainer(BoundaryType b) : b(b) {}
BoundaryType b;
};
} }
#endif #endif
...@@ -44,7 +44,7 @@ namespace AMDiS { ...@@ -44,7 +44,7 @@ namespace AMDiS {
/// Constructor. /// Constructor.
BoundaryCondition(BoundaryType type, BoundaryCondition(BoundaryType type,
const FiniteElemSpace *rowFeSpace_, const FiniteElemSpace *rowFeSpace_,
const FiniteElemSpace *colFeSpace_ = NULL) const FiniteElemSpace *colFeSpace_ = nullptr)
: boundaryType(type), : boundaryType(type),
rowFeSpace(rowFeSpace_), rowFeSpace(rowFeSpace_),
colFeSpace(colFeSpace_) colFeSpace(colFeSpace_)
......
...@@ -59,7 +59,7 @@ namespace AMDiS { ...@@ -59,7 +59,7 @@ namespace AMDiS {
FUNCNAME("BoundaryManager::addBoundaryCondition()"); FUNCNAME("BoundaryManager::addBoundaryCondition()");
BoundaryType type = localBC->getBoundaryType(); BoundaryType type = localBC->getBoundaryType();
TEST_EXIT(localBCs[type] == NULL) TEST_EXIT(localBCs[type] == nullptr)
("There is already a condition for this type %d.\n",type); ("There is already a condition for this type %d.\n",type);
localBCs[type] = localBC; localBCs[type] = localBC;
......
...@@ -28,7 +28,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p) ...@@ -28,7 +28,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p)
int n = A->getNumRows(); int n = A->getNumRows();
// Checking memory for vector P of diagonal elements of factorization. // Checking memory for vector P of diagonal elements of factorization.
static Vector<double> *pT = NULL; static Vector<double> *pT = nullptr;
if (p) if (p)
{ {
...@@ -99,7 +99,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, ...@@ -99,7 +99,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
x = new Vector<double>(n); x = new Vector<double>(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = NULL; static Vector<double> *pT = nullptr;
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
...@@ -153,7 +153,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b, ...@@ -153,7 +153,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
x = new Vector<WorldVector<double> >(n); x = new Vector<WorldVector<double> >(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = NULL; static Vector<double> *pT = nullptr;
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
......
...@@ -51,16 +51,16 @@ class Cholesky ...@@ -51,16 +51,16 @@ class Cholesky
/** \brief /** \brief
* Solves system A*X=B, where A is a positive definite matrix. * Solves system A*X=B, where A is a positive definite matrix.
* If P=NULL; A is assumed to be positive definite, and a Cholesky * If P=nullptr; A is assumed to be positive definite, and a Cholesky
* decomposition is computed using the previous routine. * decomposition is computed using the previous routine.
* If P is given, A and P are assumed to be already given as the output of * If P is given, A and P are assumed to be already given as the output of
* the previous routine. * the previous routine.
*/ */
static bool solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, static bool solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
Vector<double> *p = NULL); Vector<double> *p = nullptr);
static bool solve(Matrix<double> *A, Vector<WorldVector<double> > *b, static bool solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
Vector<WorldVector<double> > *x, Vector<WorldVector<double> > *x,
Vector<double> *p = NULL); Vector<double> *p = nullptr);
}; };