Skip to content
Snippets Groups Projects
Commit dd3f59bf authored by Anthony Royer's avatar Anthony Royer
Browse files

Merge branch 'make-petsc-optional' into 'master'

make petsc optional

See merge request !2
parents 45c0fbb8 39b9ddfc
No related branches found
No related tags found
1 merge request!2make petsc optional
Pipeline #4558 passed
......@@ -7,7 +7,6 @@ set(GMSHFEM_MINOR_VERSION 0)
set(GMSHFEM_PATCH_VERSION 0)
set(GMSHFEM_VERSION ${GMSHFEM_MAJOR_VERSION}.${GMSHFEM_MINOR_VERSION}.${GMSHFEM_PATCH_VERSION})
#----------------------------------
#
# M A C R O S
......@@ -17,21 +16,21 @@ set(GMSHFEM_VERSION ${GMSHFEM_MAJOR_VERSION}.${GMSHFEM_MINOR_VERSION}.${GMSHFEM_
macro(opt OPTION HELP VALUE)
option(ENABLE_${OPTION} ${HELP} ${VALUE})
set(OPT_TEXI "${OPT_TEXI}\n@item ENABLE_${OPTION}\n${HELP} (default: ${VALUE})")
endmacro(opt)
endmacro()
macro(append_gmshfem_src DIRNAME FILES)
foreach(FILE ${FILES})
list(APPEND LIST src/${DIRNAME}/${FILE})
endforeach(FILE)
endforeach()
set(GMSHFEM_SRC ${GMSHFEM_SRC};${LIST} PARENT_SCOPE)
set(GMSHFEM_DIRS ${GMSHFEM_DIRS};${DIRNAME} PARENT_SCOPE)
endmacro(append_gmshfem_src)
endmacro()
macro(set_config_option VARNAME STRING)
set(${VARNAME} TRUE)
list(APPEND CONFIG_OPTIONS ${STRING})
message(STATUS "Found " ${STRING})
endmacro(set_config_option)
endmacro()
macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
set(${VARNAME})
......@@ -39,19 +38,19 @@ macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
foreach(LIB ${${LISTNAME}})
if("${PATH}" STREQUAL "")
find_library(FOUND_LIB ${LIB} PATH_SUFFIXES ${SUFFIX})
else("${PATH}" STREQUAL "")
else()
find_library(FOUND_LIB ${LIB} PATHS ${PATH} NO_DEFAULT_PATH)
endif("${PATH}" STREQUAL "")
endif()
if(FOUND_LIB)
list(APPEND ${VARNAME} ${FOUND_LIB})
endif(FOUND_LIB)
endif()
unset(FOUND_LIB CACHE)
endforeach(LIB)
endforeach()
list(LENGTH ${VARNAME} NUM_FOUND_LIBRARIES)
if(NUM_FOUND_LIBRARIES LESS NUM_LIST)
set(${VARNAME})
endif(NUM_FOUND_LIBRARIES LESS NUM_LIST)
endmacro(find_all_libraries)
endif()
endmacro()
#----------------------------------
#
......@@ -81,6 +80,7 @@ opt(BOOST "Enable Boost library" ON)
opt(EIGEN_USE_BLAS "Use BLAS with Eigen" OFF)
opt(MPI "Enable MPI" OFF)
opt(OPENMP "Enable OpenMP" ON)
opt(PETSC "Enable PETSc" ON)
opt(PROFILE "Enable profile during the execution" OFF)
#----------------------------------
......@@ -108,8 +108,7 @@ include_directories(contrib/eigen/Eigen contrib/eigen/Eigen/src/Core/util/)
if(ENABLE_PROFILE)
add_subdirectory(src/Profile)
include_directories(src/Profile)
endif(ENABLE_PROFILE)
endif()
#----------------------------------
#
......@@ -117,40 +116,38 @@ endif(ENABLE_PROFILE)
#
#----------------------------------
####
# Mandatory libs
####
# GMSH (Mandatory)
# Gmsh (Mandatory)
find_library(GMSH_LIB gmsh)
if(NOT GMSH_LIB)
message(FATAL_ERROR "Could not find libgmsh")
endif(NOT GMSH_LIB)
endif()
find_path(GMSH_INC gmsh.h)
if(NOT GMSH_INC)
message(FATAL_ERROR "Could not find gmsh.h")
endif(NOT GMSH_INC)
endif()
set_config_option(HAVE_GMSH "Gmsh")
list(APPEND EXTRA_INCS ${GMSH_INC})
list(APPEND EXTRA_LIBS ${GMSH_LIB})
# PETSc (Mandatory)
# PETSc
if(ENABLE_PETSC)
if(PETSC_DIR)
set(ENV_PETSC_DIR ${PETSC_DIR})
else(PETSC_DIR)
else()
set(ENV_PETSC_DIR $ENV{PETSC_DIR})
endif(PETSC_DIR)
endif()
if(PETSC_ARCH)
set(ENV_PETSC_ARCH ${PETSC_ARCH})
else(PETSC_ARCH)
else()
set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
endif(PETSC_ARCH)
endif()
set(PETSC_POSSIBLE_CONF_FILES
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
......@@ -164,20 +161,21 @@ foreach(FILE ${PETSC_POSSIBLE_CONF_FILES})
message(STATUS "Using PETSc arch: ${ENV_PETSC_ARCH}")
# find includes by parsing the petscvariables file
file(STRINGS ${FILE} PETSC_VARIABLES NEWLINE_CONSUME)
endif(EXISTS ${FILE})
endforeach(FILE)
endif()
endforeach()
if(PETSC_VARIABLES)
# try to find PETSC_CC_INCLUDES for PETSc >= 3.4
string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES ${PETSC_VARIABLES})
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "PETSC_CC_INCLUDES = " "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
else(PETSC_PACKAGES_INCLUDES)
else()
# try to find PETSC_PACKAGES_INCLUDES in older versions
list(APPEND EXTRA_INCS ${ENV_PETSC_DIR}/include)
list(APPEND EXTRA_INCS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/include)
string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES ${PETSC_VARIABLES})
string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
endif(PETSC_PACKAGES_INCLUDES)
endif()
if(PETSC_PACKAGES_INCLUDES)
if(PETSC_PACKAGES_INCLUDES)
......@@ -185,9 +183,9 @@ if(PETSC_VARIABLES)
string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
foreach(VAR ${PETSC_PACKAGES_INCLUDES})
list(APPEND EXTRA_INCS ${VAR})
endforeach(VAR)
endif(PETSC_PACKAGES_INCLUDES)
endif(PETSC_PACKAGES_INCLUDES)
endforeach()
endif()
endif()
# find libraries (<= 3.0)
set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
......@@ -195,7 +193,7 @@ if(PETSC_VARIABLES)
# petsc 3.1 creates only one library (libpetsc)
if(NOT PETSC_LIBS)
find_library(PETSC_LIBS petsc PATHS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib NO_DEFAULT_PATH)
endif(NOT PETSC_LIBS)
endif()
list(APPEND EXTRA_LIBS ${PETSC_LIBS})
......@@ -204,21 +202,21 @@ if(PETSC_VARIABLES)
string(REPLACE "PACKAGES_LIBS = " "" PLIBS ${PLIBS})
string(STRIP ${PLIBS} PLIBS)
list(APPEND EXTRA_LIBS "${PLIBS}")
endif(PLIBS)
endif()
string(REGEX MATCH "PETSC_EXTERNAL_LIB_BASIC = [^\n\r]*" PLIBS_BASIC ${PETSC_VARIABLES})
if(PLIBS_BASIC)
string(REPLACE "PETSC_EXTERNAL_LIB_BASIC = " "" PLIBS_BASIC ${PLIBS_BASIC})
string(STRIP ${PLIBS_BASIC} PLIBS_BASIC)
list(APPEND EXTRA_LIBS "${PLIBS_BASIC}")
endif(PLIBS_BASIC)
endif()
string(REGEX MATCH "PCC_LINKER_LIBS = [^\n\r]*" LLIBS ${PETSC_VARIABLES})
if(LLIBS)
string(REPLACE "PCC_LINKER_LIBS = " "" LLIBS ${LLIBS})
string(STRIP ${LLIBS} LLIBS)
list(APPEND EXTRA_LIBS "${LLIBS}")
endif(LLIBS)
endif()
string(REGEX MATCH "PETSC_SCALAR = [^\n\r]*" SCALAR ${PETSC_VARIABLES})
if(SCALAR)
......@@ -228,8 +226,8 @@ if(PETSC_VARIABLES)
set_config_option(HAVE_COMPLEX "Scalar(complex)")
elseif(SCALAR STREQUAL "real")
set_config_option(HAVE_REAL "Scalar(real)")
endif(SCALAR STREQUAL "complex")
endif(SCALAR)
endif()
endif()
string(REGEX MATCH "PETSC_PRECISION = [^\n\r]*" PRECISION ${PETSC_VARIABLES})
if(PRECISION)
......@@ -238,10 +236,11 @@ if(PETSC_VARIABLES)
set_config_option(HAVE_FLOAT "Precision(float)")
elseif(PRECISION STREQUAL "double")
set_config_option(HAVE_DOUBLE "Precision(double)")
endif(PRECISION STREQUAL "single")
endif(PRECISION)
endif()
endif()
else()
else(PETSC_VARIABLES)
# new-style PETSc installations (in standard system directories)
find_library(PETSC_LIBS petsc)
find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc)
......@@ -249,14 +248,14 @@ else(PETSC_VARIABLES)
list(APPEND EXTRA_LIBS ${PETSC_LIBS})
list(APPEND EXTRA_INCS ${PETSC_INC})
set_config_option(HAVE_PETSC "PETSc")
endif(PETSC_LIBS AND PETSC_INC)
endif(PETSC_VARIABLES)
endif()
endif()
if(HAVE_PETSC)
list(APPEND EXTRA_LIBS ${PETSC_LIBS})
endif()
####
# Other libs
####
endif()
# Boost
......@@ -266,15 +265,15 @@ if(ENABLE_BOOST)
list(APPEND EXTRA_INCS ${Boost_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${Boost_LIBRARIES})
set_config_option(HAVE_BOOST "Boost")
endif(Boost_FOUND)
endif(ENABLE_BOOST)
endif()
endif()
# Eigen with BLAS
if(ENABLE_EIGEN_USE_BLAS)
add_definitions(-DEIGEN_USE_BLAS)
set_config_option(HAVE_EIGEN_USE_BLAS "BLAS(Eigen)")
endif(ENABLE_EIGEN_USE_BLAS)
endif()
# MPI
......@@ -297,20 +296,20 @@ if(ENABLE_OPENMP)
if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set_config_option(HAVE_OPENMP "OpenMP")
endif(OPENMP_FOUND)
endif()
if(APPLE AND EXISTS "/usr/local/opt/libomp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
list(APPEND EXTRA_LIBS "-L/usr/local/opt/libomp/lib -lomp")
set_config_option(HAVE_OPENMP "OpenMP")
endif()
endif(ENABLE_OPENMP)
endif()
# Profile
if(ENABLE_PROFILE)
set_config_option(HAVE_PROFILE "Profile")
endif(ENABLE_PROFILE)
endif()
#----------------------------------
#
......@@ -322,7 +321,7 @@ list(SORT CONFIG_OPTIONS)
set(GMSHFEM_CONFIG_OPTIONS "")
foreach(OPT ${CONFIG_OPTIONS})
set(GMSHFEM_CONFIG_OPTIONS "${GMSHFEM_CONFIG_OPTIONS} ${OPT}")
endforeach(OPT)
endforeach()
message(STATUS "")
message(STATUS "GmshFem ${GMSHFEM_MAJOR_VERSION}.${GMSHFEM_MINOR_VERSION}.${GMSHFEM_PATCH_VERSION} has been configured with")
......@@ -336,19 +335,19 @@ message(STATUS "")
string(TIMESTAMP DATE "%Y%m%d")
if(NOT DATE)
set(DATE "unknown")
endif(NOT DATE)
endif()
set(GMSHFEM_DATE "${DATE}")
execute_process(COMMAND hostname OUTPUT_VARIABLE HOSTNAME OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT HOSTNAME)
set(HOSTNAME "unknown")
endif(NOT HOSTNAME)
endif()
set(GMSHFEM_HOST "${HOSTNAME}")
execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PACKAGER)
set(PACKAGER "unknown")
endif(NOT PACKAGER)
endif()
string(REPLACE "\\" " " PACKAGER ${PACKAGER})
set(GMSHFEM_PACKAGER "${PACKAGER}")
......@@ -356,9 +355,9 @@ if(APPLE)
set(GMSHFEM_OS "macOS")
elseif(CYGWIN)
set(GMSHFEM_OS "Windows")
else(APPLE)
else()
set(GMSHFEM_OS "${CMAKE_SYSTEM_NAME}")
endif(APPLE)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Common/defines.h.in ${CMAKE_CURRENT_BINARY_DIR}/Common/defines.h)
......@@ -372,7 +371,7 @@ set(GMSHFEM_INC ${CMAKE_INSTALL_INCLUDEDIR}/gmshfem)
if(NOT APPLE)
set(CMAKE_SKIP_RPATH TRUE)
endif(NOT APPLE)
endif()
file(GLOB_RECURSE HEADERS src/Analytics/*.h src/Common/*.h src/Common/IO/*.h src/Dofs/*.h src/Domain/*.h src/Fields/*.h src/Functions/*.h src/Functions/ExecutionTree/*.h src/Post/*.h src/Problem/*.h src/Reorder/*.h src/System/*.h src/Terms/*.h ${CMAKE_CURRENT_BINARY_DIR}/Common/defines.h)
......@@ -387,7 +386,7 @@ install(FILES ${HEADERS} DESTINATION ${GMSHFEM_INC})
# binary
if(EXISTS src/main.cpp)
add_executable(gmshfem src/main.cpp)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
add_executable(gmshfem ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
target_link_libraries(gmshfem shared)
endif()
......@@ -5,13 +5,17 @@
#include "OmpInterface.h"
#include "OperationsMemory.h"
#include "Options.h"
#include "defines.h"
#ifdef HAVE_PROFILE
#include "Profiler.h"
#endif
#include "gmsh.h"
#include "petsc.h"
#ifdef HAVE_PETSC
#include "petsc.h"
#endif
namespace Common
{
......@@ -25,8 +29,10 @@ namespace Common
//Initialize gmsh
gmsh::initialize();
#ifdef HAVE_PETSC
//Initialize PETSc
PetscInitialize(&argc, &argv, nullptr, nullptr);
#endif
_argsManager.pre();
......@@ -56,7 +62,9 @@ namespace Common
delete Common::Options::instance();
delete Functions::FunctionMemory::instance();
gmsh::finalize();
#ifdef HAVE_PETSC
PetscFinalize();
#endif
}
void GmshFem::setVerbosity(const int verbose)
......
......@@ -2,6 +2,8 @@
#include "Vector.h"
#include <complex>
namespace Dofs
{
......
......@@ -17,7 +17,6 @@
#include "Vector.h"
#include "gmsh.h"
#include "petsc.h"
#include <algorithm>
#include <cstdint>
......
......@@ -19,7 +19,7 @@ namespace System
template< class T_Scalar >
Matrix< T_Scalar >::Matrix() :
_size(0), _options(""), _locks(), _matPetsc(), _havePetsc(false), _shouldBeDestroyedWithPetsc()
_size(0), _options(""), _locks(), _havePetsc(false), _shouldBeDestroyedWithPetsc()
{
#ifdef HAVE_PROFILE
_profilerLockEvents = new Profile::LockEvents("LockEvents");
......@@ -28,7 +28,7 @@ namespace System
template< class T_Scalar >
Matrix< T_Scalar >::Matrix(const unsigned int size, const std::string &options) :
_size(size), _options(options), _locks(size), _matPetsc(), _havePetsc(false), _shouldBeDestroyedWithPetsc()
_size(size), _options(options), _locks(size), _havePetsc(false), _shouldBeDestroyedWithPetsc()
{
#ifdef HAVE_PROFILE
_profilerLockEvents = new Profile::LockEvents("LockEvents");
......@@ -63,6 +63,7 @@ namespace System
template< class T_Scalar >
void Matrix< T_Scalar >::removePetsc()
{
#ifdef HAVE_PETSC
if(_havePetsc) {
MatDestroy(&_matPetsc);
for(unsigned int i = 0; i < _shouldBeDestroyedWithPetsc.size(); ++i) {
......@@ -70,6 +71,7 @@ namespace System
}
_shouldBeDestroyedWithPetsc.clear();
}
#endif
_havePetsc = false;
}
......@@ -85,11 +87,13 @@ namespace System
return _havePetsc;
}
#ifdef HAVE_PETSC
template< class T_Scalar >
Mat Matrix< T_Scalar >::getPetsc() const
{
return _matPetsc;
}
#endif
template< class T_Scalar >
unsigned int Matrix< T_Scalar >::size() const
......
......@@ -7,7 +7,9 @@
#include "defines.h"
#include "optionsEnums.h"
#ifdef HAVE_PETSC
#include "petsc.h"
#endif
#include <vector>
......@@ -36,8 +38,10 @@ namespace System
unsigned int _size;
System::MatrixOptions _options;
std::vector< Omp::Lock > _locks;
#ifdef HAVE_PETSC
//Petsc
Mat _matPetsc;
#endif
bool _havePetsc;
std::vector< void * > _shouldBeDestroyedWithPetsc;
......@@ -66,8 +70,9 @@ namespace System
const Problem::IndicesTypes *const indexJ) = 0;
bool havePetsc() const;
#ifdef HAVE_PETSC
Mat getPetsc() const;
#endif
unsigned int size() const;
virtual unsigned int numberOfNonZero() const = 0;
double sparsity() const;
......
......@@ -3,6 +3,7 @@
#include "CSVio.h"
#include "Exception.h"
#include "PetscInterface.h"
#include "defines.h"
namespace System
{
......@@ -76,10 +77,7 @@ namespace System
template< class T_Scalar >
void MatrixCOO< T_Scalar >::assemblePetsc()
{
#ifndef HAVE_PETSC
throw Exc::Exception("GmshFem is not compile with PETSc.",
Common::Exc::Error);
#endif // HAVE_PETSC
#ifdef HAVE_PETSC
unsigned int *ai =
(unsigned int *)std::malloc((this->_size + 1) * sizeof(unsigned int));
unsigned int *aj =
......@@ -121,6 +119,7 @@ namespace System
this->_shouldBeDestroyedWithPetsc.push_back(a);
this->_havePetsc = true;
#endif
}
template< class T_Scalar >
......
#include "MatrixCRS.h"
#include "defines.h"
#include "CSVio.h"
#include "Exception.h"
#include "PetscInterface.h"
......@@ -168,15 +168,13 @@ namespace System
template< class T_Scalar >
void MatrixCRS< T_Scalar >::assemblePetsc()
{
#ifndef HAVE_PETSC
throw Exc::Exception("GmshFem is not compile with PETSc.",
Common::Exc::Error);
#endif // HAVE_PETSC
#ifdef HAVE_PETSC
PetscInterface< T_Scalar, PetscScalar > interface;
interface(this->_size, _ai, _aj, _a, &this->_matPetsc,
this->_shouldBeDestroyedWithPetsc);
this->_havePetsc = true;
#endif
}
template< class T_Scalar >
......
#ifndef H_PETSCINTERFACE
#define H_PETSCINTERFACE
#include "defines.h"
#ifdef HAVE_PETSC
#include "Message.h"
#include "OmpInterface.h"
#include "Scalar.h"
......@@ -420,4 +424,6 @@ namespace System
} // namespace System
#endif
#endif // H_PETSCINTERFACE
......@@ -16,9 +16,11 @@ namespace System
template< class T_Scalar >
Solver< T_Scalar >::Solver(Matrix< T_Scalar > *const A, Vector< T_Scalar > *const b, Dofs::DofsManager< T_Scalar > *const dofs) :
_ksp(), _A(A), _b(b), _dofs(dofs), _residual(0.)
_A(A), _b(b), _dofs(dofs), _residual(0.)
{
#ifdef HAVE_PETSC
KSPCreate(PETSC_COMM_SELF, &_ksp);
#endif
}
template< class T_Scalar >
......@@ -28,7 +30,9 @@ namespace System
_b = nullptr;
_dofs = nullptr;
_residual = 0.;
#ifdef HAVE_PETSC
KSPDestroy(&_ksp);
#endif
}
template< class T_Scalar >
......@@ -36,7 +40,7 @@ namespace System
{
Common::Timer time;
time.tick();
#ifdef HAVE_PETSC
PC pc;
KSPSetReusePreconditioner(_ksp, reusePreconditioner ? PETSC_TRUE : PETSC_FALSE);
KSPSetOperators(_ksp, _A->getPetsc(), _A->getPetsc());
......@@ -77,7 +81,7 @@ namespace System
VecDestroy(&sol);
_dofs->setValues(values);
#endif
time.tock();
return time;
......
......@@ -3,8 +3,11 @@
#include "Scalar.h"
#include "Timer.h"
#include "defines.h"
#ifdef HAVE_PETSC
#include "petsc.h"
#endif
#include <vector>
......@@ -31,7 +34,9 @@ namespace System
class Solver
{
private:
#ifdef HAVE_PETSC
KSP _ksp;
#endif
Matrix< T_Scalar > *_A;
Vector< T_Scalar > *_b;
Dofs::DofsManager< T_Scalar > *_dofs;
......
......@@ -74,6 +74,7 @@ namespace System
template< class T_Scalar >
void Vector< T_Scalar >::removePetsc()
{
#ifdef HAVE_PETSC
if(_havePetsc) {
VecDestroy(&_vecPetsc);
for(unsigned int i = 0; i < _shouldBeDestroyedWithPetsc.size(); ++i) {
......@@ -81,6 +82,7 @@ namespace System
}
_shouldBeDestroyedWithPetsc.clear();
}
#endif
_havePetsc = false;
}
......@@ -97,14 +99,12 @@ namespace System
template< class T_Scalar >
void Vector< T_Scalar >::assemblePetsc()
{
#ifndef HAVE_PETSC
throw Exc::Exception("GmshFem is not compile with PETSc.",
Common::Exc::Error);
#endif // HAVE_PETSC
#ifdef HAVE_PETSC
PetscInterface< T_Scalar, PetscScalar > interface;
interface(_size, &_vec[0], &_vecPetsc, _shouldBeDestroyedWithPetsc);
_havePetsc = true;
#endif
}
template< class T_Scalar >
......@@ -179,11 +179,13 @@ namespace System
return _havePetsc;
}
#ifdef HAVE_PETSC
template< class T_Scalar >
Vec Vector< T_Scalar >::getPetsc() const
{
return _vecPetsc;
}
#endif
template< class T_Scalar >
unsigned int Vector< T_Scalar >::size() const
......
#ifndef H_VECTOR
#define H_VECTOR
#include "defines.h"
#include "OmpInterface.h"
#ifdef HAVE_PETSC
#include "petsc.h"
#endif
#include <string>
#include <vector>
......@@ -31,8 +34,10 @@ namespace System
std::vector< T_Scalar > _vec;
std::vector< T_Scalar > _valuesDC;
Omp::Lock _lock;
#ifdef HAVE_PETSC
//Petsc
Vec _vecPetsc;
#endif
bool _havePetsc;
std::vector< void * > _shouldBeDestroyedWithPetsc;
......@@ -63,8 +68,9 @@ namespace System
bool havePetsc() const;
#ifdef HAVE_PETSC
Vec getPetsc() const;
#endif
unsigned int size() const;
void concatenate(const Vector< T_Scalar > &other);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment