Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
eca1f8a2
Commit
eca1f8a2
authored
May 26, 2016
by
Jonathan Lambrechts
Browse files
modularity
parent
72eb82d5
Pipeline
#429
failed with stage
in 24 minutes and 19 seconds
Changes
47
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -9,7 +9,6 @@ endif()
enable_language
(
C
)
enable_language
(
CXX
)
enable_testing
()
option
(
ENABLE_PROJ
"Enable PROJ"
ON
)
option
(
ENABLE_PETSC
"Enable PETSc"
ON
)
option
(
ENABLE_PETSC4PY
"Enable PETSc4Py"
ON
)
...
...
@@ -82,63 +81,12 @@ if(ENABLE_PETSC)
endif
(
PETSC_FOUND
)
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
)
if
(
REALTIME_LIB
)
list
(
APPEND EXTERNAL_LIBRARIES
${
REALTIME_LIB
}
)
set_dg_config_option
(
HAVE_REALTIME
"RealTime"
)
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
)
foreach
(
FILE
${
FILES
}
)
list
(
APPEND LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
FILE
}
)
...
...
@@ -146,14 +94,7 @@ macro(dg_add_source FILES)
set
(
DG_SRC
${
DG_SRC
}
;
${
LIST
}
PARENT_SCOPE
)
endmacro
(
dg_add_source
)
macro
(
dg_add_swig_module module filename libname
)
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
)
include
(
dgpy/dgpy.cmake
)
macro
(
dg_add_test_directory directory email
)
get_filename_component
(
ABSPATH
${
directory
}
ABSOLUTE
)
...
...
@@ -197,13 +138,12 @@ macro(dg_add_module_ module FILES)
endif
(
BLAS_LINKER_FLAGS
)
endmacro
(
dg_add_module_
)
dg_add_module_
(
dg
"
${
DG_SRC
}
"
)
target_link_libraries
(
dg
${
EXTERNAL_LIBRARIES
}
)
macro
(
dg_add_module module FILES
)
macro
(
dg_add_module module FILES
LIBS
)
dg_add_module_
(
${
module
}
"
${
FILES
}
"
)
target_link_libraries
(
${
module
}
dg
${
EXTERNAL_LIBRARIES
}
)
target_link_libraries
(
${
module
}
dg
${
EXTERNAL_LIBRARIES
}
${
LIBS
}
)
endmacro
(
dg_add_module
)
add_subdirectory
(
modules/atmosphere
)
...
...
@@ -229,5 +169,16 @@ configure_file(dgftpupload ${CMAKE_CURRENT_BINARY_DIR}/dgftpupload @ONLY)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/dgConfig.h.in
${
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
}
)
conservationLaw/dgConservationLawFunction.cpp
View file @
eca1f8a2
...
...
@@ -918,7 +918,7 @@ class dgIPTerm : public functor {
}
else
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
);
}
}
...
...
dgConfig.h.in
View file @
eca1f8a2
#ifndef _DG_CONFIG_H_
#define _DG_CONFIG_H_
#cmakedefine HAVE_FES
#cmakedefine HAVE_GOTM
#cmakedefine HAVE_GPERFTOOLSPROFILER
#cmakedefine HAVE_METIS
#cmakedefine HAVE_MPI
#cmakedefine HAVE_NETCDF
#cmakedefine HAVE_NETCDFCPP
#cmakedefine HAVE_PNETCDF
#cmakedefine HAVE_NUMPY
#cmakedefine HAVE_PETSC
#cmakedefine HAVE_PETSC4PY
#cmakedefine HAVE_PROJ
#cmakedefine HAVE_REALTIME
#ifdef HAVE_FES
#define FES_DATA "${FES_DATA}"
#endif
#endif
dgpy/CMakeLists.txt
View file @
eca1f8a2
#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
${
CMAKE_CURRENT_BINARY_DIR
}
/__init__.py
)
...
...
dgpy/dgpy.cmake
0 → 100644
View file @
eca1f8a2
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
)
dgpy/
external_libraries.make.in
→
external_libraries.make.in
View file @
eca1f8a2
File moved
function/functionGeneric.cpp
View file @
eca1f8a2
...
...
@@ -565,7 +565,7 @@ void functionC::buildLibraryFromFile(const std::string &cfilename, const std::st
/* Compiling string. */
const
std
::
string
compilingString
=
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
"
+
"
\t
g++ $< -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_INCLUDES) -L$(DG_BUILD_DIR) -ldg $(CXX_DEFINES) ${EXTERNAL_LIBRARIES} "
+
optionalFlags
+
'\n'
;
...
...
@@ -845,8 +845,8 @@ const fullMatrix<double> &functionPrecomputed::faceData(functorCache::Mode m, in
}
if
(
m
!=
functorCache
::
INTEGRATION_GROUP_MODE
)
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
)
Msg
::
Fatal
(
"functionPrecomputed not pre computed for face group %i %i in INTEGRATION_GROUP_MODE"
,
iGroup
,
iConn
);
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
);
return
_faceData
[
iGroup
][
iConn
];
}
...
...
mesh/dgGroupOfElements.cpp
View file @
eca1f8a2
...
...
@@ -538,9 +538,9 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof)
fullMatrix
<
double
>
coord
,
mod
;
for
(
int
i
=
0
;
i
<
getNbElementGroups
()
+
getNbGhostGroups
();
i
++
)
{
dgGroupOfElements
*
group
=
getElementGroup
(
i
);
if
(
xyzCoordDof
->
nField
(
*
group
)
!=
6
)
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."
);
if
(
xyzCoordDof
->
nField
(
*
group
)
!=
6
)
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."
);
const
nodalBasis
&
fsGeo
=
_mesh
->
elementVector
(
group
->
elementVectorId
()).
functionSpace
();
const
nodalBasis
&
fs
=
group
->
getFunctionSpace
();
fullMatrix
<
double
>
phiGeo
(
fsGeo
.
points
.
size1
(),
fs
.
points
.
size1
());
...
...
@@ -558,10 +558,10 @@ void dgGroupCollection::setCoordinates(dgDofContainer* xyzCoordDof)
coord
.
setAll
(
0.
);
for
(
int
l
=
0
;
l
<
fs
.
points
.
size1
();
++
l
)
{
/* for (int k = 0; k < coordEVp.size1(); ++ k) {
coord(l,0) += coord(k, 0) * phiGeo(k, l);
coord(l,1) += coord(k, 1) * phiGeo(k, l);
coord(l,2) += coord(k, 2) * phiGeo(k, l);
}*/
coord(l,0) += coord(k, 0) * phiGeo(k, l);
coord(l,1) += coord(k, 1) * phiGeo(k, l);
coord(l,2) += coord(k, 2) * phiGeo(k, l);
}*/
coord
(
l
,
0
)
=
coordEVp
(
l
,
0
)
*
mod
(
l
,
0
)
+
mod
(
l
,
1
);
coordEVp
(
l
,
0
)
=
coord
(
l
,
0
);
coord
(
l
,
1
)
=
coordEVp
(
l
,
1
)
*
mod
(
l
,
2
)
+
mod
(
l
,
3
);
...
...
modules/atmosphere/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -7,6 +7,6 @@ set(SRC
simplePhysics/atmBoundaryLayer.cpp
)
dg_add_module
(
dgAtmosphere
"
${
SRC
}
"
)
dg_add_module
(
dgAtmosphere
"
${
SRC
}
"
""
)
dg_add_swig_module
(
atmosphere atmosphere.i dgAtmosphere
)
dg_add_test_directory
(
tests sebastien.blaise@uclouvain.be
)
modules/elastodynamics/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -2,6 +2,6 @@ set(SRC
dgConservationLawElastodynamics.cpp
)
dg_add_module
(
dgElastodynamics
"
${
SRC
}
"
)
dg_add_module
(
dgElastodynamics
"
${
SRC
}
"
""
)
dg_add_swig_module
(
elastodynamics elastodynamics.i dgElastodynamics
)
#dg_add_test_directory(tests axel.modave@uclouvain.be)
modules/generic/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -5,6 +5,6 @@ set(SRC
dgConservationLawODE.cpp
)
dg_add_module
(
dgGeneric
"
${
SRC
}
"
)
dg_add_module
(
dgGeneric
"
${
SRC
}
"
""
)
dg_add_swig_module
(
generic generic.i dgGeneric
)
dg_add_test_directory
(
tests sebastien.blaise@uclouvain.be
)
modules/lee/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -2,6 +2,6 @@ set(SRC
dgConservationLawLEE.cpp
)
dg_add_module
(
dgLee
"
${
SRC
}
"
)
dg_add_module
(
dgLee
"
${
SRC
}
"
""
)
dg_add_swig_module
(
lee lee.i dgLee
)
#dg_add_test_directory(tests thomas.toulorge@uclouvain.be)
modules/maxwell/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -4,6 +4,6 @@ set(SRC
dgConservationLawMaxwellPml.cpp
)
dg_add_module
(
dgMaxwell
"
${
SRC
}
"
)
dg_add_module
(
dgMaxwell
"
${
SRC
}
"
""
)
dg_add_swig_module
(
maxwell maxwell.i dgMaxwell
)
#dg_add_test_directory(tests axel.modave@uclouvain.be)
modules/navierStokesIncomp/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -5,6 +5,6 @@ set(SRC
dgConservationLawStokes3d.cpp
)
dg_add_module
(
dgNavierStokesIncomp
"
${
SRC
}
"
)
dg_add_module
(
dgNavierStokesIncomp
"
${
SRC
}
"
""
)
dg_add_swig_module
(
navierStokesIncomp navierStokesIncomp.i dgNavierStokesIncomp
)
#dg_add_test_directory(tests emilie.marchandise@uclouvain.be)
modules/perfectGas/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -3,6 +3,6 @@ set(SRC
dgConservationLawPerfectGasALE.cpp
)
dg_add_module
(
dgPerfectGas
"
${
SRC
}
"
)
dg_add_module
(
dgPerfectGas
"
${
SRC
}
"
""
)
dg_add_swig_module
(
perfectGas perfectGas.i dgPerfectGas
)
#dg_add_test_directory(tests jean-francois.remacle@uclouvain.be)
modules/shallowWater/CMakeLists.txt
View file @
eca1f8a2
...
...
@@ -8,6 +8,6 @@ set(SRC
slimMovingBathWettingDrying.cpp
)
dg_add_module
(
dgShallowWater
"
${
SRC
}
"
)
dg_add_module
(
dgShallowWater
"
${
SRC
}
"
""
)
dg_add_swig_module
(
shallowWater shallowWater.i dgShallowWater
)
dg_add_test_directory
(
tests karim.slaoui@uclouvain.be
)
modules/slim3d/CMakeLists.txt
View file @
eca1f8a2
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
dgConservationLawSW3dContinuity.cpp
...
...
@@ -28,6 +16,22 @@ set(SRC
slim3dNetCDFIO.cpp
)
set
(
LIBS
""
)
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
)
add_definitions
(
"-DHAVE_PNETCDF"
)
list
(
APPEND LIBS
"
${
PNETCDF_LIB
}
"
)
include_directories
(
${
PNETCDF_INC
}
)
message
(
"slim3d configured with PNETCDF"
)
endif
(
PNETCDF_INC
)
endif
(
PNETCDF_LIB
)
endif
(
ENABLE_PNETCDF
)
option
(
ENABLE_GOTM
"Enable GOTM"
OFF
)
if
(
ENABLE_GOTM
)
include
(
ExternalProject
)
...
...
@@ -57,13 +61,13 @@ if(ENABLE_GOTM)
# if(NOT ${FortranCInterface_GLOBAL_FOUND})
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gotm.h.fallback ${CMAKE_CURRENT_BINARY_DIR}/gotm.h COPYONLY)
#endif(NOT ${FortranCInterface_GLOBAL_FOUND})
dg_set_module_option
(
HAVE_GOTM
"Gotm"
)
dg_add_library
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gotm/build/libgotm.a"
)
dg_add_library
(
"
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
"
)
add_definitions
(
"-DHAVE_GOTM"
)
message
(
"slim3d configured with Gotm"
)
list
(
APPEND LIBS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gotm/build/libgotm.a"
)
list
(
APPEND LIBS
"
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
"
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
endif
(
ENABLE_GOTM
)
dg_add_module
(
dgSlim3D
"
${
SRC
}
"
)
dg_add_module
(
dgSlim3D
"
${
SRC
}
"
"
${
LIBS
}
"
)
dg_add_swig_module
(
slim3d slim3d.i dgSlim3D
)
dg_add_test_directory
(
tests philippe.delandmeter@uclouvain.be
)
modules/slim3d/dgGOTMWrapper.h
View file @
eca1f8a2
#ifndef _DG_GOTM_WRAPPER__H_
#define _DG_GOTM_WRAPPER__H_
#include
"dgConfig.h"
#ifdef HAVE_GOTM
#include
<string>
class
dgGOTMinterface
{
...
...
modules/slim3d/dgSW3dTurbulenceGOTM.h
View file @
eca1f8a2
#ifndef DG_SW3D_TURBULENCE_GOTM_H_
#define DG_SW3D_TURBULENCE_GOTM_H_
#include
"dgConfig.h"
#include
"dgSW3dVerticalModel.h"
#include
"dgGOTMWrapper.h"
#ifdef HAVE_GOTM
...
...
modules/slim3d/slim3dEquations.cpp
View file @
eca1f8a2
...
...
@@ -4,7 +4,6 @@
#include
"dgSW3dVerticalModel.h"
#include
"dgSW3dTurbulenceGOTM.h"
#include
"dgExtrusion.h"
#include
"dgConfig.h"
slim3dSolverDofs
::
slim3dSolverDofs
(
slim3dSolver
*
solver
)
:
_solver
(
solver
)
{
// init all dofs to NULL
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment