Commit eca1f8a2 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

modularity

parent 72eb82d5
Pipeline #429 failed with stage
in 24 minutes and 19 seconds
...@@ -9,7 +9,6 @@ endif() ...@@ -9,7 +9,6 @@ endif()
enable_language(C) enable_language(C)
enable_language(CXX) enable_language(CXX)
enable_testing() enable_testing()
option(ENABLE_PROJ "Enable PROJ" ON)
option(ENABLE_PETSC "Enable PETSc" ON) option(ENABLE_PETSC "Enable PETSc" ON)
option(ENABLE_PETSC4PY "Enable PETSc4Py" ON) option(ENABLE_PETSC4PY "Enable PETSc4Py" ON)
...@@ -82,63 +81,12 @@ if(ENABLE_PETSC) ...@@ -82,63 +81,12 @@ if(ENABLE_PETSC)
endif(PETSC_FOUND) endif(PETSC_FOUND)
endif(ENABLE_PETSC) endif(ENABLE_PETSC)
macro(dg_set_module_option VARNAME STRING)
set(${VARNAME} TRUE PARENT_SCOPE)
list(APPEND DG_CONFIG_OPTIONS " ${STRING}")
set(DG_CONFIG_OPTIONS "${DG_CONFIG_OPTIONS}" PARENT_SCOPE)
message(STATUS "Found " ${STRING})
endmacro(dg_set_module_option)
macro(dg_add_library LIBNAME)
list(APPEND EXTERNAL_LIBRARIES ${LIBNAME})
set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} PARENT_SCOPE)
endmacro(dg_add_library)
if(ENABLE_PROJ)
find_library (PROJ_LIB proj)
if (PROJ_LIB)
find_path (PROJ_INC "proj_api.h" PATH_SUFFIXES include)
if (PROJ_INC)
set(HAVE_PROJ TRUE)
set_dg_config_option(HAVE_PROJ "Proj")
list(APPEND EXTERNAL_LIBRARIES ${PROJ_LIB})
list(APPEND EXTERNAL_INCLUDES ${PROJ_INC})
endif(PROJ_INC)
endif(PROJ_LIB)
endif(ENABLE_PROJ)
find_library(REALTIME_LIB rt) find_library(REALTIME_LIB rt)
if (REALTIME_LIB) if (REALTIME_LIB)
list(APPEND EXTERNAL_LIBRARIES ${REALTIME_LIB}) list(APPEND EXTERNAL_LIBRARIES ${REALTIME_LIB})
set_dg_config_option(HAVE_REALTIME "RealTime") set_dg_config_option(HAVE_REALTIME "RealTime")
endif (REALTIME_LIB) endif (REALTIME_LIB)
find_package(SWIG REQUIRED)
find_package(PythonLibs REQUIRED)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
message(STATUS "Found SWIG version " ${SWIG_VERSION})
set_dg_config_option(HAVE_SWIG "Swig")
endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
find_package(SWIG)
find_package(PythonLibs)
find_package(PythonInterp)
include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
if (NOT NUMPY_INC)
EXEC_PROGRAM (${PYTHON_EXECUTABLE}
ARGS "-c \"import numpy; print(numpy.get_include())\""
OUTPUT_VARIABLE NUMPY_INC
RETURN_VALUE NUMPY_NOT_FOUND)
endif(NOT NUMPY_INC)
if(NUMPY_INC)
list(APPEND EXTERNAL_INCLUDES ${NUMPY_INC})
set_dg_config_option(HAVE_NUMPY "Numpy")
endif(NUMPY_INC)
endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
macro(dg_add_source FILES) macro(dg_add_source FILES)
foreach(FILE ${FILES}) foreach(FILE ${FILES})
list(APPEND LIST ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) list(APPEND LIST ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
...@@ -146,14 +94,7 @@ macro(dg_add_source FILES) ...@@ -146,14 +94,7 @@ macro(dg_add_source FILES)
set(DG_SRC ${DG_SRC};${LIST} PARENT_SCOPE) set(DG_SRC ${DG_SRC};${LIST} PARENT_SCOPE)
endmacro(dg_add_source) endmacro(dg_add_source)
macro(dg_add_swig_module module filename libname) include(dgpy/dgpy.cmake)
list(APPEND DG_SWIG_MODULES ${module})
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" RELATIVE_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}")
list(APPEND DG_SWIG_MODULES ${RELATIVE_SOURCE})
list(APPEND DG_SWIG_MODULES ${filename})
list(APPEND DG_SWIG_MODULES ${libname})
set(DG_SWIG_MODULES ${DG_SWIG_MODULES} PARENT_SCOPE)
endmacro(dg_add_swig_module)
macro(dg_add_test_directory directory email) macro(dg_add_test_directory directory email)
get_filename_component(ABSPATH ${directory} ABSOLUTE) get_filename_component(ABSPATH ${directory} ABSOLUTE)
...@@ -197,13 +138,12 @@ macro(dg_add_module_ module FILES) ...@@ -197,13 +138,12 @@ macro(dg_add_module_ module FILES)
endif(BLAS_LINKER_FLAGS) endif(BLAS_LINKER_FLAGS)
endmacro(dg_add_module_) endmacro(dg_add_module_)
dg_add_module_(dg "${DG_SRC}") dg_add_module_(dg "${DG_SRC}")
target_link_libraries(dg ${EXTERNAL_LIBRARIES}) target_link_libraries(dg ${EXTERNAL_LIBRARIES})
macro(dg_add_module module FILES) macro(dg_add_module module FILES LIBS)
dg_add_module_(${module} "${FILES}") dg_add_module_(${module} "${FILES}")
target_link_libraries(${module} dg ${EXTERNAL_LIBRARIES}) target_link_libraries(${module} dg ${EXTERNAL_LIBRARIES} ${LIBS})
endmacro(dg_add_module) endmacro(dg_add_module)
add_subdirectory(modules/atmosphere) add_subdirectory(modules/atmosphere)
...@@ -229,5 +169,16 @@ configure_file(dgftpupload ${CMAKE_CURRENT_BINARY_DIR}/dgftpupload @ONLY) ...@@ -229,5 +169,16 @@ configure_file(dgftpupload ${CMAKE_CURRENT_BINARY_DIR}/dgftpupload @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dgConfig.h.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dgConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/dgConfig.h) ${CMAKE_CURRENT_BINARY_DIR}/dgConfig.h)
set (EXTERNAL_LIBRARIES_COMMAND_LINE "")
FOREACH(lib ${EXTERNAL_LIBRARIES})
IF ("${lib}" MATCHES "^[-/].*")
set (EXTERNAL_LIBRARIES_COMMAND_LINE "${EXTERNAL_LIBRARIES_COMMAND_LINE} ${lib}")
ELSE()
set (EXTERNAL_LIBRARIES_COMMAND_LINE "${EXTERNAL_LIBRARIES_COMMAND_LINE} -l${lib}")
ENDIF()
ENDFOREACH(lib)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/external_libraries.make.in
${CMAKE_CURRENT_BINARY_DIR}/external_libraries.make)
message("Dg has been configured for ${GMSH_OS} with the following options: " ${DG_CONFIG_OPTIONS}) message("Dg has been configured with the following options: " ${DG_CONFIG_OPTIONS})
...@@ -918,7 +918,7 @@ class dgIPTerm : public functor { ...@@ -918,7 +918,7 @@ class dgIPTerm : public functor {
} }
else else
Msg::Fatal("The setup with anisotropic and different diffusivities for different fields is not implemented"); Msg::Fatal("The setup with anisotropic and different diffusivities for different fields is not implemented");
val(iPt, k) = - (meanNormalFlux + solutionJumpPenalty); val(iPt, k) = - (meanNormalFlux + solutionJumpPenalty);
val(iPt, k + nbFields) = (meanNormalFlux + solutionJumpPenalty); val(iPt, k + nbFields) = (meanNormalFlux + solutionJumpPenalty);
} }
} }
......
#ifndef _DG_CONFIG_H_ #ifndef _DG_CONFIG_H_
#define _DG_CONFIG_H_ #define _DG_CONFIG_H_
#cmakedefine HAVE_FES
#cmakedefine HAVE_GOTM
#cmakedefine HAVE_GPERFTOOLSPROFILER #cmakedefine HAVE_GPERFTOOLSPROFILER
#cmakedefine HAVE_METIS #cmakedefine HAVE_METIS
#cmakedefine HAVE_MPI #cmakedefine HAVE_MPI
#cmakedefine HAVE_NETCDF
#cmakedefine HAVE_NETCDFCPP
#cmakedefine HAVE_PNETCDF
#cmakedefine HAVE_NUMPY #cmakedefine HAVE_NUMPY
#cmakedefine HAVE_PETSC #cmakedefine HAVE_PETSC
#cmakedefine HAVE_PETSC4PY #cmakedefine HAVE_PETSC4PY
#cmakedefine HAVE_PROJ
#cmakedefine HAVE_REALTIME #cmakedefine HAVE_REALTIME
#ifdef HAVE_FES
#define FES_DATA "${FES_DATA}"
#endif
#endif #endif
#see CMake bug 4147 (modified to remove dgConfig.h)
MACRO(SWIG_GET_WRAPPER_DEPENDENCIES swigFile genWrapper language DEST_VARIABLE)
GET_FILENAME_COMPONENT(swig_getdeps_basename ${swigFile} NAME_WE)
GET_FILENAME_COMPONENT(swig_getdeps_outdir ${genWrapper} PATH)
GET_SOURCE_FILE_PROPERTY(swig_getdeps_extra_flags "${swigFile}" SWIG_FLAGS)
IF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
SET(swig_getdeps_extra_flags "")
ENDIF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
IF(NOT swig_getdeps_outdir)
SET(swig_getdeps_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(NOT swig_getdeps_outdir)
SET(swig_getdeps_depsfile
${swig_getdeps_outdir}/swig_${swig_getdeps_basename}_deps.txt)
GET_DIRECTORY_PROPERTY(swig_getdeps_include_directories INCLUDE_DIRECTORIES)
SET(swig_getdeps_include_dirs)
FOREACH(it ${swig_getdeps_include_directories})
SET(swig_getdeps_include_dirs ${swig_getdeps_include_dirs} "-I${it}")
ENDFOREACH(it)
EXECUTE_PROCESS(
COMMAND ${SWIG_EXECUTABLE}
-MM -MF ${swig_getdeps_depsfile} ${swig_getdeps_extra_flags}
${CMAKE_SWIG_FLAGS} -${language}
-o ${genWrapper} ${swig_getdeps_include_dirs} ${swigFile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE swig_getdeps_result
ERROR_VARIABLE swig_getdeps_error
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT EXISTS ${swig_getdeps_depsfile})
SET(swig_getdeps_dependencies "")
ELSE(NOT EXISTS ${swig_getdeps_depsfile})
FILE(READ ${swig_getdeps_depsfile} ${DEST_VARIABLE})
# Remove the first line
STRING(REGEX REPLACE "^.+: +\\\\\n +" ""
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
# Clean the end of each line
STRING(REGEX REPLACE " +(\\\\)?\n" "\n" ${DEST_VARIABLE}
"${${DEST_VARIABLE}}")
# Clean beginning of each line
STRING(REGEX REPLACE "\n +" "\n"
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
# clean paths
STRING(REGEX REPLACE "\\\\\\\\" "/" ${DEST_VARIABLE}
"${${DEST_VARIABLE}}")
STRING(REGEX REPLACE "\n" ";"
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
ENDIF(NOT EXISTS ${swig_getdeps_depsfile})
ENDMACRO(SWIG_GET_WRAPPER_DEPENDENCIES)
set (EXTERNAL_LIBRARIES_COMMAND_LINE "")
FOREACH(lib ${EXTERNAL_LIBRARIES})
IF ("${lib}" MATCHES "^[-/].*")
set (EXTERNAL_LIBRARIES_COMMAND_LINE "${EXTERNAL_LIBRARIES_COMMAND_LINE} ${lib}")
ELSE()
set (EXTERNAL_LIBRARIES_COMMAND_LINE "${EXTERNAL_LIBRARIES_COMMAND_LINE} -l${lib}")
ENDIF()
ENDFOREACH(lib)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/external_libraries.make.in
${CMAKE_CURRENT_BINARY_DIR}/external_libraries.make)
find_package(SWIG)
find_package(PythonLibs)
find_package(PythonInterp)
include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
list(LENGTH DG_SWIG_MODULES N)
set(CMAKE_SWIG_FLAGS -features autodoc=1)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/../../wrappers/gmshpy/)
while (${N} GREATER 0)
list(GET DG_SWIG_MODULES 0 module)
list(GET DG_SWIG_MODULES 1 directory)
list(GET DG_SWIG_MODULES 2 filename)
list(GET DG_SWIG_MODULES 3 libname)
list(REMOVE_AT DG_SWIG_MODULES 0)
list(REMOVE_AT DG_SWIG_MODULES 0)
list(REMOVE_AT DG_SWIG_MODULES 0)
list(REMOVE_AT DG_SWIG_MODULES 0)
list(LENGTH DG_SWIG_MODULES N)
set (filename "../${directory}/${filename}")
set_source_files_properties(${filename} PROPERTIES CPLUSPLUS ON)
# see CMake bug 4147
SWIG_GET_WRAPPER_DEPENDENCIES(${filename} ${CMAKE_CURRENT_BINARY_DIR}/${module}PYTHON_wrap.cxx python swig_extra_dependencies)
LIST(APPEND SWIG_MODULE_${module}_EXTRA_DEPS ${swig_extra_dependencies})
swig_add_module(${module} python ${filename})
swig_link_libraries(${module} ${PYTHON_LIBRARIES} ${libname})
#target_include_directories not present in cmake < 2.8.11
#target_include_directories(_${module} PRIVATE ../${directory})
#INCLUDE_DIRECTORIES is read only on cmake < 2.8.9
#get_property(IDIR TARGET _${module} PROPERTY INCLUDE_DIRECTORIES)
#set_property(TARGET _${module} PROPERTY INCLUDE_DIRECTORIES ${IDIR};${CMAKE_SOURCE_DIR}/${directory})
set_target_properties("_${module}" PROPERTIES COMPILE_FLAGS "-Wno-literal-suffix")
include_directories(${CMAKE_SOURCE_DIR}/${directory})
if(APPLE)
set_target_properties("_${module}" PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace")
endif(APPLE)
SET(DG_PYTHON_MODULES_INCLUDE_CODE "${DG_PYTHON_MODULES_INCLUDE_CODE}from dgpy.${module} import *\n")
list(APPEND DGPY_DEPENDS "_${module}")
endwhile (${N} GREATER 0)
add_custom_target("_dgpy" DEPENDS ${DGPY_DEPENDS})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in
${CMAKE_CURRENT_BINARY_DIR}/__init__.py) ${CMAKE_CURRENT_BINARY_DIR}/__init__.py)
......
find_package(SWIG REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(PythonInterp REQUIRED)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
message(STATUS "Found SWIG version " ${SWIG_VERSION})
set_dg_config_option(HAVE_SWIG "Swig")
include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
if (NOT NUMPY_INC)
EXEC_PROGRAM (${PYTHON_EXECUTABLE}
ARGS "-c \"import numpy; print(numpy.get_include())\""
OUTPUT_VARIABLE NUMPY_INC
RETURN_VALUE NUMPY_NOT_FOUND)
endif(NOT NUMPY_INC)
if(NUMPY_INC)
list(APPEND EXTERNAL_INCLUDES ${NUMPY_INC})
set_dg_config_option(HAVE_NUMPY "Numpy")
endif(NUMPY_INC)
endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
#include_directories(${PYTHON_INCLUDE_PATH})
#include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
#
#include_directories(${CMAKE_BINARY_DIR})
#see CMake bug 4147 (modified to remove dgConfig.h)
MACRO(SWIG_GET_WRAPPER_DEPENDENCIES swigFile genWrapper language DEST_VARIABLE)
GET_FILENAME_COMPONENT(swig_getdeps_basename ${swigFile} NAME_WE)
GET_FILENAME_COMPONENT(swig_getdeps_outdir ${genWrapper} PATH)
GET_SOURCE_FILE_PROPERTY(swig_getdeps_extra_flags "${swigFile}" SWIG_FLAGS)
IF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
SET(swig_getdeps_extra_flags "")
ENDIF("${swig_getdeps_extra_flags}" STREQUAL "NOTFOUND")
IF(NOT swig_getdeps_outdir)
SET(swig_getdeps_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(NOT swig_getdeps_outdir)
SET(swig_getdeps_depsfile
${swig_getdeps_outdir}/swig_${swig_getdeps_basename}_deps.txt)
GET_DIRECTORY_PROPERTY(swig_getdeps_include_directories INCLUDE_DIRECTORIES)
SET(swig_getdeps_include_dirs)
FOREACH(it ${swig_getdeps_include_directories})
SET(swig_getdeps_include_dirs ${swig_getdeps_include_dirs} "-I${it}")
ENDFOREACH(it)
EXECUTE_PROCESS(
COMMAND ${SWIG_EXECUTABLE}
-MM -MF ${swig_getdeps_depsfile} ${swig_getdeps_extra_flags}
${CMAKE_SWIG_FLAGS} -${language}
-o ${genWrapper} ${swig_getdeps_include_dirs} ${swigFile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE swig_getdeps_result
ERROR_VARIABLE swig_getdeps_error
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT EXISTS ${swig_getdeps_depsfile})
SET(swig_getdeps_dependencies "")
ELSE(NOT EXISTS ${swig_getdeps_depsfile})
FILE(READ ${swig_getdeps_depsfile} ${DEST_VARIABLE})
# Remove the first line
STRING(REGEX REPLACE "^.+: +\\\\\n +" ""
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
# Clean the end of each line
STRING(REGEX REPLACE " +(\\\\)?\n" "\n" ${DEST_VARIABLE}
"${${DEST_VARIABLE}}")
# Clean beginning of each line
STRING(REGEX REPLACE "\n +" "\n"
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
# clean paths
STRING(REGEX REPLACE "\\\\\\\\" "/" ${DEST_VARIABLE}
"${${DEST_VARIABLE}}")
STRING(REGEX REPLACE "\n" ";"
${DEST_VARIABLE} "${${DEST_VARIABLE}}")
ENDIF(NOT EXISTS ${swig_getdeps_depsfile})
ENDMACRO(SWIG_GET_WRAPPER_DEPENDENCIES)
macro(dg_add_swig_module module filename libname)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
set(CMAKE_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/dgpy)
set(CMAKE_SWIG_FLAGS -features autodoc=1)
get_directory_property(defs COMPILE_DEFINITIONS)
set(ddefs "")
foreach(d ${defs})
list(APPEND ddefs "-D${d}")
endforeach()
set_property(SOURCE ${filename} PROPERTY CPLUSPLUS ON)
set_property(SOURCE ${filename} PROPERTY SWIG_FLAGS "${ddefs}")
# see CMake bug 4147
SWIG_GET_WRAPPER_DEPENDENCIES(${filename} ${CMAKE_CURRENT_BINARY_DIR}/${module}PYTHON_wrap.cxx python swig_extra_dependencies)
LIST(APPEND SWIG_MODULE_${module}_EXTRA_DEPS ${swig_extra_dependencies})
swig_add_module(${module} python ${filename})
swig_link_libraries(${module} ${PYTHON_LIBRARIES} ${libname})
set_target_properties(${SWIG_MODULE_${module}_REAL_NAME} PROPERTIES COMPILE_FLAGS "-Wno-literal-suffix")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(APPLE)
set_target_properties(${SWIG_MODULE_${module}_REAL_NAME} PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace")
endif(APPLE)
set_target_properties(${SWIG_MODULE_${module}_REAL_NAME}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dgpy
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dgpy
)
SET(DG_PYTHON_MODULES_INCLUDE_CODE "${DG_PYTHON_MODULES_INCLUDE_CODE}from dgpy.${module} import *\n")
SET(DG_PYTHON_MODULES_INCLUDE_CODE "${DG_PYTHON_MODULES_INCLUDE_CODE}" PARENT_SCOPE)
list(APPEND DGPY_DEPENDS "_${module}")
endif()
endmacro(dg_add_swig_module)
...@@ -565,7 +565,7 @@ void functionC::buildLibraryFromFile(const std::string &cfilename, const std::st ...@@ -565,7 +565,7 @@ void functionC::buildLibraryFromFile(const std::string &cfilename, const std::st
/* Compiling string. */ /* Compiling string. */
const std::string compilingString = const std::string compilingString =
std::string ("include $(DG_BUILD_DIR)/CMakeFiles/dg.dir/flags.make\n") std::string ("include $(DG_BUILD_DIR)/CMakeFiles/dg.dir/flags.make\n")
+ "include $(DG_BUILD_DIR)/dgpy/external_libraries.make\n" + "include $(DG_BUILD_DIR)/external_libraries.make\n"
+ "%s : %s\n" + "%s : %s\n"
+ "\tg++ $< -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_INCLUDES) -L$(DG_BUILD_DIR) -ldg $(CXX_DEFINES) ${EXTERNAL_LIBRARIES} " + "\tg++ $< -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_INCLUDES) -L$(DG_BUILD_DIR) -ldg $(CXX_DEFINES) ${EXTERNAL_LIBRARIES} "
+ optionalFlags + '\n'; + optionalFlags + '\n';
...@@ -845,8 +845,8 @@ const fullMatrix<double> &functionPrecomputed::faceData(functorCache::Mode m, in ...@@ -845,8 +845,8 @@ const fullMatrix<double> &functionPrecomputed::faceData(functorCache::Mode m, in
} }
if (m != functorCache::INTEGRATION_GROUP_MODE) if (m != functorCache::INTEGRATION_GROUP_MODE)
Msg::Fatal("only NODE_GROUP_MODE and INTEGRATION_GROUP_MODE are valid argument for functionPrecomputed"); Msg::Fatal("only NODE_GROUP_MODE and INTEGRATION_GROUP_MODE are valid argument for functionPrecomputed");
if ((size_t)iGroup >= _faceData.size() || (size_t)iConn >= _faceData[iGroup].size() || _faceData[iGroup][iConn].size1() == 0) if ((size_t)iGroup >= _faceData.size() || (size_t)iConn >= _faceData[iGroup].size() || _faceData[iGroup][iConn].size1() == 0)
Msg::Fatal("functionPrecomputed not pre computed for face group %i %i in INTEGRATION_GROUP_MODE", iGroup, iConn); Msg::Fatal("functionPrecomputed not pre computed for face group %i %i in INTEGRATION_GROUP_MODE", iGroup, iConn);
return _faceData[iGroup][iConn]; return _faceData[iGroup][iConn];
} }
......
...@@ -538,9 +538,9 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof) ...@@ -538,9 +538,9 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof)
fullMatrix<double> coord, mod; fullMatrix<double> coord, mod;
for (int i = 0; i < getNbElementGroups() + getNbGhostGroups(); i++) { for (int i = 0; i < getNbElementGroups() + getNbGhostGroups(); i++) {
dgGroupOfElements *group = getElementGroup(i); dgGroupOfElements *group = getElementGroup(i);
if(xyzCoordDof->nField(*group) != 6) if(xyzCoordDof->nField(*group) != 6)
Msg::Error("dgGroupCollection::setCoordinates require a dof of 6 fields. The original mesh nodes " Msg::Error("dgGroupCollection::setCoordinates require a dof of 6 fields. The original mesh nodes "
"are modified as f0 * x + f1, f2 * y + f3, f4 * z + f5."); "are modified as f0 * x + f1, f2 * y + f3, f4 * z + f5.");
const nodalBasis &fsGeo = _mesh->elementVector(group->elementVectorId()).functionSpace(); const nodalBasis &fsGeo = _mesh->elementVector(group->elementVectorId()).functionSpace();
const nodalBasis &fs = group->getFunctionSpace(); const nodalBasis &fs = group->getFunctionSpace();
fullMatrix<double> phiGeo(fsGeo.points.size1(), fs.points.size1()); fullMatrix<double> phiGeo(fsGeo.points.size1(), fs.points.size1());
...@@ -558,10 +558,10 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof) ...@@ -558,10 +558,10 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof)
coord.setAll(0.); coord.setAll(0.);
for (int l = 0; l < fs.points.size1(); ++l) { for (int l = 0; l < fs.points.size1(); ++l) {
/* for (int k = 0; k < coordEVp.size1(); ++ k) { /* for (int k = 0; k < coordEVp.size1(); ++ k) {
coord(l,0) += coord(k, 0) * phiGeo(k, l); coord(l,0) += coord(k, 0) * phiGeo(k, l);
coord(l,1) += coord(k, 1) * phiGeo(k, l); coord(l,1) += coord(k, 1) * phiGeo(k, l);
coord(l,2) += coord(k, 2) * phiGeo(k, l); coord(l,2) += coord(k, 2) * phiGeo(k, l);
}*/ }*/
coord(l,0) = coordEVp(l,0) * mod(l,0) + mod(l,1); coord(l,0) = coordEVp(l,0) * mod(l,0) + mod(l,1);
coordEVp(l,0) = coord(l,0); coordEVp(l,0) = coord(l,0);
coord(l,1) = coordEVp(l,1) * mod(l,2) + mod(l,3); coord(l,1) = coordEVp(l,1) * mod(l,2) + mod(l,3);
......
...@@ -7,6 +7,6 @@ set(SRC ...@@ -7,6 +7,6 @@ set(SRC
simplePhysics/atmBoundaryLayer.cpp simplePhysics/atmBoundaryLayer.cpp
) )
dg_add_module(dgAtmosphere "${SRC}") dg_add_module(dgAtmosphere "${SRC}" "")
dg_add_swig_module(atmosphere atmosphere.i dgAtmosphere) dg_add_swig_module(atmosphere atmosphere.i dgAtmosphere)
dg_add_test_directory(tests sebastien.blaise@uclouvain.be) dg_add_test_directory(tests sebastien.blaise@uclouvain.be)
...@@ -2,6 +2,6 @@ set(SRC ...@@ -2,6 +2,6 @@ set(SRC
dgConservationLawElastodynamics.cpp dgConservationLawElastodynamics.cpp
) )
dg_add_module(dgElastodynamics "${SRC}") dg_add_module(dgElastodynamics "${SRC}" "")
dg_add_swig_module(elastodynamics elastodynamics.i dgElastodynamics) dg_add_swig_module(elastodynamics elastodynamics.i dgElastodynamics)
#dg_add_test_directory(tests axel.modave@uclouvain.be) #dg_add_test_directory(tests axel.modave@uclouvain.be)
...@@ -5,6 +5,6 @@ set(SRC ...@@ -5,6 +5,6 @@ set(SRC
dgConservationLawODE.cpp dgConservationLawODE.cpp
) )
dg_add_module(dgGeneric "${SRC}") dg_add_module(dgGeneric "${SRC}" "")
dg_add_swig_module(generic generic.i dgGeneric) dg_add_swig_module(generic generic.i dgGeneric)
dg_add_test_directory(tests sebastien.blaise@uclouvain.be) dg_add_test_directory(tests sebastien.blaise@uclouvain.be)
...@@ -2,6 +2,6 @@ set(SRC ...@@ -2,6 +2,6 @@ set(SRC
dgConservationLawLEE.cpp dgConservationLawLEE.cpp
) )
dg_add_module(dgLee "${SRC}") dg_add_module(dgLee "${SRC}" "")
dg_add_swig_module(lee lee.i dgLee) dg_add_swig_module(lee lee.i dgLee)
#dg_add_test_directory(tests thomas.toulorge@uclouvain.be) #dg_add_test_directory(tests thomas.toulorge@uclouvain.be)
...@@ -4,6 +4,6 @@ set(SRC ...@@ -4,6 +4,6 @@ set(SRC
dgConservationLawMaxwellPml.cpp dgConservationLawMaxwellPml.cpp
) )
dg_add_module(dgMaxwell "${SRC}") dg_add_module(dgMaxwell "${SRC}" "")
dg_add_swig_module(maxwell maxwell.i dgMaxwell) dg_add_swig_module(maxwell maxwell.i dgMaxwell)
#dg_add_test_directory(tests axel.modave@uclouvain.be) #dg_add_test_directory(tests axel.modave@uclouvain.be)
...@@ -5,6 +5,6 @@ set(SRC ...@@ -5,6 +5,6 @@ set(SRC
dgConservationLawStokes3d.cpp dgConservationLawStokes3d.cpp
) )
dg_add_module(dgNavierStokesIncomp "${SRC}") dg_add_module(dgNavierStokesIncomp "${SRC}" "")
dg_add_swig_module(navierStokesIncomp navierStokesIncomp.i dgNavierStokesIncomp) dg_add_swig_module(navierStokesIncomp navierStokesIncomp.i dgNavierStokesIncomp)
#dg_add_test_directory(tests emilie.marchandise@uclouvain.be) #dg_add_test_directory(tests emilie.marchandise@uclouvain.be)
...@@ -3,6 +3,6 @@ set(SRC ...@@ -3,6 +3,6 @@ set(SRC
dgConservationLawPerfectGasALE.cpp dgConservationLawPerfectGasALE.cpp
) )
dg_add_module(dgPerfectGas "${SRC}") dg_add_module(dgPerfectGas "${SRC}" "")
dg_add_swig_module(perfectGas perfectGas.i dgPerfectGas) dg_add_swig_module(perfectGas perfectGas.i dgPerfectGas)
#dg_add_test_directory(tests jean-francois.remacle@uclouvain.be) #dg_add_test_directory(tests jean-francois.remacle@uclouvain.be)
...@@ -8,6 +8,6 @@ set(SRC ...@@ -8,6 +8,6 @@ set(SRC
slimMovingBathWettingDrying.cpp slimMovingBathWettingDrying.cpp
) )
dg_add_module(dgShallowWater "${SRC}") dg_add_module(dgShallowWater "${SRC}" "")
dg_add_swig_module(shallowWater shallowWater.i dgShallowWater) dg_add_swig_module(shallowWater shallowWater.i dgShallowWater)
dg_add_test_directory(tests karim.slaoui@uclouvain.be) dg_add_test_directory(tests karim.slaoui@uclouvain.be)
option(ENABLE_PNETCDF "Enable PNETCDF" OFF)
if(ENABLE_PNETCDF)
find_library (PNETCDF_LIB pnetcdf)
if (PNETCDF_LIB)
find_path (PNETCDF_INC "pnetcdf.h" PATH_SUFFIXES include)
if (PNETCDF_INC)
dg_set_module_option(HAVE_PNETCDF "PNetcdf")
dg_add_library(${PNETCDF_LIB})
include_directories(${PNETCDF_INC})
endif(PNETCDF_INC)
endif(PNETCDF_LIB)
endif(ENABLE_PNETCDF)
set(SRC set(SRC
dgConservationLawSW3dContinuity.cpp dgConservationLawSW3dContinuity.cpp
...@@ -28,6 +16,22 @@ set(SRC ...@@ -28,6 +16,22 @@ set(SRC
slim3dNetCDFIO.cpp slim3dNetCDFIO.cpp
) )