Commit 40c12dd7 authored by mozul's avatar mozul
Browse files

Merge commit 'e75b7a86'

Update sources for new user version
parents db83dca0 e75b7a86
...@@ -81,6 +81,21 @@ else() ...@@ -81,6 +81,21 @@ else()
endif() endif()
# Compiling with ExternalMBS library :
if(EXT_MBS_VERSION STREQUAL "none")
set(LMGC90_BINDINGS_MBS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/Std_ExternalMBS.f90)
set(LMGC90_BINDINGS_MBS_TARGET_LIBS)
add_library(lmgc_bindings_MBS ${LMGC90_BINDINGS_MBS_SRCS})
target_link_libraries(lmgc_bindings_MBS ${LMGC90_BINDINGS_MBS_TARGET_LIBS})
else()
find_package(ExternalMBS_FOR_LMGC REQUIRED)
message(STATUS "EXT_MBS binding found : ${EXT_MBS_F90_MODULE}")
message(STATUS "EXT_MBS libraries : ${LMGC90_BINDINGS_MBS_TARGET_LIBS}")
set(LMGC90_BINDINGS_MBS_SRCS ${EXT_MBS_F90_MODULE})
add_library(lmgc_bindings_MBS ${LMGC90_BINDINGS_MBS_SRCS})
target_link_libraries(lmgc_bindings_MBS ${LMGC90_BINDINGS_MBS_TARGET_LIBS} lmgc_core_shared)
endif()
#################################################################################### ####################################################################################
...@@ -115,22 +115,27 @@ end subroutine ...@@ -115,22 +115,27 @@ end subroutine
end subroutine end subroutine
!------------------------------------------------------------------------ !------------------------------------------------------------------------
!------------------------------------------------------------------------ !------------------------------------------------------------------------
subroutine externalFEM_compute_V(ibdyty,R,V) subroutine externalFEM_compute_V
implicit none implicit none
integer :: ibdyty
real(kind=8),dimension(:) :: R,V
! PEL calcule Vf=Vfree+M**-1 Reac ! PEL calcule Vf=Vfree+M**-1 Reac
! call PELcomputeV()
! !
! PEL met a jour les deplacements Xf = Xm + (h*theta*Vf)
! call PELupdateAfterNewtonIteration()
!
! call PELupdateAfterNewton()
! call PELcomputeV(ibdyty,R) end subroutine
!------------------------------------------------------------------------
!fp on recupere V !------------------------------------------------------------------------
subroutine externalFEM_get_V(ibdyty,V)
implicit none
integer :: ibdyty
real(kind=8),dimension(:) :: V
! call PELgetV(ibdyty,V) !call PELgetV(ibdyty,V)
end subroutine end subroutine
!------------------------------------------------------------------------ !------------------------------------------------------------------------
......
!>binding of an external mbs library
module ExternalMBS
implicit none
contains
!------------------------------------------------------------------------
!> Initialize the MBS library
subroutine initialize()
implicit none
end subroutine
!> Prepare libray for next time step
subroutine increment(tbegin)
implicit none
!> value of simulation time at the begining of the time step
real(kind=8), intent(in) :: tbegin
end subroutine
! debut boucle Newton
!> Compute the velocity of all multibody
subroutine compute_free_vlocy(h, theta)
implicit none
!> time step size
real(kind=8), intent(in) :: h
!> theta parameter for the theta-integration scheme
real(kind=8), intent(in) :: theta
end subroutine
!> Get nodes coordinates and local in detection configuration
subroutine update_nodes(i_mbs, coorTT, localFrameTT)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> coordinates in detection configuration
real(kind=8), dimension(:,:), pointer :: coorTT
!> local frame in detection configuration
real(kind=8), dimension(:,:), pointer :: localFrameTT
end subroutine
!> Nullify a reaction array
subroutine nullify_reac(i_mbs, storage)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> array to work on
integer(kind=4), intent(in) :: storage
end subroutine
!> Set a reaction array
subroutine add_reac(i_mbs, i_node, reac, storage)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> node index of multi-body
integer(kind=4), intent(in) :: i_node
!> reaction array
real(kind=8) , dimension(6), intent(in) :: reac
!> array to work on
integer(kind=4), intent(in) :: storage
end subroutine
!> Set a velocity array to zero
subroutine nullify_vlocy(i_mbs, storage)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> array to work on
integer(kind=4), intent(in) :: storage
end subroutine
!> Compute a velocity array
subroutine comp_vlocy(i_mbs, storage)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> array to work on
integer(kind=4), intent(in) :: storage
end subroutine
!> Get a velocity array
subroutine get_vlocy(i_mbs, i_node, vlocy, storage)
implicit none
!> multi-body index
integer(kind=4), intent(in) :: i_mbs
!> node index of multi-body
integer(kind=4), intent(in) :: i_node
!> velocity array
real(kind=8) , dimension(6), intent(inout) :: vlocy
!> array to work on
integer(kind=4), intent(in) :: storage
end subroutine
!> Compute displacements
subroutine compute_dof(h, theta)
implicit none
!> time step size
real(kind=8), intent(in) :: h
!> theta parameter for the theta-integration scheme
real(kind=8), intent(in) :: theta
end subroutine
! fin boucle newton
!> Update values at the end of time step
subroutine update_dof()
implicit none
! calcul nouvelle configuration
! update integration
end subroutine
!> Clean library
subroutine finalize()
implicit none
! on termine le calcul
end subroutine
end module
...@@ -264,7 +264,7 @@ contains ...@@ -264,7 +264,7 @@ contains
DO I = 1 , N DO I = 1 , N
CALL dcopy ( 3 , L , 1 , VECLRT(1,1,I) , 1 ) CALL dcopy ( 3 , L , 1 , VECLRT(1,1,I) , 1 )
! !
CALL dcopy ( 3 , XCOOR(1,N) , 1 , WRK , 1 ) CALL dcopy ( 3 , XCOOR(1,I) , 1 , WRK , 1 )
CALL daxpy ( 3 , MONE , P0 , 1 , WRK , 1 ) CALL daxpy ( 3 , MONE , P0 , 1 , WRK , 1 )
CALL dgemv ( 'N' , 3 , 3 , ONE , PROJ1 , 3 , WRK , 1 , & CALL dgemv ( 'N' , 3 , 3 , ONE , PROJ1 , 3 , WRK , 1 , &
ZERO , R , 1 ) ZERO , R , 1 )
......
...@@ -73,11 +73,16 @@ set_property(CACHE MATLIB_VERSION PROPERTY STRINGS ...@@ -73,11 +73,16 @@ set_property(CACHE MATLIB_VERSION PROPERTY STRINGS
"off" "default" "off" "default"
) )
set(EXT_FEM_VERSION "none" CACHE STRING "External FEM to use") set(EXT_FEM_VERSION "none" CACHE STRING "External FEM library to use")
set_property(CACHE EXT_FEM_VERSION PROPERTY STRINGS set_property(CACHE EXT_FEM_VERSION PROPERTY STRINGS
"none" "Xper" "none" "Xper"
) )
set(EXT_MBS_VERSION "none" CACHE STRING "External MBS library to use")
set_property(CACHE EXT_FEM_VERSION PROPERTY STRINGS
"none" "Robotran"
)
# options definition # options definition
option(WITH_NEW "With new simulation module of Core " OFF ) option(WITH_NEW "With new simulation module of Core " OFF )
option(WITH_SALADYN "With wrapper for coupling with Saladyn" OFF ) option(WITH_SALADYN "With wrapper for coupling with Saladyn" OFF )
...@@ -98,6 +103,7 @@ option(WITH_SICONOS_NUMERICS "Activate SiconosNumerics contact solvers use" ...@@ -98,6 +103,7 @@ option(WITH_SICONOS_NUMERICS "Activate SiconosNumerics contact solvers use"
option(WITH_MEDPRE "Look for med library and activate medpre reading features" OFF) option(WITH_MEDPRE "Look for med library and activate medpre reading features" OFF)
option(GFORTRAN44_PATCHING "Apply patch when using gfortran 4.4 (which is very buggy)" OFF) option(GFORTRAN44_PATCHING "Apply patch when using gfortran 4.4 (which is very buggy)" OFF)
option(NO_PYTHON_FRAMEWORK "On Darwin, do not use framework for Python library" OFF)
# Lapack options # Lapack options
set(MUMPS_VERSION "sequential" CACHE STRING "Use of MUMPS library" ) set(MUMPS_VERSION "sequential" CACHE STRING "Use of MUMPS library" )
...@@ -144,9 +150,9 @@ if(NOT ${MATLIB_VERSION} STREQUAL "off") ...@@ -144,9 +150,9 @@ if(NOT ${MATLIB_VERSION} STREQUAL "off")
find_package(MatLib_FOR_LMGC REQUIRED) find_package(MatLib_FOR_LMGC REQUIRED)
endif(NOT ${MATLIB_VERSION} STREQUAL "off") endif(NOT ${MATLIB_VERSION} STREQUAL "off")
if(WITH_MPI) if(WITH_MPI AND NOT ${MUMPS_VERSION} STREQUAL "none")
set(MUMPS_VERSION "parallel") set(MUMPS_VERSION "parallel")
endif(WITH_MPI) endif(WITH_MPI AND NOT ${MUMPS_VERSION} STREQUAL "none")
if(NOT ${MUMPS_VERSION} STREQUAL "none" AND NOT BUILD_MUMPS ) if(NOT ${MUMPS_VERSION} STREQUAL "none" AND NOT BUILD_MUMPS )
...@@ -231,6 +237,17 @@ if(BUILD_PRE) ...@@ -231,6 +237,17 @@ if(BUILD_PRE)
ADD_SUBDIRECTORY(pre_lmgc) ADD_SUBDIRECTORY(pre_lmgc)
endif(BUILD_PRE) endif(BUILD_PRE)
#copying gmshutils module to build directory
add_custom_target(gmshutils_module ALL
${CMAKE_COMMAND} -DDIR_TO_COPY=${CMAKE_SOURCE_DIR}/gmshutils -DDEST=${CMAKE_BINARY_DIR}/pylmgc90
-P ${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/modules/copy_py_module.cmake
)
if(${PYTHON_VERSION_MAJOR} EQUAL 3)
add_custom_command(TARGET pre_py_module POST_BUILD
COMMAND 2to3 ${CMAKE_BINARY_DIR}/pylmgc90/pre_lmgc -w -W -n --no-diffs
)
endif(${PYTHON_VERSION_MAJOR} EQUAL 3)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
add_subdirectory(Docs) add_subdirectory(Docs)
endif(DOXYGEN_FOUND) endif(DOXYGEN_FOUND)
......
...@@ -17,6 +17,7 @@ SET(LMGC90_PYTHON_LINK_LIBRARIES lmgc_python_shared ...@@ -17,6 +17,7 @@ SET(LMGC90_PYTHON_LINK_LIBRARIES lmgc_python_shared
lmgc_python_kernel_2d lmgc_python_kernel_2d
lmgc_python_contact_2d lmgc_python_contact_2d
lmgc_python_rigid_3d lmgc_python_rigid_3d
lmgc_python_mbs
lmgc_python_post_3d lmgc_python_post_3d
lmgc_python_kernel_3d lmgc_python_kernel_3d
lmgc_python_contact_3d lmgc_python_contact_3d
...@@ -70,9 +71,9 @@ if(BUILD_ChiPy) ...@@ -70,9 +71,9 @@ if(BUILD_ChiPy)
# preparing swig use # preparing swig use
include(${SWIG_USE_FILE}) include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_DIR} include_directories(${NUMPY_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/ChiPy ${PYTHON_INCLUDE_DIR}
${NUMPY_INCLUDE_DIR}) ${CMAKE_SOURCE_DIR}/ChiPy)
set(CMAKE_SWIG_FLAGS "") set(CMAKE_SWIG_FLAGS "")
...@@ -141,7 +142,7 @@ if(BUILD_ChiPy) ...@@ -141,7 +142,7 @@ if(BUILD_ChiPy)
# defining swig target # defining swig target
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/pylmgc90/chipy) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/pylmgc90/chipy)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chipy.i PROPERTIES CPLUSPLUS ON ) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chipy.i PROPERTIES CPLUSPLUS ON )
set(SWIG_MODULE_lmgc90_EXTRA_DEPS ${NUMPY_DOT_I}) set(SWIG_MODULE_lmgc90_EXTRA_DEPS ${NUMPY_DOT_I} ${headers_list})
SWIG_ADD_MODULE(lmgc90 python ${CMAKE_CURRENT_BINARY_DIR}/chipy.i) SWIG_ADD_MODULE(lmgc90 python ${CMAKE_CURRENT_BINARY_DIR}/chipy.i)
add_dependencies(${SWIG_MODULE_lmgc90_REAL_NAME} chipy_swig_docstrings) add_dependencies(${SWIG_MODULE_lmgc90_REAL_NAME} chipy_swig_docstrings)
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include "src/rigid_3D/wrap_RBDY3.h" #include "src/rigid_3D/wrap_RBDY3.h"
#include "src/rigid_3D/wrap_SPHER.h" #include "src/rigid_3D/wrap_SPHER.h"
#include "src/mbs/wrap_mbs.h"
#include "src/mailx/wrap_ALpxx.h" #include "src/mailx/wrap_ALpxx.h"
#include "src/mailx/wrap_ASpxx.h" #include "src/mailx/wrap_ASpxx.h"
#include "src/mailx/wrap_CLxxx.h" #include "src/mailx/wrap_CLxxx.h"
...@@ -429,6 +431,8 @@ import_array(); ...@@ -429,6 +431,8 @@ import_array();
%include "src/rigid_3D/wrap_RBDY3.h" %include "src/rigid_3D/wrap_RBDY3.h"
%include "src/rigid_3D/wrap_SPHER.h" %include "src/rigid_3D/wrap_SPHER.h"
%include "src/mbs/wrap_mbs.h"
%include "src/mailx/wrap_ALpxx.h" %include "src/mailx/wrap_ALpxx.h"
%include "src/mailx/wrap_ASpxx.h" %include "src/mailx/wrap_ASpxx.h"
%include "src/mailx/wrap_CLxxx.h" %include "src/mailx/wrap_CLxxx.h"
......
...@@ -7,6 +7,7 @@ ADD_SUBDIRECTORY(contact_3D) ...@@ -7,6 +7,7 @@ ADD_SUBDIRECTORY(contact_3D)
ADD_SUBDIRECTORY(rigid_2D) ADD_SUBDIRECTORY(rigid_2D)
ADD_SUBDIRECTORY(rigid_3D) ADD_SUBDIRECTORY(rigid_3D)
add_subdirectory(mbs)
ADD_SUBDIRECTORY(kernel) ADD_SUBDIRECTORY(kernel)
......
...@@ -63,6 +63,8 @@ module wrap_CLALp ...@@ -63,6 +63,8 @@ module wrap_CLALp
get_nb_vCLALp, & get_nb_vCLALp, &
get_all_CLALp, & get_all_CLALp, &
get_all_internal_CLALp, & get_all_internal_CLALp, &
get_icdtac_CLALp, &
get_iantac_CLALp, &
! display_contact_energy_CLALp, & ! display_contact_energy_CLALp, &
! display_contact_internal_CLALp, & ! display_contact_internal_CLALp, &
! get_icdbdy_CLALp, & ! get_icdbdy_CLALp, &
...@@ -228,12 +230,13 @@ contains ...@@ -228,12 +230,13 @@ contains
!!!---------------------------------------------------- !!!----------------------------------------------------
subroutine ReadIniVlocRloc() bind(c, name='CLALp_ReadIniVlocRloc') subroutine ReadIniVlocRloc(step) bind(c, name='CLALp_ReadIniVlocRloc')
implicit none implicit none
integer(c_int), intent(in), value :: step
if( .not. check_CLALp() ) return if( .not. check_CLALp() ) return
call read_ini_Vloc_Rloc_CLALp call read_ini_Vloc_Rloc_CLALp(step)
end subroutine end subroutine
...@@ -328,6 +331,22 @@ contains ...@@ -328,6 +331,22 @@ contains
end subroutine GetAllInternalCLALp end subroutine GetAllInternalCLALp
function GetCandidatTactId(icdan) bind(c, name='CLALp_GetCandidatTactId')
implicit none
integer(c_int), intent(in), value :: icdan
integer(c_int) :: GetCandidatTactId
GetCandidatTactId = get_icdtac_CLALp(icdan)
end function
function GetAntagonistTactId(icdan) bind(c, name='CLALp_GetAntagonistTactId')
implicit none
integer(c_int), intent(in), value :: icdan
integer(c_int) :: GetAntagonistTactId
GetAntagonistTactId = get_iantac_CLALp(icdan)
end function
subroutine CleanMemory() bind(c, name='CLALp_CleanMemory') subroutine CleanMemory() bind(c, name='CLALp_CleanMemory')
implicit none implicit none
......
...@@ -134,16 +134,27 @@ ...@@ -134,16 +134,27 @@
extern "C" void CLALp_DisplayProxTactors(void); extern "C" void CLALp_DisplayProxTactors(void);
/** /**
* @fn void CLALp_ReadIniVlocRloc(void) * @fn void CLALp_ReadIniVlocRloc(int step=0)
* @brief read file Vloc_Rloc.INI in DATBOX * @brief Read VlocRloc file
*
* If step <= 0 : DATBOX/VlocRloc.INI file is read
* Else : OUTBOX/VlocRloc.OUT.num is read, num being
* the parameter used in TimeEvolution_ReadIniVlocRloc
* last call
* *
* @cond PYDOC * @cond PYDOC
* python usage : CLALp_ReadIniVlocRloc() * usage : CLALp_ReadIniVlocRloc(step=0)
* @param[in] step (integer) : which VlocRloc file to read
* @endcond
*
* @cond CDOC
* @param[in] step (int) : which VlocRloc file to read
* @endcond * @endcond
*
*/ */
extern "C" void CLALp_ReadIniVlocRloc(void); extern "C" void CLALp_ReadIniVlocRloc(int step=0);
/** /**
* @fn void CLALp_SetNonSymetricDetection(void); * @fn void CLALp_SetNonSymetricDetection(void);
* @brief this function allows non symetric detection i.e. only one * @brief this function allows non symetric detection i.e. only one
* interaction is kept when two bodies with candidate and antagonist * interaction is kept when two bodies with candidate and antagonist
...@@ -260,6 +271,40 @@ ...@@ -260,6 +271,40 @@
*/ */
extern "C" void CLALp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2); extern "C" void CLALp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2);
/**
* @fn int CLALp_GetCandidatTactId(int icdan)
* @brief return the candidate contactor index for the icdan CLALp contact
*
* @cond PYDOC
* python usage : icdtac = CLALp_GetCandidatTacId(icdan)
* @param[in] icdan (integer) : CLALp contact index
* @return icdtac (integer) : candidate contactor index
* @endcond
*
* @cond CDOC
* @param[in] icdan (int) : CLALp contact index
* @return icdtac (int) : candidate contactor idenx
* @endcond
*/
extern "C" int CLALp_GetCandidatTactId(int icdan);
/**
* @fn int CLALp_GetAntagonistTactId(int icdan)
* @brief return the antagonist contactor index for the icdan CLALp contact
*
* @cond PYDOC
* python usage : iantac = CLALp_GetAntagonistTactId(icdan)
* @param[in] icdan (integer) : CLALp contact idenx
* @return iantac (integer) : antagonist contactor index
* @endcond
*
* @cond CDOC
* @param[in] icdan (int) : CLALp contact index
* @return iantac (int) : antagonist contactor index
* @endcond
*/
extern "C" int CLALp_GetAntagonistTactId(int icdan);
/** /**
* @fn void CLALp_CleanMemory(void) * @fn void CLALp_CleanMemory(void)
* @brief Free all memory allocated within CLALp module * @brief Free all memory allocated within CLALp module
......
...@@ -58,6 +58,8 @@ module wrap_CLJCx ...@@ -58,6 +58,8 @@ module wrap_CLJCx
get_write_Vloc_Rloc_CLJCx,& get_write_Vloc_Rloc_CLJCx,&
get_nb_vCLJCx, & get_nb_vCLJCx, &
get_all_CLJCx, & get_all_CLJCx, &
get_icdtac_CLJCx, &
get_iantac_CLJCx, &
clean_memory_CLJCx clean_memory_CLJCx
use utilities, only : faterr use utilities, only : faterr
...@@ -169,14 +171,15 @@ contains ...@@ -169,14 +171,15 @@ contains
end subroutine DisplayProxTactors end subroutine DisplayProxTactors
subroutine ReadIniVlocRloc() bind(c, name='CLJCx_ReadIniVlocRloc') subroutine ReadIniVlocRloc(step) bind(c, name='CLJCx_ReadIniVlocRloc')
implicit none implicit none
integer(c_int), intent(in), value :: step
if( .not. CHECK_CLJCx() ) return if( .not. check_CLJCx() ) return
call read_ini_Vloc_Rloc_CLJCx call read_ini_Vloc_Rloc_CLJCx(step)
end subroutine ReadIniVlocRloc end subroutine
function GetNbCLJCx() bind(c, name='CLJCx_GetNbCLJCx') function GetNbCLJCx() bind(c, name='CLJCx_GetNbCLJCx')
implicit none implicit none
...@@ -214,6 +217,22 @@ contains ...@@ -214,6 +217,22 @@ contains
end subroutine GetAllCLJCx end subroutine GetAllCLJCx
function GetCandidatTactId(icdan) bind(c, name='CLJCx_GetCandidatTactId')
implicit none
integer(c_int), intent(in), value :: icdan
integer(c_int) :: GetCandidatTactId
GetCandidatTactId = get_icdtac_CLJCx(icdan)
end function
function GetAntagonistTactId(icdan) bind(c, name='CLJCx_GetAntagonistTactId')
implicit none
integer(c_int), intent(in), value :: icdan
integer(c_int) :: GetAntagonistTactId
GetAntagonistTactId = get_iantac_CLJCx(icdan)
end function
subroutine CleanMemory() bind(c, name='CLJCx_CleanMemory') subroutine CleanMemory() bind(c, name='CLJCx_CleanMemory')
implicit none implicit none
......
...@@ -125,14 +125,25 @@ ...@@ -125,14 +125,25 @@
extern "C"