Commit 31381a71 authored by mozul's avatar mozul

[REL] remove obsolete and sandbox directory of dev

parent 0c46e8a9
......@@ -39,7 +39,7 @@ $> git pull origin master
To get as specific version, for example *2016.rc4* :
```
$> git pull origin 2016.rc4
$> git pull origin 2016.rc5
```
## Compilation
......
......@@ -313,7 +313,7 @@ if(DOXYGEN_FOUND)
endif(DOXYGEN_FOUND)
if(${BUILD_STANDALONE} OR ${BUILD_STANDALONE_MPI} OR ${BUILD_Fortran_LIB})
add_subdirectory(Sandbox)
#add_subdirectory(Sandbox)
endif(${BUILD_STANDALONE} OR ${BUILD_STANDALONE_MPI} OR ${BUILD_Fortran_LIB})
add_subdirectory(addons)
......
This diff is collapsed.
! File BEHAVIOUR
!
! The symbol '$' preceeds a keyword used in scanning files.
!
! The symbol 'behav' stands for the nickname of a bulk or
! contact behaviour law, character(LEN=5).
!
! The symbol 'lawty' stands for the name of a bulk or
! contact behaviour law, character(LEN=30).
!
! The symbol 'seety' stands for description of a candidate
! 'cdbdy' type of body, 'cdtac' type of contactor, 'cdcol' color
! ready to meet with the contact behaviour law 'behav' an antagonist
! 'anbdy' type of body, 'antac' type of contactor, 'ancol' color.
!
! Candidate antagonist objects are considered only within some distance
! 'alert'.
!
! STANDARD PACKAGE of bulk or contact behaviour laws
!
! 123456789012345678901234567890:
! :
! bulk behaviour :
! :
!
$gravy
grv1= 0.0000000e+00 grv2= 0.0000000e+00 grv3= 0.0000000e+00
$behav lawty
TDURx RIGID Umas= 1.0000000e+03
$behav lawty
PLEXx RIGID Umas= 1.0000000e+01
#23456789012345678901234567890:
SOLVER INFORMATIONS :
STEP 1 :
BODY TRACKING :
STEP 1 :
1 :
1 :
END :
$behav
iqsc1 IQS_CLB fric= 5.0000000e-01
$behav
iqsc0 IQS_CLB fric= 3.0000000e-01
$seety
cdbdy cdtac cdcol behav anbdy antac ancol alert
RBDY2 DISKx BLEUx iqsc0 RBDY2 DISKx BLEUx 5.0051462e-02
! Vloc_Rloc
$steps 0 time= 0.0000000D+00
\ No newline at end of file
import os,sys
#sys.path.append('/Users/dubois/WORK/CODING/v2_g95/LMGC90v2_dev_opt/ChiPy')
root = '../../../'
sys.path.append(root+'ChiPy/lib')
from chipy import *
sys.path.append(root+'Sandbox/Astro/lib')
from astro import *
import numpy
### lecture du modele ###
### model reading ###
print 'READ BODIES'
RBDY2_ReadBodies()
print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
#LOADS
DISKx_LoadTactors()
POLYG_LoadTactors()
RBDY2_LoadBehaviours()
print 'READ INI DOF'
overall_ReadIniDof()
RBDY2_ReadIniDof()
print 'READ INI Vloc Rloc'
overall_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
PLPLx_ReadIniVlocRloc()
print 'READ DRIVEN DOF'
RBDY2_ReadDrivenDof()
### ecriture paranoiaque du modele ###
print 'WRITE BODIES'
overall_WriteBodies()
RBDY2_WriteBodies()
print 'WRITE BEHAVIOURS'
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
print 'WRITE DRIVEN DOF'
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()
### definition des parametres du calcul ###
print 'INIT TIME STEPPING'
nb_iter = 1000
dt = 0.005
theta = 0.5
overall_SetTimeStep(dt)
overall_InitThetaIntegrator(theta)
### post2D ##
post2D_SetReferenceRadius(0.1)
post2D_SetDisplayedField('TACTOR')
post2D_SetDisplayedField('CONTACT POINT')
post2D_InitGMV()
### postpro ###
postpro_PostproBeforeComputation()
### preparation de l'algo de detection par les boites ###
print 'COMPUTE BOX'
DKDKx_ComputeBox()
PLPLx_ComputeBox()
afterall_ComputeBox()
#RBDY2_SetLowerBoundary(-1.5)
print 'COMPUTE MASS'
RBDY2_ComputeMass()
#### get a vector with mass of each body... to improve ###
nb_part = RBDY2_GetNbRBDY2()
mass = numpy.zeros(nb_part)
for i in range(nb_part):
mass[i] = RBDY2_GetBodyMass(i+1)
pos = numpy.zeros((3,nb_part),order='F')
#fext= numpy.zeros((3,nb_part))
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
quad = 'Quad '
gs_it1 = 51
gs_it2 = 1001
freq_gmv = 10
for k in xrange(nb_iter):
#
print 'itere : ',k
#
#print 'INCREMENT STEP'
overall_IncrementStep()
RBDY2_IncrementStep()
#print 'DISPLAY TIMES'
overall_DisplayTimes()
#print 'COMPUTE Fext'
RBDY2_ComputeFext()
print 'compute gravitation force'
for i in range(nb_part):
pos[:,i] = RBDY2_GetBodyVector('Coorm',i+1,3)
#pos2 = RBDY2_GetAllVector('Coorm',3*nb_part,3,nb_part)
#pos2.shape = (nb_part,3)
#pos2 = pos2.transpose()
fext = self_gravity_ComputeFext2D(pos,mass,theta,dt,3*nb_part)
fext.shape = (nb_part,3)
for i in range(nb_part):
RBDY2_PutBodyVector('Fext_',i+1,fext[i,:])
#print 'COMPUTE Fint'
RBDY2_ComputeBulk()
#print 'COMPUTE Free Vlocy'
RBDY2_ComputeFreeVelocity()
#
#print 'SELECT PROX TACTORS'
overall_SelectProxTactors(freq_detect)
DKDKx_SelectProxTactors()
PLPLx_SelectProxTactors()
#
DKDKx_RecupRloc()
PLPLx_RecupRloc()
nlgs_ExSolver('Stored_Delassus_Loops ',quad, tol, relax, gs_it1, gs_it2)
DKDKx_StockRloc()
PLPLx_StockRloc()
#
#print 'COMPUTE DOF'
RBDY2_ComputeDof()
#
#print 'UPDATE DOF'
overall_UpdateDof()
RBDY2_UpdateDof()
#
#print 'WRITE LAST DOF'
overall_WriteLastDof()
RBDY2_WriteLastDof()
#
#print 'WRITE LAST Vloc Rloc'
overall_WriteLastVlocRloc()
DKDKx_WriteLastVlocRloc()
#
### post2D ###
overall_WriteOutGMV(freq_gmv)
post2D_WriteOutGMV(0)
### postpro ###
postpro_PostproDuringComputation()
# devrait y avoir des write_xxx_Vloc_Rloc truc ici
### wrtieout handling ###
overall_CleanWriteOutFlags()
### postpro ###
postpro_ClosePostproFiles()
This diff is collapsed.
! File BEHAVIOUR
!
! The symbol '$' preceeds a keyword used in scanning files.
!
! The symbol 'behav' stands for the nickname of a bulk or
! contact behaviour law, character(LEN=5).
!
! The symbol 'lawty' stands for the name of a bulk or
! contact behaviour law, character(LEN=30).
!
! The symbol 'seety' stands for description of a candidate
! 'cdbdy' type of body, 'cdtac' type of contactor, 'cdcol' color
! ready to meet with the contact behaviour law 'behav' an antagonist
! 'anbdy' type of body, 'antac' type of contactor, 'ancol' color.
!
! Candidate antagonist objects are considered only within some distance
! 'alert'.
!
! STANDARD PACKAGE of bulk or contact behaviour laws
!
! 123456789012345678901234567890:
! :
! bulk behaviour :
! :
!
$gravy
grv1= 0.0000000e+00 grv2= 0.0000000e+00 grv3= 0.0000000e+00
$behav lawty
PLEXx RIGID Umas= 1.0000000e+02
#23456789012345678901234567890:
SOLVER INFORMATIONS :
STEP 1 :
BODY TRACKING :
STEP 1 :
1 :
1 :
END :
$behav
iqsc0 IQS_CLB fric= 3.0000000e-01
$seety
cdbdy cdtac cdcol behav anbdy antac ancol alert
RBDY3 SPHER BLEUx iqsc0 RBDY3 SPHER BLEUx 5.0051462e-02
! Vloc_Rloc
$steps 0 time= 0.0000000D+00
\ No newline at end of file
import os,sys
root = '/Users/remymozul/work/lmgc90/LMGC90v2_dev/'
sys.path.append(root+'ChiPy_BindC/lib')
from chipy import *
import numpy
sys.path.append(root+'Sandbox/Astro/lib')
from astro import *
overall_DIME(3,0)
### computation's parameters definition ###
print 'INIT TIME STEPPING'
nb_iter = 500
dt = 0.005
theta = 0.5
#
overall_SetTimeStep(dt)
overall_InitThetaIntegrator(theta)
#
### model reading ###
print 'READ BODIES'
RBDY3_ReadBodies()
#
SPHER_LoadTactors()
#
overall_WriteBodies()
RBDY3_WriteBodies()
#MAILx_WriteBodies()
#
print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
#LOADS
RBDY3_ReadBehaviours()
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
print 'READ INI DOF'
overall_ReadIniDof()
RBDY3_ReadIniDof()
overall_WriteLastDof()
RBDY3_WriteLastDof()
print 'READ INI Vloc Rloc'
overall_ReadIniVlocRloc()
SPSPx_ReadIniVlocRloc()
print 'READ DRIVEN DOF'
RBDY3_ReadDrivenDof()
overall_WriteDrivenDof()
RBDY3_WriteDrivenDof()
### compute masses ###
RBDY3_ComputeMass()
nb_part = RBDY3_GetNbRBDY3()
mass = numpy.zeros(nb_part)
for i in range(nb_part):
mass[i] = RBDY3_GetMass(i+1)
pos = numpy.zeros((6,nb_part),order='F')
### preparation of detection algorithm using boxes method ###
print 'COMPUTE BOX'
SPSPx_ComputeBox()
afterall_ComputeBox()
### post3D ##
# 1234567890123456
post3D_SetDisplayedField('POSITION ')
post3D_SetDisplayedField('AVERAGE VELOCITY')
display_3D_SetDisplayedField('TACTOR')
post3D_Init()
display_3D_Init()
display_3D_WriteOutGMV(0)
postpro_3D_PostproBeforeComputation()
### parameters setting ###
freq_detect = 1
freq_gmv = 5
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
quad = 'QM/16'
tol = 0.1666e-3
relax = 1.0
gs_it1 = 51
gs_it2 = 501
for k in range(nb_iter):
#
print 'itere : ',k
#
#print 'INCREMENT STEP'
overall_IncrementStep()
RBDY3_IncrementStep()
# POLYR_IncrementStep()
#
#print 'COMPUTE Fext'
RBDY3_ComputeFext()
#print 'compute gravitation force'
for i in range(nb_part):
pos[:,i] = RBDY3_GetBodyVector('Coorm',i+1,6)
fext = self_gravity_ComputeFext3D(pos,mass,theta,dt,6*nb_part)
fext.shape = (nb_part,6)
for i in range(nb_part):
RBDY3_PutBodyVector('Fext_',i+1,fext[i,:])
#
#print 'COMPUTE Fint'
RBDY3_ComputeBulk()
#
#print 'COMPUTE Free Vlocy'
RBDY3_ComputeFreeVelocity()
#
#print 'SELECT PROX TACTORS'
overall_SelectProxTactors(freq_detect)
SPSPx_SelectProxTactors()
#
SPSPx_RecupRloc()
#print 'RESOLUTION'
#print type,quad,tol, relax, gs_it1, gs_it2
nlgs_3D_ExSolver(type,quad, tol, relax, gs_it1, gs_it2)
SPSPx_StockRloc()
#
#print 'COMPUTE DOF'
RBDY3_ComputeDof()
#
#print 'UPDATE DOF'
overall_UpdateDof()
RBDY3_UpdateDof()
### post3D ###
post3D_Update()
overall_WriteOutGMV(freq_gmv)
display_3D_WriteOutGMV(0)
### postpro ###
postpro_3D_PostproDuringComputation()
overall_WriteOutDof(500)
RBDY3_WriteOutDof(-1,9999999)
overall_WriteOutVlocRloc(500)
SPSPx_WriteOutVlocRloc()
### writeout handling ###
overall_CleanWriteOutFlags()
overall_WriteLastDof()
RBDY3_WriteLastDof()
postpro_3D_ClosePostproFiles()
all: gravity wrap_gravity
gravity:
cd $(TOP)/src; \
make -f makefile -e "FC=$(F)" "FFLAGS=$(FFLAGS) $(MODOPT)$(TOP)/modules" "TOP=$(TOP)/src"
wrap_gravity:$(FIRST)
cd $(TOP)/swig; \
make -f makefile -e "FC=$(F)" "FFLAGS=$(FFLAGS) -I$(TOP)/modules $(MODOPT)$(TOP)/modules" "LIBS=$(LIBS)" "LIBS_PATH=$(LIBS_PATH)" "TOP=$(TOP)/swig" "CPP_LIBS_PATH=$(CPP_LIBS_PATH)" "CPP_LIBS=$(CPP_LIBS)" "PYTHON_INC=$(PYTHON_INC)" "NUMPY_INC=$(NUMPY_INC)" swig
############# nettoyage #######################"
clean: clean_gravity clean_wrap_gravity
rm -f modules/*
rm -f lib/*
clean_gravity:
cd $(TOP)/src; \
make -f makefile -e "TOP=$(TOP)/src" clean
clean_wrap_gravity:
cd $(TOP)/swig; \
make -f makefile -e "TOP=$(TOP)/swig" clean;
module self_gravity
real(kind=8), private :: G=6.67d-00 ! Gravitational constant in Kg/M/S Unit
! This value of G imposes that masses are in Kg and
! distances in meters
logical :: is_first = .true. ! tells if Fg_prev is not stored
real(kind=8), dimension(:,:), allocatable :: Fg_prev ! Stores gravity forces at each call
CONTAINS
subroutine self_gravity_Force_2D (Nbod, X, Y, M, Fx,Fy )
! Return the for in newton on each particle
! INPUT
! Nbod : Number of bodies
! X,Y : Vectors with Nbod elements containing X and y coordinates of bodies in M
! M : Vector with Nbod elements containing the Mass in Kg
! OUTPUT
! Fx : Nbod elements vector with the X coordinate of Force (in Newtons)
! Fy : Nbod elements vector with the X coordinate of Force (in Newtons)
implicit none
! Input
integer(kind=4), intent(in) :: Nbod ! Number of bodies
real(kind=8), intent(in), dimension(Nbod) :: X, Y ,M ! X,y coordinates, M=Mass in Kg
! Output
real(kind=8), intent(out), dimension(Nbod) :: Fx,Fy ! X and Y coordinates of Force in Newtons
!
integer(kind=4) :: I
real(kind=8), dimension(Nbod) :: R3
! Loop on all bodies
do i=1, Nbod
! distance to body I ^3
R3=sqrt((X-X(i))**2+(Y-Y(i))**2)
R3=R3*R3*R3
R3(i)=1.d0 ! To avoid division by 0
Fx(i)=G*M(i)*SUM( (X-X(i))*M/R3 )
Fy(i)=G*M(i)*SUM( (Y-Y(i))*M/R3 )
enddo
end subroutine self_gravity_Force_2D
subroutine self_gravity_Force_3D (Nbod, X, Y, Z, M, Fx,Fy,Fz )
! Return the for in newton on each particle
! INPUT
! Nbod : Number of bodies
! X,Y, Z : Vectors with Nbod elements containing X , Y and Z coordinates of bodies in M
! M : Vector with Nbod elements containing the Mass in Kg
! OUTPUT
! Fx : Nbod elements vector with the X coordinate of Force (in Newtons)
! Fy : Nbod elements vector with the X coordinate of Force (in Newtons)
! Fz : Nbod elements vector with the Z coordinate of Force (in Newtons)
implicit none
! Input
integer(kind=4), intent(in) :: Nbod ! Number of bodies
real(kind=8), intent(in), dimension(Nbod) :: X, Y ,Z ,M ! X,y coordinates, M=Mass in Kg
! Output
real(kind=8), intent(out), dimension(Nbod) :: Fx,Fy,Fz ! X and Y coordinates of Force in Newtons
integer(kind=4) :: I
real(kind=8), dimension(Nbod) :: R3
! Loop on all bodies
do i=1, Nbod
! distance to body I ^3
R3=sqrt((X-X(i))**2+(Y-Y(i))**2+(Z-Z(i))**2)