Commit 6c30b9ae authored by mozul's avatar mozul
Browse files

Squashed 'src/' changes from 80af6d1..c31a22e

c31a22e Merge branch 'rc2015' of git-xen.lmgc.univ-montp2.fr:lmgc90/lmgc90_dev into rc2015
c74be7a put back extrudeRigids routine accidentally removed from pre_lmgc
c92a255 modif du wrap pour mp rigid
86b5389 Merge branch 'PU_solveur_jacobi_3D' into 'dev'
24d8422 Resolution de conflit pour le solveur jacobi
e9384cf Merge branch 'PU_mecamailx_get_pointer' into 'dev'
1da8e3a Merge branch 'PU_bug_correction' into 'dev'
ab71b19 Bug correction : L'appel de get_all_clalp ou de get_all_internal_clalp par le script python conduit à une segementation fault si il n'y a pas de clalp Le return doit etre tester sur nb_vclalp qui dimensionne le pointeur et non sur nb_clalp
0f027f8 Merge branch 'new_fix_czm' into 'dev'
58103ab correction bug ABP 2D + modif dans gestion du initial_friction des czm
c21c9a0 Merge branch 'modif_pre' into 'dev'
7df9bcf je vire le print de merde
a85c569 ajout d'un shrink dans rigidsFromMesh2D
e5aa2e2 Modification dans mecamailx de GetPtr en GetPtrBodyVector Ajout des éléments nécessaires dans parameters Suppression des éléments redontants dans overall
7dcbe2a Merge remote-tracking branch 'origin/dev' into PU_mecamailx_get_pointer
238185b Merge branch 'fix_Vth' into 'dev'
e14a4ca correction bug dans gestion dilatation thermique des DISKx & typo dans POLYG
0857e0e Merge branch 'tst_rtree' into 'dev'
eff817b Merge branch 'tst_rtree' of git-xen.lmgc.univ-montp2.fr:lmgc90/lmgc90_dev into tst_rtree
04b6116 modifs suite au remarques de Remy Mozul
04cca72 modif rtree
e428ad9 modif rtree
662f35d Merge branch 'fix' into 'dev'
c183fba Merge branch 'vtk_fix' into 'dev'
5ddcafc add accessor on xKSID for couette example coupled with gmsh
0ddba49 Merge branch 'ddm_fix' into 'dev'
d89aaf4 fix forgotten get_ptr_xxx call changes in ddm modules
d9ec4f2 fix introduced bug in previous commit
46c0cef correction in WriteDisplayFile API to add user field
46e9339 Merge branch 'extractContour_pre2D' into 'dev'
840beb6 Merge branch 'fix_PLPLx' into 'dev'
34b04be fix of a comment
6a7ac8f ajout fonction extraction contour en 2D
d12bc12 Merge branch 'fix_pre' into 'dev'
61d2cc5 correction de petites erreurs et typo du pre
5baaffb Merge branch 'PU_get_all_internal' into 'dev'
32cf755 Merge branch 'PU_vtk_display' into 'dev'
6084eff Merge branch 'openmp_fix' into 'dev'
0488cb0 compilation bug correction with openMP
dcf109f Merge branch 'yales' into 'dev'
0a7e0b1 Merge branch 'fix' into 'dev'
f44f804 Change name from get_xxx_ptr to get_ptr_xxx
48e060c using integer parameter instead of 10 characters string DIME
94dbb8b Changement du nom get_pointer_mecamailx en get_ptr_mecamailx Passage de l'identifiant du champ par entier plutot que par chaine de caractères Ajout des identifiants necessaires dans overall Ajout d'un wrapper
5b73113 Création d'un pointeur vers les différents champs de mod_mecamailx, afin de pouvoir y accéder et les modifier sans allocation.
243ab89 Ajout de fonctions permettant de recupérer les valeurs de "internal" pour les contacts de type CLALp et CSASp Ces fonctions sont utilisable dans les jeu de données pour pouvoir par exemple ajouter le champ "beta" aux sorties paraview lors des calculs avec zones cohésives.
3d125d3 Merge branch 'fix' into 'dev'
f9c9712 no longer taking into account invisible bodies when computing equilibrium state
107233c Merge branch 'dev_renouf' into 'dev'
9f90d00 mr:mauvaise initialisation dans les conditions limites
685e457 Ajout des sorties VTK pour Xper en 3D
1223295 Merge remote-tracking branch 'origin/dev' into PU_vtk_display
1cd6c7d possibility to compute only Fint in mecaMAILx_compute_bulk with MOREAU scheme
64ed47c  Déplacement des .pvd dans DISPLAY  Concaténation des .pvd en DDM
256b0b1 Merge branch 'ddm_concatenate_outbox' into 'dev'
8d1f66d Merge avec la branche dev
4c9fa02 Merge branch 'cmake' into 'dev'
6369c22 correction for correct git branch check
cede578 Merge branch 'cmake' into 'dev'
d8e39e8 check git branch differences when invoking make
59e6130 Modifications dans ddm_utils de concatenate_outbox() :
0150a02 correct typo in cmake warning
578b391 Merge branch 'cmake' into 'dev'
65fc483 Modification sur ddm_utils.py
7d697a7 remove warning on MACOS relating to RPATH
95804c6 add cmake variable to check compiled git branch
6c4f46b modele poiseuille dans elements erodes
ee6ff07 Modifications dans ddm_utils de concatenate_outbox() :    - Ajout des GPV    - Factorisation de la fonction de concatenation    - La concatenation n'est effectuée que si les fichiers sont présents

git-subtree-dir: src
git-subtree-split: c31a22e1cf64f32dee78465e36713200a795a0c2
parent 6b2f909b
......@@ -8,13 +8,49 @@ if( CMAKE_MAJOR_VERSION EQUAL 2 )
endif( CMAKE_MINOR_VERSION EQUAL 8 )
endif( CMAKE_MAJOR_VERSION EQUAL 2 )
project(LMGC90v2_dev Fortran C CXX)
project(LMGC90_dev Fortran C CXX)
SET(LMGC90_MAJOR_VERSION 2)
SET(LMGC90_MINOR_VERSION 0)
SET(LMGC90_PATCH_VERSION 0)
MESSAGE(STATUS "You try to build LMGC90_dev version 2")
MESSAGE(STATUS "You try to build LMGC90_dev")
find_package(Git)
# check if git branch changed between cmake calls
if(${GIT_FOUND})
execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_CURRENT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if( NOT DEFINED GIT_BRANCH )
message(STATUS "Building ${GIT_BRANCH} git branch")
else( NOT DEFINED GIT_BRANCH )
if( GIT_BRANCH STREQUAL GIT_CURRENT_BRANCH )
message(STATUS "Building ${GIT_BRANCH} git branch")
else( GIT_BRANCH STREQUAL GIT_CURRENT_BRANCH )
message(STATUS "[WARNING] building git branch ${GIT_CURRENT_BRANCH},
but branch ${GIT_BRANCH} was previously used")
endif( GIT_BRANCH STREQUAL GIT_CURRENT_BRANCH)
endif( NOT DEFINED GIT_BRANCH )
set(GIT_BRANCH ${GIT_CURRENT_BRANCH} CACHE STRING "last gitbranch used" FORCE)
# check if git branch changed between cmake and make calls
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/get_git_branch.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/get_git_branch.cmake
@ONLY
)
add_custom_target( get_git_branch ALL
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/get_git_branch.cmake
)
endif(${GIT_FOUND})
if(NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 0)
endif(NOT DEFINED CMAKE_MACOSX_RPATH)
# path to homemade/taken macros/finds
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/tools/cmake/modules ${CMAKE_MODULE_PATH})
......
......@@ -62,6 +62,7 @@ module wrap_CLALp
trim_CLALp, &
get_nb_vCLALp, &
get_all_CLALp, &
get_all_internal_CLALp, &
! display_contact_energy_CLALp, &
! display_contact_internal_CLALp, &
! get_icdbdy_CLALp, &
......@@ -305,6 +306,27 @@ contains
end if
end subroutine GetAllCLALp
subroutine GetAllInternalCLALp(ptr, dim1, dim2) bind(c, name='CLALp_GetAllInternal')
implicit none
type(c_ptr) :: ptr
integer(c_int) :: dim1, dim2
real(kind=8), dimension(:,:), pointer :: all
all => get_all_internal_clalp()
if( associated(all) ) then
ptr = c_loc(all(1,1))
dim1 = size(all,1)
dim2 = size(all,2)
else
ptr = c_null_ptr
dim1 = 0
dim2 = 0
end if
end subroutine GetAllInternalCLALp
subroutine CleanMemory() bind(c, name='CLALp_CleanMemory')
implicit none
......
......@@ -242,6 +242,23 @@
* @endcond
*/
extern "C" void CLALp_GetAll(double ** matrix_out, int * dim1, int * dim2);
/**
* @fn void CLALp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2)
* @brief return contact point internal variables
*
* @cond PYDOC
* python usage : array = CLALp_GetAllInternal()
* @return array (double 2D-array) : mechanical data
* @endcond
*
* @cond CDOC
* @param[in,out] matrix_out (double **) : xxx
* @param[in] dim1 (int *) i : matrix_out first dimension
* @param[in] dim2 (int *) : matrix_out second dimension
* @endcond
*/
extern "C" void CLALp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2);
/**
* @fn void CLALp_CleanMemory(void)
......
......@@ -59,6 +59,7 @@ MODULE wrap_CSASx
skip_autocontact_CSASp, &
get_nb_vCSASp , &
get_all_CSASp , &
get_all_internal_CSASp, &
clean_memory_CSASp
USE utilities, ONLY : faterr
......@@ -227,6 +228,27 @@ CONTAINS
end if
end subroutine GetAllCSASp
subroutine GetAllInternalCSASp(ptr, dim1, dim2) bind(c, name='CSASp_GetAllInternal')
implicit none
type(c_ptr) :: ptr
integer(c_int) :: dim1, dim2
real(kind=8), dimension(:,:), pointer :: all
all => get_all_internal_csasp()
if( associated(all) ) then
ptr = c_loc(all(1,1))
dim1 = size(all,1)
dim2 = size(all,2)
else
ptr = c_null_ptr
dim1 = 0
dim2 = 0
end if
end subroutine GetAllInternalCSASp
subroutine CleanMemory() bind(c, name='CSASp_CleanMemory')
implicit none
......
......@@ -192,6 +192,23 @@
* @endcond
*/
extern "C" void CSASp_GetAll(double ** matrix_out, int * dim1, int * dim2);
/**
* @fn void CSASp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2)
* @brief return contact point internal variables
*
* @cond PYDOC
* python usage : array = CSASp_GetAllInternal()
* @return array (double 2D-array) : mechanical data
* @endcond
*
* @cond CDOC
* @param[in,out] matrix_out (double **) : xxx
* @param[in] dim1 (int *) i : matrix_out first dimension
* @param[in] dim2 (int *) : matrix_out second dimension
* @endcond
*/
extern "C" void CSASp_GetAllInternal(double ** matrix_out, int * dim1, int * dim2);
/**
* @fn void CSASp_CleanMemory(void)
......
......@@ -45,7 +45,6 @@ MODULE wrap_NLGS_3D
USE NLGS_3D,ONLY:&
solve_nlgs, &
solve_nljacobi, &
comp_check_nlgs, &
write_norm_check_nlgs, &
scramble_nlgs, &
......@@ -62,7 +61,8 @@ MODULE wrap_NLGS_3D
active_diagonal_resolution, &
init_cohe_nlgs_3D, &
assume_is_initialized, &
display_tacinfo
display_tacinfo, &
use_jacobi_solver
logical :: with_quick_scramble = .FALSE.
......@@ -94,13 +94,15 @@ CONTAINS
!! Execute nb_iter NLGS iteration over the contact loop
integer(kind=4) :: ik
call use_jacobi_solver( .TRUE. )
do ik = 1, nb_iter
if (with_quick_scramble) CALL quick_scramble_nlgs
call solve_nljacobi(1)
call solve_nlgs(1)
nb_iter_in_module = nb_iter_in_module + 1
end do
call use_jacobi_solver( .FALSE. )
END SUBROUTINE
......@@ -145,7 +147,9 @@ CONTAINS
CALL prep_check_nlgs(iconv)
IF (iconv == 0 ) RETURN
CALL solve_nljacobi(i_check)
CALL use_jacobi_solver( .TRUE. )
CALL solve_nlgs(i_check)
CALL use_jacobi_solver( .FALSE. )
CALL comp_check_nlgs(iconv)
CALL write_norm_check_nlgs(2)
......@@ -258,7 +262,9 @@ CONTAINS
integer :: i_post = 3
!CALL LOGCHIC('NLGS_3D')
CALL RnodHRloc_nlgs
CALL solve_nlJacobi(i_post)
CALL use_jacobi_solver( .TRUE. )
CALL solve_nlgs(i_post)
CALL use_jacobi_solver( .FALSE. )
CALL Nullify_EntityList_nlgs
CALL write_norm_check_nlgs(3)
......@@ -471,6 +477,16 @@ CONTAINS
call display_tacinfo(ik)
END SUBROUTINE
SUBROUTINE UseJacobiSolver(jacobi) bind(C, name = 'nlgs_3D_UseJacobiSolver')
IMPLICIT NONE
LOGICAL(C_BOOL) ,INTENT(IN), VALUE :: jacobi
LOGICAL(KIND=4) :: jacobi_
jacobi_ = jacobi
call use_jacobi_solver( jacobi_ )
END SUBROUTINE
END MODULE wrap_NLGS_3D
......@@ -336,5 +336,19 @@
* @endcond
*/
extern "C" void nlgs_3D_DisplayTacInfo(int itac);
/**
* @fn void nlgs_3D_UseJacobiSolver(bool jacobi)
* @brief Use a Jacobi solver instead of Gauss Seidel solver
*
* @cond PYDOC
* usage : nlgs_3D_UseJacobiSolver(True) or nlgs_UseJacobiSolver(False)
* @endcond
*
* @cond CDOC
* @param[in] jacobi (boolean) : set to True to use a Jacobi solver
* @endcond
*/
extern "C" void nlgs_3D_UseJacobiSolver(bool jacobi);
#endif /* wrap_nlgs_3D_h */
......@@ -711,15 +711,16 @@ def ReadIniVlocRloc():
SPPLx_ReadIniVlocRloc()
SPSPx_ReadIniVlocRloc()
def ReadMpBehaviours(disper=0):
def ReadMpBehaviours(disper=0.,model='therm'):
"""Read and load multi-physics (for rigids) behaviours.
What is disper ?
"""
global DIMENSION
if DIMENSION == 2:
print 'here',model,disper
mp_solver_ReadMpBehaviour()
RBDY2_MP_LoadBehaviours(disper)
RBDY2_MP_LoadBehaviours(disper,model)
elif DIMENSION == 3:
mp_solver_3D_ReadMpBehaviour()
RBDY3_MP_LoadBehaviours(disper)
......@@ -1021,13 +1022,13 @@ def OpenDisplayFiles(ref_reac=0.):
global DIMENSION, is_vtk_display, fim, fin, fip, fiu, fit, fii, fir, tact_names, inter_names
if is_vtk_display :
wd = overall_GetWorkingDirectory()
fim = startCollection(os.path.join(wd,'mecafe.pvd'))
fin = startCollection(os.path.join(wd,'therfe.pvd'))
fip = startCollection(os.path.join(wd,'porofe.pvd'))
fiu = startCollection(os.path.join(wd,'multife.pvd'))
fit = startCollection(os.path.join(wd,'tacts.pvd'))
fii = startCollection(os.path.join(wd,'inter.pvd'))
fir = startCollection(os.path.join(wd,'rigids.pvd'))
fim = startCollection(os.path.join(wd,'DISPLAY','mecafe.pvd'))
fin = startCollection(os.path.join(wd,'DISPLAY','therfe.pvd'))
fip = startCollection(os.path.join(wd,'DISPLAY','porofe.pvd'))
fiu = startCollection(os.path.join(wd,'DISPLAY','multife.pvd'))
fit = startCollection(os.path.join(wd,'DISPLAY','tacts.pvd'))
fii = startCollection(os.path.join(wd,'DISPLAY','inters.pvd'))
fir = startCollection(os.path.join(wd,'DISPLAY','rigids.pvd'))
if DIMENSION == 2:
tact_names = ['DISKx', 'DISKx', 'DISPx', 'JONCx', 'POLYG', 'PT2Dx', 'xKSID', 'xPSID']
inter_names = ['CLALp', 'CLJCx', 'DKALp', 'DKDKL', 'DKDKx', 'DKDPx', 'DKJCx', 'DKKDx',
......@@ -1082,11 +1083,11 @@ def WriteDisplayFiles(freq=1,ref_radius=1.,**kw):
elif v[0] == 'multiFE':
multi_opt[k] = v[1:]
elif v[0] == 'tactor':
tact_opt[k] = v[1:]
tact_opt[k] = v[1]
elif v[0] == 'rigid':
rigid_opt[k] = v[1:]
rigid_opt[k] = v[1]
elif v[0] == 'inter':
inter_opt[k] = v[1:]
inter_opt[k] = v[1]
writeMecafeToVTK(os.path.join(wd,'DISPLAY','mecafe_'+str(wdf)+'.vtu'),fim,DIMENSION,**meca_opt)
writeTherfeToVTK(os.path.join(wd,'DISPLAY','therfe_'+str(wdf)+'.vtu'),fin,DIMENSION,**ther_opt)
......
......@@ -33,7 +33,6 @@ def concatenate_OUTBOX():
working_dir = lmgc90.overall_GetWorkingDirectory()
nb_DOF=0
nb_SDM=0
# Calcul du nombre de sous-domaines pour lesquels des sorties
......@@ -49,82 +48,84 @@ def concatenate_OUTBOX():
continue
nb_SDM=max(nb_SDM,n)
# Calcul du nombre de pas de temps pour lesquels des sorties
# .OUT sont effectuees en parallele.
for root, dirs, files in os.walk(os.path.join(working_dir,"DDM_WD_00001","OUTBOX"), topdown=False):
for myfile in files:
if not myfile.startswith("DOF.OUT."):
continue
T=myfile.split(".")
try:
n=int(T[2])
except Exception:
continue
nb_DOF=max(nb_DOF,n)
# Concatenation des DOF.OUT par sous-domaines en un seul DOF.OUT
# (pour chaque pas de sortie) dans le dossier OUTBOX_CAT.
for i in range(nb_DOF):
my_inputs=[]
for j in range(nb_SDM):
my_inputs.append(os.path.join(working_dir,"DDM_WD_"+"%(#)05d" % {"#": j+1},"OUTBOX","DOF.OUT."+str(i+1)))
my_output=open(os.path.join(working_dir,"OUTBOX","DOF.OUT."+str(i+1)), "w")
for my_file in my_inputs:
my_input=open(my_file, "r")
for line in my_input:
my_output.write(line)
my_input.close()
my_output.close()
# Concatenation des DOF.LAST par sous-domaines en un seul DOF.LAST
# dans le dossier OUTBOX.
my_inputs=[]
for j in range(nb_SDM):
my_inputs.append(os.path.join(working_dir,"DDM_WD_"+"%(#)05d" % {"#": j+1},"OUTBOX","DOF.LAST"))
my_output=open(os.path.join(working_dir,"OUTBOX","DOF.LAST"),"w")
for my_file in my_inputs:
my_input=open(my_file, "r")
for line in my_input:
my_output.write(line)
my_input.close()
my_output.close()
# Concatenation des Vloc_Rloc.OUT par sous-domaines en un seul Vloc_Rloc.OUT
# (pour chaque pas de sortie) dans le dossier OUTBOX.
for i in range(nb_DOF):
import glob
list_file = glob.glob( os.path.join(working_dir,"DDM_WD_00001","OUTBOX","DOF.*" ) )
list_file += glob.glob( os.path.join(working_dir,"DDM_WD_00001","OUTBOX","Vloc_Rloc.*" ) )
list_file += glob.glob( os.path.join(working_dir,"DDM_WD_00001","OUTBOX","GPV.*" ) )
begin = len( os.path.join(working_dir,"DDM_WD_00001","OUTBOX") ) + 1
for f in list_file :
filename = f[begin:]
#Concatenation des filename par sous-domaines en un seul filename
my_inputs=[]
for j in range(nb_SDM):
my_inputs.append(os.path.join("DDM_WD_"+"%(#)05d" % {"#": j+1},"OUTBOX","Vloc_Rloc.OUT."+str(i+1)))
my_output=open(os.path.join(working_dir,"OUTBOX","Vloc_Rloc.OUT."+str(i+1)),"w")
my_inputs.append(os.path.join("DDM_WD_"+"%(#)05d" % {"#": j+1},"OUTBOX",filename))
my_output=open(os.path.join(working_dir,"OUTBOX",filename),"w")
for my_file in my_inputs:
my_input=open(my_file, "r")
for line in my_input:
my_output.write(line)
my_input.close()
my_output.close()
def concatenate_DISPLAY():
"""
Create a paraview pvd format file in /DISPLAY
from all vtu or vtp display files located in /DDM_WD_*/DISPLAY
"""
import glob
# Concatenation des Vloc_Rloc.LAST par sous-domaines en un seul Vloc_Rloc.LAST
# dans le dossier OUTBOX.
my_inputs=[]
for j in range(nb_SDM):
my_inputs.append(os.path.join(working_dir,"DDM_WD_"+"%(#)05d" % {"#": j+1},"OUTBOX","Vloc_Rloc.LAST"))
my_output=open(os.path.join(working_dir,"OUTBOX","Vloc_Rloc.LAST"),"w")
for my_file in my_inputs:
my_input=open(my_file, "r")
for line in my_input:
my_output.write(line)
my_input.close()
working_dir = lmgc90.overall_GetWorkingDirectory()
# Calcul du nombre de pas de temps pour lesquels des sorties
# .vtu/.vtp sont effectuees en parallele.
nb_DOF = len( glob.glob("DDM_WD_00001/DISPLAY/mecafe_*") )
my_output.close()
# Calcul du nombre de sous-domaines pour lesquels des sorties
# paraview sont effectuees en parallele.
nb_SDM = len( glob.glob("DDM_WD_*") )
#Recherche des differents fichiers a concatener : mecafe, inters, etc.
my_fics = []
pvd_list = glob.glob("DDM_WD_00001/DISPLAY/*.pvd")
for f in pvd_list :
my_fics.append( f.replace("DDM_WD_00001/DISPLAY/","").replace(".pvd","") )
for fic in my_fics :
# Calcul du nombre de pas de temps pour lesquels des sorties
# .vtu/.vtp sont effectuees en parallele.
nb_out = len( glob.glob("DDM_WD_00001/DISPLAY/"+fic+"_*") )
if nb_out > 0 :
my_inputs=[]
my_output=open(os.path.join(working_dir,"DISPLAY",fic+".pvd"),"w")
my_output.write("<?xml version=\"1.0\"?>\n")
my_output.write("<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"LittleEndian\">\n")
my_output.write("<Collection>\n")
for j in range(nb_SDM):
my_file = os.path.join(working_dir,"DDM_WD_"+"%(#)05d" % {"#": j+1},'DISPLAY',fic+".pvd")
my_input=open(my_file, "r")
iline=0
for line in my_input:
iline += 1
if iline <=2:
#rien a faire
pass
elif iline ==3:
#on enleve les 12 premiers caracteres
line = line[12:]
line = line.replace("./","../DDM_WD_"+"%(#)05d" % {"#": j+1} + "/DISPLAY/")
my_output.write(line)
elif iline > nb_DOF+2:
#rien a faire
pass
else:
#on copie la ligne
line = line.replace("./","../DDM_WD_"+"%(#)05d" % {"#": j+1} + "/DISPLAY/")
my_output.write(line)
my_output.write("</Collection>")
my_output.write("</VTKFile>")
my_output.close()
\ No newline at end of file
......@@ -143,11 +143,11 @@ class TactorGenerator():
self.name=name
self.GetNb=eval(name+'_GetNb'+name)
if name in ['SPHER', 'POLYR', 'PLANx', 'CYLND', 'DNLYC', 'PT3Dx']:
self.GetTactor2Body=eval(name+'_Get'+name+'2RBDY3Ptr')
self.GetConnectivities=eval(name+'_GetAllConnectivitiesPtr')
self.GetTactor2Body=eval(name+'_GetPtr'+name+'2RBDY3')
self.GetConnectivities=eval(name+'_GetPtrAllConnectivities')
self.IsVisible=eval('RBDY3_IsVisible')
else:
self.GetTactor2Body=eval(name+'_Get'+name+'2RBDY2Ptr')
self.GetTactor2Body=eval(name+'_GetPtr'+name+'2RBDY2')
self.GetConnectivities=None
self.IsVisible=eval('RBDY2_IsVisible')
......@@ -497,7 +497,7 @@ def writeTactorsToVTK(fichier,fid,tacts_dict,**kw):
set_input_of_file(vtpFile, AppendAll)
vtpFile.Write()
time=TimeEvolution_GetTime()
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./DISPLAY/'+os.path.basename(fichier))
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./'+os.path.basename(fichier))
fid.write(impr)
......@@ -559,7 +559,7 @@ def pushInters2D(inters_dict,Append,lr,kw):
for name,dico in kw.items():
#print '-> ',name
if not key in dico:
print key,' not present in dictionary related to',name,' user field'
print key,' not present in dictionary related to ',name,' user field'
raise Exception
iinter=0
......@@ -1046,7 +1046,7 @@ def writeIntersToVTK(fichier,fid,inters_dict,lr,**kw):
vtpFile.Write()
time=TimeEvolution_GetTime()
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./DISPLAY/'+os.path.basename(fichier))
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./'+os.path.basename(fichier))
fid.write(impr)
def writeNewIntersToVTK(f_path,f_name,fid,lr,dim,**kw):
......@@ -1075,7 +1075,7 @@ def writeNewIntersToVTK(f_path,f_name,fid,lr,dim,**kw):
############################
# rigids
def pushRigid(Append,dim):
def pushRigid(Append,dim,kw):
#print 'managing: rigid'
......@@ -1197,20 +1197,33 @@ def pushRigid(Append,dim):
ug.GetPointData().AddArray(alpha)
ug.GetPointData().AddArray(beta)
ug.GetPointData().AddArray(gamma)
# les champs user
if len(kw) != 0:
for name,value in kw.items():
user= vtkFloatArray()
user.SetNumberOfComponents(1)
user.SetName(name)
#print itact,val[itact-1]
user.InsertNextTuple1(value[i-1])
ug.GetPointData().AddArray(user)
add_data_to_append(Append, ug)
return nbm
def writeRigidsToVTK(fichier,fid,dim):
def writeRigidsToVTK(fichier,fid,dim,**kw):
vtuFile = vtkXMLUnstructuredGridWriter()
vtuFile.SetFileName(fichier)
AppendAll=vtkAppendFilter()
nb = pushRigid(AppendAll,dim)
nb = pushRigid(AppendAll,dim,kw)
if nb > 0:
set_input_of_file(vtuFile, AppendAll)
......@@ -1218,7 +1231,7 @@ def writeRigidsToVTK(fichier,fid,dim):
vtuFile.Write()
time=TimeEvolution_GetTime()
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./DISPLAY/'+os.path.basename(fichier))
impr='<DataSet timestep="%s" group="" part="0" file="%s"/>\n' % (time,'./'+os.path.basename(fichier))
fid.write(impr)
############################
......@@ -1394,12 +1407,13 @@ def pushMecafe(Append,dim,kw):
if len(kw) != 0:
for name,value in kw.items():
if value[0] == 'element':
user= vtkFloatArray()
user.SetNumberOfComponents(1)
user.SetName(name)
field = value[1][i]
field = value[1][i-1]
for id_ele,val in enumerate(field):
user.InsertTuple1(id_ele,val)
......@@ -1410,7 +1424,7 @@ def pushMecafe(Append,dim,kw):
user.SetNumberOfComponents(1)
user.SetName(name)
field = value[1][i]
field = value[1][i-1]
for id_node,val in enumerate(field):
user.