virtual double operator ()( int i, int j ) const = 0;
+ double max() const;
+
+ double min() const;
+
virtual bool isSymmetric(double tol=1e-6) const ;
bool isSquare() const ;
return (-1);
}
+
+double
+GenericMatrix::max() const
+{
+ return _values.max();
+}
+
+
+double
+GenericMatrix::min() const
+{
+ return _values.max();
+}
+
+
void
GenericMatrix::view() const
{
void setFieldByDataArrayDouble ( const MEDCoupling::DataArrayDouble* array );
- DoubleTab getNormEuclidean( void ) const ;
+ Vector getNormEuclidean( void ) const ;
double max( int component=0 ) const ;
}
-DoubleTab
+Vector
Field::getNormEuclidean() const
{
- DoubleTab norm(getNumberOfElements(),_field->magnitude()->getArray()->getConstPointer());
- return norm;
+ Vector result(_numberOfComponents);
+ DoubleTab norm(_numberOfComponents,_field->magnitude()->getArray()->getConstPointer());
+ result.setValues(norm);
+
+ return result;
}
double
Field::max(int component) const
{
- if( component >= getNumberOfComponents() )
- throw CdmathException("double Field::max() : component number should be smaller than field number of components");
+ if( component >= getNumberOfComponents() || component < 0)
+ throw CdmathException("double Field::max() : component number should be between 0 and the field number of components");
double result=-1e100;
for(int i=0; i<getNumberOfElements() ; i++)
double
Field::min(int component) const
{
- if( component >= getNumberOfComponents() )
- throw CdmathException("double Field::min() : component number should be smaller than field number of components");
+ if( component >= getNumberOfComponents() || component < 0)
+ throw CdmathException("double Field::min() : component number should be between 0 and the field number of components");
double result=1e100;
for(int i=0; i<getNumberOfElements() ; i++)
//----------------------------------------------------------------------
{
int nbComp=_field->getNumberOfComponents();
- int nbElems=getNumberOfElements();
-
- Vector result(nbComp);//Vector containing the Linfinity norm of each component
+ double res[nbComp];//Pointer containing the L2 norm of each component
+ _field->normMax(res);
+ Vector result(nbComp);//Vector containing the L2 norm of each component
- for(int i=0; i<nbElems ; i++)
- for(int j=0; j<nbComp ; j++)
- if(fabs((*this)(i,j))>result(j))
- result(j)=fabs((*this)(i,j));
+ for(int i=0; i<nbComp ; i++)
+ result(i)=res[i];
return result;
}
def Extract_field_data_over_line_to_numpyArray(field, point1, point2, resolution):
inputFileName = field.getName()#os.getcwd()+field.get_name()
- field.writeVTK(inputFileName)
+ inputFileName_removeSpaces=inputFileName.replace(" ", "")
+ field.writeVTK(inputFileName_removeSpaces)
- numpy_array = Extract_VTK_data_over_line_to_numpyArray(inputFileName+"_1.vtu", point1, point2, resolution)
+ numpy_array = Extract_VTK_data_over_line_to_numpyArray(inputFileName_removeSpaces+"_0.vtu", point1, point2, resolution)
- os.remove(inputFileName+"_1.vtu")
+ os.remove(inputFileName_removeSpaces+"_0.vtu")
return numpy_array
def Extract_field_data_over_line_to_txt_file(field, point1, point2, resolution, outputFileName):
plane.SetOrigin(point)
plane.SetNormal(normal)
- cutter = vtk.vtkFiltersCorePython.vtkCutter()
+ cutter = vtk.vtkCutter()
cutter.SetCutFunction(plane)
cutter.SetInputConnection(reader.GetOutputPort())
cutter.Update()
inputFileName = field.getName()
field.writeVTK(inputFileName)
- numpy_array = Slice_VTK_data_to_numpyArray(inputFileName+"_1.vtu", point, normal, resolution)
+ numpy_array = Slice_VTK_data_to_numpyArray(inputFileName+"_0.vtu", point, normal, resolution)
- os.remove(inputFileName+"_1.vtu")
+ os.remove(inputFileName+"_0.vtu")
return numpy_array
def Slice_field_data_to_txt_file(field, outputFileName,
plane.SetOrigin(point)
plane.SetNormal(normal)
- cutter = vtk.vtkFiltersCorePython.vtkCutter()
+ cutter = vtk.vtkCutter()
cutter.SetCutFunction(plane)
cutter.SetInputConnection(reader.GetOutputPort())
cutter.Update()
)
SET(_extra_lib_TESTS linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS -DCDMATH_WITH_PETSC)
- SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/base/lib:${CMAKE_BINARY_DIR}/mesh/lib:${CMAKE_BINARY_DIR}/linearsolver/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib )
+ SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/CDMATH/base/lib:${CMAKE_BINARY_DIR}/CDMATH/mesh/lib:${CMAKE_BINARY_DIR}/CDMATH/linearsolver/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib )
else (CDMATH_WITH_PETSC)
SET(_extra_lib_TESTS)
SET_TARGET_PROPERTIES(TestCDMATH PROPERTIES COMPILE_FLAGS "")
- SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/base/lib:${CMAKE_BINARY_DIR}/mesh/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib )
+ SET(TESTS_LIBRARY_PATH ${CMAKE_BINARY_DIR}/CDMATH/base/lib:${CMAKE_BINARY_DIR}/CDMATH/mesh/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT}/lib )
endif(CDMATH_WITH_PETSC)
if (CDMATH_WITH_PYTHON)
- SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/swig:${CMAKE_BINARY_DIR}/postprocessing )
+ SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/CDMATH/swig:${CMAKE_BINARY_DIR}/CDMATH/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med )
endif(CDMATH_WITH_PYTHON)
TARGET_LINK_LIBRARIES(TestCDMATH TestMesh base mesh ${CPPUNIT_LIBS} ${_extra_lib_TESTS})
ADD_SUBDIRECTORY(ressources)
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
../ressources/meshCube.med
)
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/CDMATH/tests)
if (CDMATH_WITH_PETSC)
FILE(GLOB TestMesh_SOURCES . *.cxx)
SET(CFL 1 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleHeatEquation_1DFV_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
SET(CFL 2 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleHeatEquation_1DFV_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
endif (CDMATH_WITH_PYTHON )
#Ajout de la contribution de la cellule i au second membre du noeud j
RHS[j_int]=Ci.getMeasure()/2*my_RHSfield[j]+RHS[j_int] # intégrale sur le segment du produit f x fonction de base
#Contribution de la cellule i à la ligne j_int du système linéaire
- for k in [nodeId0,nodeId1] :
+ for k in [nodeId0,nodeId1] :
if boundaryNodes.count(k)==0 : #seuls les noeuds intérieurs contribuent à la matrice du système linéaire
k_int=interiorNodes.index(k)#indice du noeud k en tant que noeud intérieur
Rigidite.addValue(j_int,k_int,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
plt.xlabel('Position')
plt.ylabel('Value')
plt.title('1D finite elements \n for Laplace operator')
-plt.savefig("FiniteElements1DPoisson_ResultField_"+str(nbNodes) + '_nodes'+".png")
+plt.savefig('FiniteElements1DPoisson_ResultField_'+str(nbNodes) + '_nodes'+'.png')
print("Numerical solution of the 1D Poisson equation using finite elements done")
Ck=my_mesh.getCell(k)
distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
coeff=Fj.getMeasure()/Ci.getMeasure()/distance
- Rigidite.setValue(i,k,-coeff) # terme extradiagonal
+ Rigidite.addValue(i,k,-coeff) # terme extradiagonal
else:
coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter())
#For the particular case where the mesh boundary does not coincide with the domain boundary
if(test_bc=="Periodic"):
print( "Mass loss: ", (total_mass_initial-unknown_field.integral()).norm(), " precision required= ", precision )
assert (total_mass_initial-unknown_field.integral()).norm()<precision
- print "------------------------------------------------------------------------------------"
+ print( "------------------------------------------------------------------------------------")
unknown_field.setTime(time,0);
unknown_field.writeVTK("TransportEquation"+str(dim)+"DUpwind"+meshName+"_Stat");
#Postprocessing : save 2D picture
PV_routines.Save_PV_data_to_picture_file("TransportEquation"+str(dim)+"DUpwind"+meshName+"_Stat"+'_0.vtu',"unknown",'CELLS',"TransportEquation"+str(dim)+"DUpwind"+meshName+"_Stat")
- return nbCells, time, it, unknown_field.getNormEuclidean().max(), diag_data_u
+ return nbCells, time, it, unknown_field.getNormEuclidean().max(), diag_data_u
else:
print( "Temps maximum Tmax= ", tmax, " atteint" )
raise ValueError("Maximum time reached : Stationary state not found !!!!!!!")
print( "Exact solution minimum : ", min(u_initial), "Numerical solution minimum : ", min(u) )
print( "Exact solution maximum : ", max(u_initial), "Numerical solution maximum : ", max(u) )
- print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ", np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
- print( "l1 numerical error : ", dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])
-
+ print( "Exact solution variation : ", np.sum([abs(u_initial[i] - u_initial[(i-1)%nx]) for i in range(nx)]), "Numerical solution variation : ", np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]) )
+ print( "l1 numerical error : ", dx*np.sum([abs(u[i] - u_initial[i] ) for i in range(nx)]))
+
print( "Simulation of 1D transport equation with explicit centered scheme done" )
-
- #return min, max, total variation and l1 error
+
return min(u), max(u), np.sum([abs(u[i] - u[(i-1)%nx]) for i in range(nx)]), dx*np.sum([abs(u[i] - u_initial[i]) for i in range(nx)])
SET(CFL 1 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
SET(CFL 2 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
endif (CDMATH_WITH_PYTHON )
SET(CFL 1 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
SET(CFL 2 )#Courant Friedrichs Lewy number
ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL})
- SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
+ SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}")
SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${PV_PYTHON_DIR}")
../ressources/meshCube.med
)
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/swig)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/CDMATH/tests/swig)
ADD_TEST(TestsCDMATHSwig ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/mainTests.py)
if (CDMATH_WITH_PETSC)
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
+string(REPLACE ";" ":" PETSC_INCLUDES_INSTALL "${PETSC_INCLUDES}")# use colon instead of semicolon in environment file env_SOLVERLAB.sh
add_library(petsc SHARED IMPORTED)
set_property(TARGET petsc PROPERTY IMPORTED_LOCATION ${PETSC_LIBRARIES})
set( PARAVIEW_LIBRARIES_DIR ${PARAVIEW_ROOT_DIR}/lib)
else( DEFINED PARAVIEW_ROOT_DIR)
set( PARAVIEW_INCLUDE_DIR /usr/include/paraview/)
- set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/)
+ set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/:/usr/lib64/vtk/:/usr/lib/vtk/)
endif( DEFINED PARAVIEW_ROOT_DIR)
#extraction of the paraview version"
SET(PYTHON2OR3 "2")
ENDIF( ${PARAVIEW_VERSION} STRGREATER "5.6" OR ${PARAVIEW_VERSION} STREQUAL "5.6" )
- set (PV_LIB_DIR /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:${PARAVIEW_LIBRARIES_DIR})
- set (PV_PYTHON_DIR /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/paraview/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk)
+ set (PV_LIB_DIR /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:/usr/lib64/python${PYTHON2OR3}.7/site-packages/vtk/:${PARAVIEW_LIBRARIES_DIR})
+ set (PV_PYTHON_DIR /usr/lib/python${PYTHON2OR3}.7/dist-packages/paraview/:/usr/lib64/python${PYTHON2OR3}.7/site-packages/vtk/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/paraview/:/usr/lib64/paraview/python${PYTHON2OR3}.7/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk)
# Find python
IF (${CMAKE_VERSION} VERSION_GREATER "3.12.0")
endif(NOT DOXYGEN_FOUND)
endif()
if (SOLVERLAB_WITH_TESTS) #
+ enable_testing ()
find_package (CPPUNIT REQUIRED)
endif()
find_package (XDR REQUIRED)
#!/bin/bash
export CDMATH_DIR=@CDMATH_INSTALL@
-source $CDMATH_DIR/env_CDMATH.sh
+source ${CMAKE_INSTALL_PREFIX}/env_SOLVERLAB.sh
export CoreFlows_INSTALL=@CMAKE_INSTALL_PREFIX@
export PETSC_DIR=@PETSC_DIR@
export COREFLOWS=$COREFLOWS_INSTALL/bin/Executable/COREFLOWSMainExe
export LD_LIBRARY_PATH=$COREFLOWS_INSTALL/lib:$CDMATH_INSTALL/lib:${PETSC_DIR}/${PETSC_ARCH}/lib:$PETSC_LIBRARIES:${MEDCOUPLING_LIBRARIES}:${MEDFILE_ROOT_DIR}/lib:$MEDFILE_LIBRARIES:${MEDFILE_C_LIBRARIES}:$PV_LIB_DIR:${LD_LIBRARY_PATH}
-export PYTHONPATH=$COREFLOWS_INSTALL/lib:$COREFLOWS_INSTALL/lib/coreflows:$COREFLOWS_INSTALL/bin/coreflows:$COREFLOWS_INSTALL/lib/python2.7/site-packages/salome:$CDMATH_INSTALL/lib/cdmath:$CDMATH_INSTALL/bin/cdmath:$CDMATH_INSTALL/bin/cdmath/postprocessing:$CDMATH_INSTALL/$PV_PYTHON_DIR:${PETSC_DIR}/${PETSC_ARCH}/lib:$PETSC_LIBRARIES:${MEDCOUPLING_LIBRARIES}:${MEDFILE_ROOT_DIR}/lib:$MEDFILE_LIBRARIES:${MEDFILE_C_LIBRARIES}:${PYTHONPATH}
+export PYTHONPATH=$COREFLOWS_INSTALL/lib:$COREFLOWS_INSTALL/lib/coreflows:$COREFLOWS_INSTALL/bin/coreflows:$COREFLOWS_INSTALL/lib/python3.7/site-packages/salome:$CDMATH_INSTALL/lib/cdmath:$CDMATH_INSTALL/bin/cdmath:$CDMATH_INSTALL/bin/cdmath/postprocessing:$CDMATH_INSTALL:$PV_PYTHON_DIR:${PETSC_DIR}/${PETSC_ARCH}/lib:$PETSC_LIBRARIES:${MEDCOUPLING_LIBRARIES}:${MEDFILE_ROOT_DIR}/lib:$MEDFILE_LIBRARIES:${MEDFILE_C_LIBRARIES}:${PYTHONPATH}
export COREFLOWSGUI=$COREFLOWS_INSTALL/bin/salome/COREFLOWS_Standalone.py