diff --git a/host-configs/LLNL/lassen-gcc-8-cuda-11.cmake b/host-configs/LLNL/lassen-gcc-8-cuda-11.cmake index 3e9fd6783d..571f7b1563 100644 --- a/host-configs/LLNL/lassen-gcc-8-cuda-11.cmake +++ b/host-configs/LLNL/lassen-gcc-8-cuda-11.cmake @@ -16,4 +16,8 @@ set(MPI_Fortran_COMPILER ${MPI_HOME}/bin/mpifort CACHE PATH "") set(ENABLE_CUDA_NVTOOLSEXT ON CACHE BOOL "") +# PYGEOSX +set(ENABLE_PYGEOSX ON CACHE BOOL "") +set(Python3_EXECUTABLE /usr/gapps/GEOSX/thirdPartyLibs/python/python3-lassen/python/bin/python CACHE PATH "") + include(${CMAKE_CURRENT_LIST_DIR}/lassen-base.cmake) diff --git a/src/coreComponents/functions/CMakeLists.txt b/src/coreComponents/functions/CMakeLists.txt index 8fb39ce419..2f9591f498 100644 --- a/src/coreComponents/functions/CMakeLists.txt +++ b/src/coreComponents/functions/CMakeLists.txt @@ -24,6 +24,7 @@ set( functions_headers FunctionBase.hpp FunctionManager.hpp TableFunction.hpp + SymbolicFunction.hpp ) # @@ -33,15 +34,14 @@ set( functions_sources FunctionBase.cpp FunctionManager.cpp TableFunction.cpp + SymbolicFunction.cpp MultivariableTableFunction.cpp ) if( ENABLE_MATHPRESSO ) list( APPEND functions_headers - SymbolicFunction.hpp CompositeFunction.hpp ) list( APPEND functions_sources - SymbolicFunction.cpp CompositeFunction.cpp ) endif() diff --git a/src/coreComponents/functions/SymbolicFunction.cpp b/src/coreComponents/functions/SymbolicFunction.cpp index 26ae27b1be..70614b32db 100644 --- a/src/coreComponents/functions/SymbolicFunction.cpp +++ b/src/coreComponents/functions/SymbolicFunction.cpp @@ -36,9 +36,12 @@ using namespace dataRepository; SymbolicFunction::SymbolicFunction( const string & name, Group * const parent ): - FunctionBase( name, parent ), + FunctionBase( name, parent ) + #ifdef GEOS_USE_MATHPRESSO + , parserContext(), - parserExpression() + parserExpression(), + #endif { registerWrapper( keys::variableNames, &m_variableNames ). setRTTypeName( rtTypes::CustomTypes::groupNameRefArray ). @@ -56,6 +59,8 @@ SymbolicFunction::SymbolicFunction( const string & name, SymbolicFunction::~SymbolicFunction() {} + +#ifdef GEOS_USE_MATHPRESSO class GeosxMathpressoLogger : public mathpresso::OutputLog { public: @@ -106,9 +111,11 @@ class GeosxMathpressoLogger : public mathpresso::OutputLog std::ostringstream m_stream; }; +#endif void SymbolicFunction::initializeFunction() { + #ifdef GEOS_USE_MATHPRESSO // Register variables for( localIndex ii=0; ii +#endif namespace geos { @@ -73,7 +74,12 @@ class SymbolicFunction : public FunctionBase */ inline real64 evaluate( real64 const * const input ) const override final { + #ifdef GEOSX_USE_MATHPRESSO return parserExpression.evaluate( reinterpret_cast< void * >( const_cast< real64 * >(input) ) ); + #else + GEOSX_ERROR( "SymbolicFunction evaluation is not enabled in this build of GEOSX" ); + return 0.0; + #endif } @@ -92,9 +98,11 @@ class SymbolicFunction : public FunctionBase private: + #ifdef GEOSX_USE_MATHPRESSO // Symbolic math driver objects mathpresso::Context parserContext; mathpresso::Expression parserExpression; + #endif /// Symbolic expression variable names string_array m_variableNames;