-INCLUDE_DIRECTORIES(
- ${SLEPC_INCLUDES}
-)
-
FILE(GLOB include_linearsolver_HXX . *.hxx )
INSTALL(FILES ${include_linearsolver_HXX} DESTINATION include)
+++ /dev/null
-PROJECT(PETSc)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-
-
ADD_TEST(UnitTestCDMATH TestCDMATH)
SET_PROPERTY(TEST UnitTestCDMATH PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}")
- INSTALL(TARGETS TestCDMATH DESTINATION tests/unit_tests)
+ INSTALL(TARGETS TestCDMATH DESTINATION bin/unit_tests)
ADD_SUBDIRECTORY(cdmath)
ADD_SUBDIRECTORY(ressources)
-FILE(COPY doc/ DESTINATION convergence_tests)
-INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence_tests DESTINATION doc/)
+FILE(COPY doc/ DESTINATION share/doc/)
+INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/convergence_tests DESTINATION share/validation)
if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
# Examples tests
TARGET_LINK_LIBRARIES(TestMesh base mesh medloader medcoupling med)
endif (CDMATH_WITH_PETSC)
-INSTALL(TARGETS TestMesh DESTINATION tests/unit_tests)
+INSTALL(TARGETS TestMesh DESTINATION bin/unit_tests)
WaveSystem_Shock/WaveSystemUpwind WaveSystem_Shock/WaveSystemCentered WaveSystem_Shock/WaveSystemPStag WaveSystem_Shock/WaveSystemStaggered
)
-install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION examples)
+install(DIRECTORY ${NICE_EXAMPLES_TO_INSTALL} DESTINATION share/examples)
IF (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
ADD_SUBDIRECTORY(TransportEquation1DUpwindExplicit)
file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/tests/ressources)
-install(DIRECTORY ${MESH_MED2} DESTINATION meshes)
+install(DIRECTORY ${MESH_MED2} DESTINATION share/meshes)
ADD_TEST(TestsLinearSolverSwig ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/linearSolverTests.py)
SET_PROPERTY(TEST TestsLinearSolverSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}")
SET_PROPERTY(TEST TestsLinearSolverSwig APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}")
- INSTALL(FILES linearSolverTests.py DESTINATION tests/unit_tests)
+ INSTALL(FILES linearSolverTests.py DESTINATION bin/unit_tests)
SET_PROPERTY(TEST TestsCDMATHSwig PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}")
add_subdirectory (BoySurface)
endif ()
-INSTALL(FILES ${MESH_MED} mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION tests/unit_tests)
+INSTALL(FILES ${MESH_MED} mainTests.py test_VTK_routines.py test_PV_routines.py DESTINATION bin/unit_tests)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION bin/validation/${dir}
+ DESTINATION share/validation/${dir}
FILES_MATCHING PATTERN "*.py"
PATTERN "*.med"
PATTERN "*_0.vtu"
if(NOT ${is_2DPoissonVF} EQUAL -1)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DPoissonVF
+ DESTINATION share/doc/convergence_tests/2DPoissonVF
FILES_MATCHING PATTERN "*_SQUARE.ipynb"
PATTERN "*_SQUARE.pdf"
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DPoissonVF/${dir}
+ DESTINATION share/doc/convergence_tests/2DPoissonVF/${dir}
FILES_MATCHING PATTERN "*.png"
PATTERN "*.ipynb"
PATTERN "*.py"
if(NOT ${is_2DWaveSystem} EQUAL -1)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DWaveSystemVF_stationary
+ DESTINATION share/doc/convergence_tests/2DWaveSystemVF_stationary
FILES_MATCHING PATTERN "*_SQUARE.ipynb"
PATTERN "*_SQUARE.pdf"
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DWaveSystemVF_stationary/${dir}
+ DESTINATION share/doc/convergence_tests/2DWaveSystemVF_stationary/${dir}
FILES_MATCHING PATTERN "*.png"
PATTERN "*.ipynb"
PATTERN "*.py"
if(NOT ${is_2DDiffusion} EQUAL -1)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF
+ DESTINATION share/doc/convergence_tests/2DAnisotropicDiffusionVF
FILES_MATCHING PATTERN "*_SQUARE.ipynb"
PATTERN "*_SQUARE.pdf"
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
- DESTINATION doc/convergence_tests/2DAnisotropicDiffusionVF/${dir}
+ DESTINATION share/doc/convergence_tests/2DAnisotropicDiffusionVF/${dir}
FILES_MATCHING PATTERN "*.png"
PATTERN "*.ipynb"
PATTERN "*.py"
set (MEDCOUPLING_ROOT_DIR OFF CACHE STRING "MEDCoupling library path" )
#url of tarball librairies
-set (DOWNLOAD_PETSC http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.tar.gz
+set (DOWNLOAD_PETSC http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.5.tar.gz
CACHE STRING "PETSc tarball path/url" )
set (DOWNLOAD_SLEPC https://slepc.upv.es/download/distrib/slepc-3.13.4.tar.gz
CACHE STRING "SLEPC tarball path/url" )
-set (DOWNLOAD_F2CBLASLAPACK ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/f2cblaslapack-3.4.2.q4.tar.gz
+set (DOWNLOAD_F2CBLASLAPACK https://www.mcs.anl.gov/petsc/mirror/externalpackages/f2cblaslapack-3.4.2.q4.tar.gz
CACHE STRING "F2CBLASLAPACK tarball path/url" )
-set (DOWNLOAD_HDF5 ${CDMATH_SOURCE_DIR}/pre_requis/PETSc/hdf5-1.10.3.tar.gz
+set (DOWNLOAD_HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.gz
CACHE STRING "HDF5 tarball path/url" )
set (DOWNLOAD_MED http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz
CACHE STRING "MED tarball path/url")
CACHE STRING "MEDCoupling tarball path/url" )
list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files")
-
+include(ExternalProject)#For PETSc, MED and MEDCoupling
######################################################
# Detection or compilation of PETSc+SLEPc+HDF5 #
######################################################
message ( STATUS "Checking variable SLEPC_DIR" )
if ( IS_DIRECTORY ${SLEPC_DIR}/include AND EXISTS ${SLEPC_DIR}/lib/libslepc.so)
- set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
+ set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
message( STATUS "SLEPc found at ${SLEPC_DIR}" )
else()
set(HDF5_ROOT ${PETSC_DIR}/${PETSC_ARCH})# define hint for hdf5/med installation in petsc external packages
endif( DEFINED ENV{HDF5_ROOT} )
endif( NOT HDF5_ROOT )
- set(HDF5_LIBRARY_DIR ${HDF5_ROOT}/lib)
+ set(HDF5_LIBRARY_DIR ${HDF5_ROOT}/lib)
set(HDF5_INCLUDE_DIRS ${HDF5_ROOT}/include)
else ( DEFINED ENV{PETSC_DIR} OR PETSC_DIR )
message ( STATUS "PETSC_DIR not set, searching PETSc and SLEPc in the system" )
if ( IS_DIRECTORY "/usr/include/petsc/" AND EXISTS "/usr/lib64/libpetsc.so" ) #Case fedora/redhat system install
message ( STATUS "PETSC includes found in /usr/include/petsc/" )
- message ( STATUS "PETSC library found in /usr/lib64" )
+ message ( STATUS "PETSC library found in /usr/lib64" )
set(PETSC_DIR /usr/)
set(PETSC_INCLUDES /usr/include/petsc /usr/include/petsc/petsc/mpiuni)
set(PETSC_LIBRARIES /usr/lib64/libpetsc.so)
#Define and search slepc variables
if ( IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" )
message( STATUS "SLEPc includes found in /usr/include/slepc/" )
- message( STATUS "SLEPc library found in /usr/lib64/slepc/" )
+ message( STATUS "SLEPc library found in /usr/lib64/slepc/" )
set(SLEPC_DIR /usr/)
- set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
+ set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
set (CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, slepc-devel (>= 3.4)") # This is not fully working yet.
else ( IS_DIRECTORY "/usr/include/slepc/" AND EXISTS "/usr/lib64/libslepc.so" )
if ( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )#hdf5 is not defined in the environment
find_package(HDF5 REQUIRED)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libhdf5-dev")
- set(CPACK_RPM_PACKAGE_REQUIRES "hdf5-devel")
+ set(CPACK_RPM_PACKAGE_REQUIRES "hdf5-devel")
endif( NOT HDF5_ROOT AND NOT DEFINED ENV{HDF5_ROOT} )
-
#elseif ( IS_DIRECTORY "/usr/lib/petsc/include" AND EXISTS "/usr/lib/petsc/lib/libpetsc_real.so" ) #Case ubuntu/debian system install
# message ( STATUS "PETSc includes found in /usr/lib/petsc/include")
# message ( STATUS "PETSc library found in /usr/lib/petsc/lib/libpetsc_real.so")
#extract tarball name
string(LENGTH "${DOWNLOAD_PETSC}" tarball_url_length)#length of the tarball
string(FIND "${DOWNLOAD_PETSC}" "/" start_tarball_name REVERSE )# last occurence of "/"
- MATH(EXPR start_tarball_name "${start_tarball_name}+1")#start after the occurence of "/"
+ MATH(EXPR start_tarball_name "${start_tarball_name}+1")#start after the occurence of "/"
MATH(EXPR tarball_name_length "${tarball_url_length}-${start_tarball_name}-7")#name ends before .tar.gz that counts for 7 characters
string(SUBSTRING ${DOWNLOAD_PETSC} ${start_tarball_name} ${tarball_name_length} PETSC_TARBALL_NAME)
set(PETSC_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis/${PETSC_TARBALL_NAME}) # Location of the final install
+ set(PETSC_ARCH arch-linux-c-opt)
set(PETSC_INSTALL ${CMAKE_INSTALL_PREFIX}/share/petsc)#folder to copy petsc libraries and include files
ExternalProject_Add (PETSc
SOURCE_DIR ${PETSC_DIR}
BUILD_IN_SOURCE TRUE
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PETSC_INSTALL} --with-debugging=0 --with-mpi=0 --download-f2cblaslapack=${DOWNLOAD_F2CBLASLAPACK} --with-fc=0 --download-slepc=${DOWNLOAD_SLEPC} --download-hdf5=${DOWNLOAD_HDF5}
- BUILD_COMMAND make
+ BUILD_COMMAND make all
TEST_COMMAND make check
- INSTALL_COMMAND make all
+ INSTALL_COMMAND make install
INSTALL_DIR ${PETSC_DIR}
STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/pre_requis
LOG_DOWNLOAD TRUE # Wrap download in script to log output
LOG_INSTALL TRUE # Wrap install in script to log output
)
- #file (STRINGS "${PETSC_DIR}/${PETSC_ARCH}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ")
- #message( STATUS "PETSc version is ${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" )
message( STATUS "PETSc, SLEPc and HDF5 will be installed at ${PETSC_INSTALL}")
- string(SUBSTRING ${PETSC_TARBALL_NAME} 6 ${tarball_name_length} PETSC_VERSION)
+ string(LENGTH "${PETSC_TARBALL_NAME}" tarball_name_length)#length of the tarball
+ string(FIND "${PETSC_TARBALL_NAME}" "-" start_version_name REVERSE )# last occurence of "-"
+ MATH(EXPR start_version_name "${start_version_name}+1")#start after the occurence of "/"
+ string(SUBSTRING ${PETSC_TARBALL_NAME} ${start_version_name} ${tarball_name_length} PETSC_VERSION)
+ message( STATUS "PETSc version ${PETSC_VERSION} will be installed" )
+
+ set(PETSC_INCLUDES ${PETSC_DIR}/${PETSC_ARCH}/include ${PETSC_DIR}/include)
+ set(PETSC_LIBRARIES ${PETSC_DIR}/${PETSC_ARCH}/lib/libpetsc.so)
+
#define slepc variables
set(SLEPC_DIR ${PETSC_INSTALL})
- set(SLEPC_INCLUDES ${SLEPC_DIR}/include)
- set(SLEPC_LIBRARIES ${SLEPC_DIR}/lib/libslepc.so)
+ set(SLEPC_INCLUDES ${SLEPC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/include ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/installed-arch-linux2-c-opt/include)
+ set(SLEPC_LIBRARIES ${PETSC_DIR}/${PETSC_ARCH}/externalpackages/slepc-3.13.4/installed-arch-linux2-c-opt/lib/libslepc.so)
+ message( STATUS "SLEPc includes ${SLEPC_INCLUDES}")
#define hdf5 variables
if ( NOT HDF5_ROOT )#hdf5 is not defined in cmake arguments
if ( ${PETSC_VERSION} VERSION_GREATER 3.5 )
add_definitions(-DPETSC_VERSION_GREATER_3_5)
endif( ${PETSC_VERSION} VERSION_GREATER 3.5 )
+
string(REPLACE ";" ":" PETSC_INCLUDES_INSTALL "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_CDMATH.sh
+add_library(petsc SHARED IMPORTED)
+set_property(TARGET petsc PROPERTY IMPORTED_LOCATION ${PETSC_LIBRARIES})
+add_library(slepc SHARED IMPORTED)
+set_property(TARGET slepc PROPERTY IMPORTED_LOCATION ${SLEPC_LIBRARIES})
+
######################################################
# Detection or compilation of MEDFile #
######################################################
message (STATUS "MEDFile found in ${MEDFILE_ROOT_DIR}")
else( MEDFILE_ROOT_DIR OR DEFINED ENV{MEDFILE_ROOT_DIR})
- #string(FIND "${HDF5_LIBRARIES}" "libhdf5.so" pos)
- #string(SUBSTRING "${HDF5_LIBRARIES}" 0 ${pos} HDF5_LIBRARY_DIR)
-
+
message(STATUS "MED will be downloaded and installed from ${DOWNLOAD_MED}")
set(MACHINE PCLINUX)
set(MEDFILE_DEFINITIONS "-D${MACHINE} -DMEDFILE_INSTALL_DOC=OFF")#Comment ne pas compiler la doc ?
find_package (XDR REQUIRED)
# Enter subdirectories
-set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/cdmath)
add_subdirectory (CDMATH)
if(SOLVERLAB_WITH_COREFLOWS)
- set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/../coreflows)
add_subdirectory (CoreFlows)
endif(SOLVERLAB_WITH_COREFLOWS)
-set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/../)
# Configuration file
configure_file(
${PROJECT_SOURCE_DIR}/env_SOLVERLAB.sh
#
INCLUDE_DIRECTORIES( #
${CoreFlows_INCLUDES} #
+ ${PETSC_INCLUDES}
+ ${SLEPC_INCLUDES}
) #
#
SET(CoreFlowsMain_SOURCES #
) #
#
SET(MAIN_SOURCES #
- main.cxx #
+ mainCoreFlows.cxx #
) #
SET(_extra_lib_CoreFlows ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ) #
ADD_EXECUTABLE(CoreFlowsMainExe ${MAIN_SOURCES}) #
SET_TARGET_PROPERTIES(CoreFlowsMainExe PROPERTIES COMPILE_FLAGS "") #
TARGET_LINK_LIBRARIES(CoreFlowsMainExe CoreFlows ${_extra_lib_CoreFlows}) #
-INSTALL(TARGETS CoreFlowsMainExe DESTINATION bin/Executable) #
+INSTALL(TARGETS CoreFlowsMainExe DESTINATION bin) #
#
configure_file(
${PROJECT_SOURCE_DIR}/env_CoreFlows.sh
INCLUDE_DIRECTORIES(
${CoreFlows_INCLUDES} #
+ ${PETSC_INCLUDES}
+ ${SLEPC_INCLUDES}
)
SET(src_models_CXX
#!/bin/bash
-export CDMATH_DIR=@CDMATH_DIR@
+export CDMATH_DIR=@CDMATH_INSTALL@
source $CDMATH_DIR/env_CDMATH.sh
export CoreFlows_INSTALL=@CMAKE_INSTALL_PREFIX@
export PETSC_DIR=@PETSC_DIR@
export PETSC_ARCH=@PETSC_ARCH@
-export PETSC_INCLUDES=@PETSC_INCLUDES_PATH@
+export PETSC_INCLUDES=@PETSC_INCLUDES_INSTALL@
#-------------------------------------------------------------------------------------------------------------------
-export CoreFlows=$CoreFlows_INSTALL/bin/Executable/CoreFlowsMainExe
+export CoreFlows=$CoreFlows_INSTALL/bin/CoreFlowsMainExe
export LD_LIBRARY_PATH=$CoreFlows_INSTALL/lib:$CDMATH_DIR/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${LD_LIBRARY_PATH}
-export PYTHONPATH=$CoreFlows_INSTALL/lib:$CoreFlows_INSTALL/lib/CoreFlows_Python:$CoreFlows_INSTALL/bin/CoreFlows_Python:$CoreFlows_INSTALL/lib/python2.7/site-packages/salome:$CDMATH_DIR/lib/cdmath:$CDMATH_DIR/bin/cdmath:$CDMATH_DIR/bin/cdmath/postprocessing:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${PYTHONPATH}
+export PYTHONPATH=$CoreFlows_INSTALL/lib:$CoreFlows_INSTALL/lib/coreflows:$CoreFlows_INSTALL/bin/coreflows:$CoreFlows_INSTALL/lib/python2.7/site-packages/salome:$CDMATH_DIR/lib/cdmath:$CDMATH_DIR/bin/cdmath:$CDMATH_DIR/bin/cdmath/postprocessing:${PETSC_DIR}/${PETSC_ARCH}/lib:${MEDCOUPLING_LIBRARIES}:${MEDFILE_C_LIBRARIES}:${PYTHONPATH}
export CoreFlowsGUI=$CoreFlows_INSTALL/bin/salome/CoreFlows_Standalone.py
INCLUDE_DIRECTORIES(
${CoreFlows_INCLUDES} #
+ ${PETSC_INCLUDES}
+ ${SLEPC_INCLUDES}
)
+++ /dev/null
-#include "SinglePhase.hxx"\r
-#include "DriftModel.hxx"\r
-#include "FiveEqsTwoFluid.hxx"\r
-#include "IsothermalTwoFluid.hxx"\r
-#include "TransportEquation.hxx"\r
-#include "DiffusionEquation.hxx"\r
-\r
-#include <iostream>\r
-\r
-using namespace std;\r
-\r
-int main()\r
-{\r
- int spaceDim = 2;\r
-\r
- // set the limit field for each boundary\r
- double wallVelocityX=0;\r
- double wallVelocityY=0;\r
- double wallTemperature=563;\r
-\r
- double inletConcentration=0;\r
- double inletVelocityX=0;\r
- double inletVelocityY=1;\r
- double inletTemperature=563;\r
-\r
- double outletPressure=155e5;\r
-\r
- // physical constants\r
- vector<double> gravite(spaceDim,0.) ;\r
- gravite[1]=-8.5;\r
- gravite[0]=5;\r
-\r
- DriftModel myProblem(around155bars600K,spaceDim);\r
- int nVar = myProblem.getNumberOfVariables();\r
-\r
- //Prepare for the mesh\r
- double xinf=0.0;\r
- double xsup=1.0;\r
- double yinf=0.0;\r
- double ysup=1.0;\r
- int nx=2;\r
- int ny=2;\r
-\r
- // Prepare for the initial condition\r
- vector<double> VV_Constant(nVar);\r
- // constant vector\r
- VV_Constant[0] = 0;\r
- VV_Constant[1] = 155e5;\r
- VV_Constant[2] = 0;\r
- VV_Constant[3] = 1;\r
- VV_Constant[4] = 563;\r
-\r
- //Initial field creation\r
- cout << "Building initial data" << endl;\r
- myProblem.setVerbose(true);\r
- myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet");\r
-\r
- //set the boundary conditions\r
- vector<double>pressure_reference_point(2);\r
- pressure_reference_point[0]=xsup;\r
- pressure_reference_point[1]=ysup;\r
- myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point);\r
- myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY);\r
- myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);\r
-\r
- // set physical parameters\r
- myProblem.setGravity(gravite);\r
-\r
- // set the numerical method\r
- myProblem.setNumericalScheme(staggered, Implicit);\r
- myProblem.setWellBalancedCorrection(true);\r
- myProblem.setNonLinearFormulation(VFFC);\r
-\r
- // name of result file\r
- string fileName = "DriftModel_2DInclinedBoilingChannel";\r
-\r
- // computation parameters\r
- unsigned MaxNbOfTimeStep = 1 ;\r
- int freqSave = 1;\r
- double cfl = 0.5;\r
- double maxTime = 5;\r
- double precision = 1e-4;\r
-\r
- myProblem.setCFL(cfl);\r
- myProblem.setPrecision(precision);\r
- myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);\r
- myProblem.setTimeMax(maxTime);\r
- myProblem.setFreqSave(freqSave);\r
- myProblem.setFileName(fileName);\r
- myProblem.saveVelocity();\r
- myProblem.setNewtonSolver(precision,1);\r
-\r
- // evolution\r
- myProblem.initialize();\r
-\r
- bool ok = myProblem.run();\r
- if (ok)\r
- cout << "Simulation "<<fileName<<" is successful !" << endl;\r
- else\r
- cout << "Simulation "<<fileName<<" failed ! " << endl;\r
-\r
- cout << "------------ End of calculation !!! -----------" << endl;\r
- myProblem.terminate();\r
-\r
- return ok;\r
-}\r
+++ /dev/null
-#!/usr/bin/env python
-# -*-coding:utf-8 -*
-
-import CoreFlows as cf
-import cdmath as cm
-import math
-
-def main():
-
- spaceDim = 1;
- # Prepare for the mesh
- xinf = 0 ;
- xsup=4.2;
- eps=1.E-8
- M=cm.Mesh("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections.med")
- M.getFace(0).setGroupName("Inlet")
- M.getFace(31).setGroupName("Outlet")
- #M.setGroupAtPlan(xsup,0,eps,"Outlet");
- #M.setGroupAtPlan(xinf,0,eps,"Inlet");
-
- # set the initial field
-
- initialPressure=155e5;
- initialVelocityX=5;
- initialTemperature=573;
-
- # set the limit field for each boundary
-
- inletVelocityX=5;
- inletTemperature=573;
- outletPressure=155e5
-
- myProblem = cf.SinglePhase(cf.Liquid,cf.around155bars600K,spaceDim);
- nVar = myProblem.getNumberOfVariables();
-
- # Prepare for the initial condition
- VV_Constant =[0]*nVar;
-
- # constant vector
- VV_Constant[0] = initialPressure ;
- VV_Constant[1] = initialVelocityX;
- VV_Constant[2] = initialTemperature ;
-
-
- #Initial field creation
- print("Building initial data" );
- myProblem.setInitialFieldConstant( M, VV_Constant);
-
- # set the boundary conditions
- myProblem.setInletBoundaryCondition("Inlet", inletTemperature, inletVelocityX);
- myProblem.setOutletBoundaryCondition("Outlet",outletPressure);
-
- #set porosity, heat and gravity source
- Sections=cm.Field("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections", cm.CELLS,"Section area");
- heatPowerField=cm.Field("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections", cm.CELLS,"Heat power");
- myProblem.setSectionField(Sections);
- myProblem.setHeatPowerField(heatPowerField)
- gravite=[-10]
- myProblem.setGravity(gravite)
- # set the numerical method
- myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
- myProblem.setWellBalancedCorrection(True)
-
- # name of result file
- fileName = "2BranchesHeatedChannels";
-
- # simulation parameters
- MaxNbOfTimeStep = 100000 ;
- freqSave = 50;
- cfl = 0.5;
- maxTime = 500;
- precision = 1e-5;
-
- myProblem.setCFL(cfl);
- myProblem.setPrecision(precision);
- myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
- myProblem.setTimeMax(maxTime);
- myProblem.setFreqSave(freqSave);
- myProblem.setFileName(fileName);
- myProblem.setNewtonSolver(precision,20);
- #myProblem.saveConservativeField(True);
- if(spaceDim>1):
- myProblem.saveVelocity();
- pass
-
- # evolution
- myProblem.initialize();
- print("Running python "+ fileName );
-
- ok = myProblem.run();
- if (ok):
- print( "Simulation python " + fileName + " is successful !" );
- pass
- else:
- print( "Simulation python " + fileName + " failed ! " );
- pass
-
- print( "------------ End of calculation !!! -----------" );
-
- myProblem.terminate();
- return ok
-
-if __name__ == """__main__""":
- main()
--- /dev/null
+#include "SinglePhase.hxx"\r
+#include "DriftModel.hxx"\r
+#include "FiveEqsTwoFluid.hxx"\r
+#include "IsothermalTwoFluid.hxx"\r
+#include "TransportEquation.hxx"\r
+#include "DiffusionEquation.hxx"\r
+\r
+#include <iostream>\r
+\r
+using namespace std;\r
+\r
+int main()\r
+{\r
+ int spaceDim = 2;\r
+\r
+ // set the limit field for each boundary\r
+ double wallVelocityX=0;\r
+ double wallVelocityY=0;\r
+ double wallTemperature=563;\r
+\r
+ double inletConcentration=0;\r
+ double inletVelocityX=0;\r
+ double inletVelocityY=1;\r
+ double inletTemperature=563;\r
+\r
+ double outletPressure=155e5;\r
+\r
+ // physical constants\r
+ vector<double> gravite(spaceDim,0.) ;\r
+ gravite[1]=-8.5;\r
+ gravite[0]=5;\r
+\r
+ DriftModel myProblem(around155bars600K,spaceDim);\r
+ int nVar = myProblem.getNumberOfVariables();\r
+\r
+ //Prepare for the mesh\r
+ double xinf=0.0;\r
+ double xsup=1.0;\r
+ double yinf=0.0;\r
+ double ysup=1.0;\r
+ int nx=2;\r
+ int ny=2;\r
+\r
+ // Prepare for the initial condition\r
+ vector<double> VV_Constant(nVar);\r
+ // constant vector\r
+ VV_Constant[0] = 0;\r
+ VV_Constant[1] = 155e5;\r
+ VV_Constant[2] = 0;\r
+ VV_Constant[3] = 1;\r
+ VV_Constant[4] = 563;\r
+\r
+ //Initial field creation\r
+ cout << "Building initial data" << endl;\r
+ myProblem.setVerbose(true);\r
+ myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet");\r
+\r
+ //set the boundary conditions\r
+ vector<double>pressure_reference_point(2);\r
+ pressure_reference_point[0]=xsup;\r
+ pressure_reference_point[1]=ysup;\r
+ myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point);\r
+ myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY);\r
+ myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);\r
+\r
+ // set physical parameters\r
+ myProblem.setGravity(gravite);\r
+\r
+ // set the numerical method\r
+ myProblem.setNumericalScheme(staggered, Implicit);\r
+ myProblem.setWellBalancedCorrection(true);\r
+ myProblem.setNonLinearFormulation(VFFC);\r
+\r
+ // name of result file\r
+ string fileName = "DriftModel_2DInclinedBoilingChannel";\r
+\r
+ // computation parameters\r
+ unsigned MaxNbOfTimeStep = 1 ;\r
+ int freqSave = 1;\r
+ double cfl = 0.5;\r
+ double maxTime = 5;\r
+ double precision = 1e-4;\r
+\r
+ myProblem.setCFL(cfl);\r
+ myProblem.setPrecision(precision);\r
+ myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);\r
+ myProblem.setTimeMax(maxTime);\r
+ myProblem.setFreqSave(freqSave);\r
+ myProblem.setFileName(fileName);\r
+ myProblem.saveVelocity();\r
+ myProblem.setNewtonSolver(precision,1);\r
+\r
+ // evolution\r
+ myProblem.initialize();\r
+\r
+ bool ok = myProblem.run();\r
+ if (ok)\r
+ cout << "Simulation "<<fileName<<" is successful !" << endl;\r
+ else\r
+ cout << "Simulation "<<fileName<<" failed ! " << endl;\r
+\r
+ cout << "------------ End of calculation !!! -----------" << endl;\r
+ myProblem.terminate();\r
+\r
+ return ok;\r
+}\r
--- /dev/null
+#!/usr/bin/env python
+# -*-coding:utf-8 -*
+
+import CoreFlows as cf
+import cdmath as cm
+import math
+
+def main():
+
+ spaceDim = 1;
+ # Prepare for the mesh
+ xinf = 0 ;
+ xsup=4.2;
+ eps=1.E-8
+ M=cm.Mesh("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections.med")
+ M.getFace(0).setGroupName("Inlet")
+ M.getFace(31).setGroupName("Outlet")
+ #M.setGroupAtPlan(xsup,0,eps,"Outlet");
+ #M.setGroupAtPlan(xinf,0,eps,"Inlet");
+
+ # set the initial field
+
+ initialPressure=155e5;
+ initialVelocityX=5;
+ initialTemperature=573;
+
+ # set the limit field for each boundary
+
+ inletVelocityX=5;
+ inletTemperature=573;
+ outletPressure=155e5
+
+ myProblem = cf.SinglePhase(cf.Liquid,cf.around155bars600K,spaceDim);
+ nVar = myProblem.getNumberOfVariables();
+
+ # Prepare for the initial condition
+ VV_Constant =[0]*nVar;
+
+ # constant vector
+ VV_Constant[0] = initialPressure ;
+ VV_Constant[1] = initialVelocityX;
+ VV_Constant[2] = initialTemperature ;
+
+
+ #Initial field creation
+ print("Building initial data" );
+ myProblem.setInitialFieldConstant( M, VV_Constant);
+
+ # set the boundary conditions
+ myProblem.setInletBoundaryCondition("Inlet", inletTemperature, inletVelocityX);
+ myProblem.setOutletBoundaryCondition("Outlet",outletPressure);
+
+ #set porosity, heat and gravity source
+ Sections=cm.Field("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections", cm.CELLS,"Section area");
+ heatPowerField=cm.Field("../CoreFlows_src/examples/ressources/BifurcatingFlow2BranchesEqualSections", cm.CELLS,"Heat power");
+ myProblem.setSectionField(Sections);
+ myProblem.setHeatPowerField(heatPowerField)
+ gravite=[-10]
+ myProblem.setGravity(gravite)
+ # set the numerical method
+ myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
+ myProblem.setWellBalancedCorrection(True)
+
+ # name of result file
+ fileName = "2BranchesHeatedChannels";
+
+ # simulation parameters
+ MaxNbOfTimeStep = 100000 ;
+ freqSave = 50;
+ cfl = 0.5;
+ maxTime = 500;
+ precision = 1e-5;
+
+ myProblem.setCFL(cfl);
+ myProblem.setPrecision(precision);
+ myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
+ myProblem.setTimeMax(maxTime);
+ myProblem.setFreqSave(freqSave);
+ myProblem.setFileName(fileName);
+ myProblem.setNewtonSolver(precision,20);
+ #myProblem.saveConservativeField(True);
+ if(spaceDim>1):
+ myProblem.saveVelocity();
+ pass
+
+ # evolution
+ myProblem.initialize();
+ print("Running python "+ fileName );
+
+ ok = myProblem.run();
+ if (ok):
+ print( "Simulation python " + fileName + " is successful !" );
+ pass
+ else:
+ print( "Simulation python " + fileName + " failed ! " );
+ pass
+
+ print( "------------ End of calculation !!! -----------" );
+
+ myProblem.terminate();
+ return ok
+
+if __name__ == """__main__""":
+ main()
INCLUDE_DIRECTORIES(
${Python_INCLUDE_DIRS}
${CoreFlows_INCLUDES} #
+ ${PETSC_INCLUDES}
+ ${SLEPC_INCLUDES}
)
-SET(_extra_lib_SWIG ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES})
+SET(_extra_lib_SWIG ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
SWIG_ADD_MODULE(CoreFlows python CoreFlows.i)
-SWIG_LINK_LIBRARIES(CoreFlows ${PYTHON_LIBRARIES} ${_extra_lib_SWIG} CoreFlows ${PETSC_LIBRARIES})
+SWIG_LINK_LIBRARIES(CoreFlows ${PYTHON_LIBRARIES} ${_extra_lib_SWIG} CoreFlows ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
-INSTALL(TARGETS _CoreFlows DESTINATION lib/CoreFlows_Python)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/CoreFlows_Python)
-INSTALL(FILES ${CoreFlows_SOURCE_DIR}/main.py DESTINATION bin/)
+INSTALL(TARGETS _CoreFlows DESTINATION lib/coreflows)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/coreflows)
+INSTALL(FILES ${CoreFlows_SOURCE_DIR}/mainCoreFlows.py DESTINATION bin/)
Simpler build for a minimum version:
* `cmake ../SOLVERLAB-master/ -DCMAKE_INSTALL_PREFIX=../SOLVERLAB_install -DCMAKE_BUILD_TYPE=Release `
> This will download and build the following dependencies
-> - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.tar.gz
+> - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.5.tar.gz
> - SLEPc from https://slepc.upv.es/download/distrib/slepc-3.13.4.tar.gz
-> - HDF5 http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz
+> - HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.gz
> - MEDFILE from http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz
> - MEDCOUPLING from http://files.salome-platform.org/Salome/other/medCoupling-9.4.0.tar.gz
#!/bin/bash
-export CDMATH_INSTALL=@CMAKE_INSTALL_PREFIX@/cdmath
-export COREFLOWS_INSTALL=@CMAKE_INSTALL_PREFIX@/coreflows
+export CDMATH_INSTALL=@CMAKE_INSTALL_PREFIX@
+export COREFLOWS_INSTALL=@CMAKE_INSTALL_PREFIX@
export PETSC_DIR=@PETSC_INSTALL@
export PETSC_ARCH=@PETSC_ARCH@
export PETSC_INCLUDES=@PETSC_INCLUDES_INSTALL@