Commit ea2ac027 authored by mozul's avatar mozul

Squashed 'src/' changes from 46e2d8a..9035eb4

9035eb4 Merge branch 'sphinx' into 'dev'
26f2338 [DOC] in sphinx doc of chipy, use "from pylmgc90 import chipy" in examples
24010ae Merge branch 'fd_fix_typo' into 'dev'
42b8455 modifs
c9a79cd various small modifications

git-subtree-dir: src
git-subtree-split: 9035eb42c880a0879bd5e4e7c7874472e9881555
parent 67789275
......@@ -459,10 +459,9 @@ Managing rigid models
* @brief declares rigid velocity dof as driven
*
* @cond PYDOC
* python usage : mecaMAILx_SetRVDrivenDofs(idbody,vector_in,length)
* python usage : mecaMAILx_SetRVDrivenDofs(idbody,vector_in)
* @param[in] idbody (integer) : id of the body
* @param[in] vector (integer) : list of driven dofs
* @param[in] length (integer) : size of the list
* @endcond
*
* @cond CDOC
......
......@@ -3053,7 +3053,7 @@ CONTAINS
M_bdyty(ibdyty)%blmty(iblmty)%ther_gpv(ig,2)%flux, &
M_bdyty(ibdyty)%blmty(iblmty)%ther_gpv(ig,2)%grad)
IF (nb_external /=0) THEN
IF (nb_external /=0 ) THEN
ALLOCATE(M_bdyty(ibdyty)%blmty(iblmty)%ther_gpv(ig,1)%flux(nb_external))
M_bdyty(ibdyty)%blmty(iblmty)%ther_gpv(ig,1)%flux(nb_external)=0.d0
......
......@@ -3414,7 +3414,7 @@ subroutine compute_elementary_F_advection_therMAILx(ibdyty, iblmty, NbNo, v_ele,
end subroutine compute_elementary_F_advection_therMAILx
! fonction qui recupere les gradients de temperature, a a fin du pas de temps,
! fonction qui recupere les gradients de temperature, a la fin du pas de temps,
! pour les noeuds d'un element
subroutine compute_grad_T_ele_therMAILx(ibdyty, iblmty, NbNo, grad_T_ele)
......@@ -3464,15 +3464,15 @@ subroutine compute_grad_T_ele_therMAILx(ibdyty, iblmty, NbNo, grad_T_ele)
end do
print*,'T'
print*,T_ele
!print*,'T'
!print*,T_ele
! on calcule le gradient de temperature aux noeuds de l'element courant
call compute_grad_T_ele_therEF(bdyty(ibdyty)%blmty(iblmty)%blmnb, &
coor_ele, T_ele, grad_T_ele)
print*,'gradT'
print*,grad_T_ele
!print*,'gradT'
!print*,grad_T_ele
end subroutine compute_grad_T_ele_therMAILx
......
......@@ -12,13 +12,13 @@ In 3D only a volumic mesh can become a deformable or rigid avatar whereas
a surfacic mesh can only be used to generate a rigid avatar.
In 2D a mesh may define a deformable or a rigid avatar.
Hand made mesh
--------------
Again it is possible to define a mesh by hand using the class constructor
and the basic methods as explained in :ref:`avatar-definition`
section. But this solution is not usable to generate big meshes.
Hand made mesh
--------------
Basic example ::
m = mesh(dimension=2)
......@@ -26,26 +26,36 @@ Basic example ::
m.addNode( node('NO2xx', numpy.array([1.,0.]), number=2) )
m.addNode( node('NO2xx', numpy.array([0.,1.]), number=3) )
m.addNode( node('NO2xx', numpy.array([1.,1.]), number=4) )
m.addBulk( element('Q4xxx', [1,2,4,3]), physicalEntity='1quad' )
Available elements are:
* 'Rxx2D','Rxx3D',
* 'SPRG2','SPRG3','Beam','Cable','S2xth',
* 'Q4xxx','Q4P0x','Q44xx',
* 'T3xxx','DKTxx','T33xx',
* 'Q8xxx','Q8Rxx','Q84xx',
* 'Q9xxx',
* 'T6xxx','T63xx',
* 'TE4xx','TE4lx','TE44x',
* 'TE10x','TE104',
* 'H8xxx','H88xx','SHB8x',
* 'H20xx','H20Rx','H208x','SHB20',
* 'PRI6x','SHB6x',
* 'PRI15','SHB15'
m.addBulk( element('Q4xxx', [1,2,4,3], physicalEntity='1quad') )
Available geometrical elements are:
* 1D : Point, S2xxx, S3xxx,
* 2D : Point, S2xxx, S3xxx, T3xxx, Q4xxx, T6xxx, Q8xxx, Q9xxx,
* 3D : Point, S2xxx, S3xxx, T3xxx, Q4xxx, T6xxx, Q8xxx, Q9xxx,
H8xxx, H20xx, TE4xx, TE10x, PRI6x, PRI15
.. c'est des elements physiques
.. * 'Rxx2D','Rxx3D',
.. * 'SPRG2','SPRG3','Beam','Cable','S2xth',
.. * 'Q4xxx','Q4P0x','Q44xx',
.. * 'T3xxx','DKTxx','T33xx',
.. * 'Q8xxx','Q8Rxx','Q84xx',
.. * 'Q9xxx',
.. * 'T6xxx','T63xx',
.. * 'TE4xx','TE4lx','TE44x',
.. * 'TE10x','TE104',
.. * 'H8xxx','H88xx','SHB8x',
.. * 'H20xx','H20Rx','H208x','SHB20',
.. * 'PRI6x','SHB6x',
.. * 'PRI15','SHB15'
Remember that rigid2d() and rigid3d() allow to define *rigid*
element. It is equivalent to ::
element( type='Point', connectivity=[1], physicalEntity='1')
Remember that rigid2D() and rigid3d() allow to define *rigid* element.
Built-in Generation
-------------------
......
......@@ -11,8 +11,8 @@ Rigid:
Available elements:
* rigid2d() : 'Rxx2D'
* rigid3d() : 'Rxx3D'
* Point : Rxx2D
* Point : Rxx3D
Available options: **None**
......@@ -25,20 +25,19 @@ Example ::
Mechanical (MECAx) :
--------------------
Available elements:
Available elements (I: isoparametric, B: bar, D: discrete, S: SHB) :
* Point : 'Point'
* S2xxx : 'SPRG2', 'SPRG3', 'Beam', 'Cable'
* S3xxx :
* T3xxx : 'T3xxx','DKTxx'
* T6xxx : 'T6xxx'
* Q4xxx : 'Q4xxx', 'Q4P0x'
* Q8xxx : 'Q8xxx', 'Q8Rxx'
* TE4xx : 'TE4xx','TE4lx'
* TE10x : 'TE10x'
* H8xxx : 'H8xxx'
* H20xx : 'H20xx', 'H20Rx'
* PRI6x : 'PRI6x'
* S2xxx : SPRNG (D), BARxx (B)
* T3xxx : T3xxx (I), DKTxx
* T6xxx : T6xxx (I)
* Q4xxx : Q4xxx (I), Q4P0x (I)
* Q8xxx : Q8xxx (I), Q8Rxx (I)
* TE4xx : TE4xx (I), TE4lx (I)
* TE10x : TE10x (I)
* H8xxx : H8xxx (I)
* H20xx : H20xx (I), H20Rx (I)
* PRI6x : PRI6x (I), SHB6x (S)
* PRI15 : PRI15 (I)
Available options:
......@@ -61,20 +60,18 @@ Example ::
Thermal (THERx) :
-----------------
Available elements:
Available elements (I: isoparametric, B: bar):
* S2xxx : S2xth (B)
* T3xxx : T3xxx (I)
* T6xxx : T6xxx (I)
* Q4xxx : Q4xxx (I)
* Q8xxx : Q8xxx (I), Q8Rxx (I)
* TE4xx : TE4xx (I)
* TE10x : TE10x (I)
* H8xxx : H8xxx (I)
* H20xx : H20xx (I), H20Rx (I)
* Point :
* S2xxx :
* S3xxx :
* T3xxx : 'T3xxx'
* T6xxx : 'T6xxx'
* Q4xxx : 'Q4xxx'
* Q8xxx : 'Q8xxx'
* TE4xx : 'TE4xx'
* TE10x : 'TE10x'
* H8xxx : 'H8xxx'
* H20xx : 'H20xx'
* PRI6x : 'PRI6x'
Available options:
......@@ -96,18 +93,14 @@ Porous (POROx) :
Available elements:
* Point :
* S2xxx :
* S3xxx :
* T3xxx : 'T33xx'
* T6xxx : 'T63xx'
* Q4xxx : 'Q44xx'
* Q8xxx : 'Q84xx'
* TE4xx : 'TE44x'
* TE10x : 'TE104'
* H8xxx :'H88xx'
* H20xx :'H208x'
* PRI6x :
* T3xxx : T33xx
* T6xxx : T63xx
* Q4xxx : Q44xx
* Q8xxx : Q84xx
* TE4xx : TE44x
* TE10x : TE104
* H8xxx :H88xx
* H20xx :H208x
Available options:
......
......@@ -12,16 +12,16 @@ Specific tunings can be performed setting some additional options.
::
# importing chipy module
from pylmgc90.chipy import *
from pylmgc90 import chipy
# Initializing
Initialize()
chipy.Initialize()
# checking/creating mandatory subfolders
checkDirectories()
chipy.checkDirectories()
# logMes
# utilities_DisableLogMes()
# chipy.utilities_DisableLogMes()
#
# defining some variables
......@@ -53,7 +53,7 @@ Specific tunings can be performed setting some additional options.
norm = 'Quad '
gs_it1 = 50
gs_it2 = 10
type='Stored_Delassus_Loops '
solver_type='Stored_Delassus_Loops '
# write parameter
freq_write = 10
......@@ -67,56 +67,56 @@ Specific tunings can be performed setting some additional options.
#
# Set space dimension
SetDimension(dim,mhyp)
chipy.SetDimension(dim,mhyp)
#
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
chipy.utilities_logMes('INIT TIME STEPPING')
chipy.TimeEvolution_SetTimeStep(dt)
chipy.Integrator_InitTheta(theta)
#
utilities_logMes('READ BEHAVIOURS')
ReadBehaviours()
if deformable: ReadModels()
chipy.utilities_logMes('READ BEHAVIOURS')
chipy.ReadBehaviours()
if deformable: chipy.ReadModels()
#
utilities_logMes('READ BODIES')
ReadBodies()
chipy.utilities_logMes('READ BODIES')
chipy.ReadBodies()
#
utilities_logMes('LOAD BEHAVIOURS')
LoadBehaviours()
if deformable: LoadModels()
chipy.utilities_logMes('LOAD BEHAVIOURS')
chipy.LoadBehaviours()
if deformable: chipy.LoadModels()
#
utilities_logMes('READ INI DOF')
ReadIniDof()
chipy.utilities_logMes('READ INI DOF')
chipy.ReadIniDof()
#
if deformable:
utilities_logMes('READ INI GPV')
ReadIniGPV()
chipy.utilities_logMes('READ INI GPV')
chipy.ReadIniGPV()
#
utilities_logMes('READ DRIVEN DOF')
ReadDrivenDof()
chipy.utilities_logMes('READ DRIVEN DOF')
chipy.ReadDrivenDof()
#
utilities_logMes('LOAD TACTORS')
LoadTactors()
chipy.utilities_logMes('LOAD TACTORS')
chipy.LoadTactors()
#
utilities_logMes('READ INI Vloc Rloc')
ReadIniVlocRloc()
chipy.utilities_logMes('READ INI Vloc Rloc')
chipy.ReadIniVlocRloc()
#
# paranoid writes
#
utilities_logMes('WRITE BODIES')
WriteBodies()
utilities_logMes('WRITE BEHAVIOURS')
WriteBehaviours()
utilities_logMes('WRITE DRIVEN DOF')
WriteDrivenDof()
chipy.utilities_logMes('WRITE BODIES')
chipy.WriteBodies()
chipy.utilities_logMes('WRITE BEHAVIOURS')
chipy.WriteBehaviours()
chipy.utilities_logMes('WRITE DRIVEN DOF')
chipy.WriteDrivenDof()
#
# open display & postpro
#
utilities_logMes('DISPLAY & WRITE')
OpenDisplayFiles()
OpenPostproFiles()
chipy.utilities_logMes('DISPLAY & WRITE')
chipy.OpenDisplayFiles()
chipy.OpenPostproFiles()
#
# simulation part ...
......@@ -127,9 +127,9 @@ Specific tunings can be performed setting some additional options.
#
# close display & postpro
#
CloseDisplayFiles()
ClosePostproFiles()
chipy.CloseDisplayFiles()
chipy.ClosePostproFiles()
# this is the end
Finalize()
chipy.Finalize()
......@@ -5,65 +5,63 @@ Time loop for linear deformable bodies
Here is a typical time loop for the modelling of a linear deformable
sample (assumes *deformable = 1*) ::
# since constant compute elementary mass matrices once
utilities_logMes('COMPUTE MASS')
ComputeMass()
# since constant compute elementary mass matrices once
chipy.utilities_logMes('COMPUTE MASS')
chipy.ComputeMass()
# since constant compute elementary stiffness matrices once
utilities_logMes('COMPUTE STIFFNESS')
ComputeBulk()
# since constant compute elementary stiffness matrices once
chipy.utilities_logMes('COMPUTE STIFFNESS')
chipy.ComputeBulk()
# since constant compute iteration matrix once
AssembleMechanicalLHS()
# since constant compute iteration matrix once
chipy.utilities_logMes('ASSEMB KT')
chipy.AssembleMechanicalLHS()
for k in xrange(1, nb_steps + 1, 1):
for k in xrange(1, nb_steps + 1, 1):
#
utilities_logMes('INCREMENT STEP')
IncrementStep()
chipy.utilities_logMes('INCREMENT STEP')
chipy.IncrementStep()
#
utilities_logMes('DISPLAY TIMES')
TimeEvolution_DisplayStep()
chipy.utilities_logMes('COMPUTE Fext')
chipy.ComputeFext()
#
utilities_logMes('COMPUTE Fext')
ComputeFext()
chipy.utilities_logMes('COMPUTE Fint')
chipy.ComputeBulk()
#
utilities_logMes('COMPUTE Fint')
ComputeBulk()
chipy.utilities_logMes('ASSEMB RHS')
chipy.AssembleMechanicalRHS()
#
utilities_logMes('ASSEMBLAGE')
AssembleMechanicalRHS()
chipy.utilities_logMes('COMPUTE Free Vlocy')
chipy.ComputeFreeVelocity()
#
utilities_logMes('COMPUTE Free Vlocy')
ComputeFreeVelocity()
chipy.utilities_logMes('SELECT PROX TACTORS')
chipy.SelectProxTactors(freq_detect)
#
utilities_logMes('SELECT PROX TACTORS')
SelectProxTactors(freq_detect)
chipy.utilities_logMes('RESOLUTION' )
chipy.RecupRloc()
#
utilities_logMes('RESOLUTION' )
RecupRloc()
chipy.ExSolver(solver_type, norm, tol, relax, gs_it1, gs_it2)
chipy.UpdateTactBehav()
#
ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
UpdateTactBehav()
chipy.StockRloc()
#
StockRloc()
chipy.utilities_logMes('COMPUTE DOF, FIELDS, etc.')
chipy.ComputeDof()
#
utilities_logMes('COMPUTE DOF, FIELDS, etc.')
ComputeDof()
chipy.utilities_logMes('UPDATE DOF, FIELDS')
chipy.UpdateStep()
#
utilities_logMes('UPDATE DOF, FIELDS')
UpdateStep()
chipy.utilities_logMes('WRITE OUT DOF')
chipy.WriteOutDof(freq_write)
#
utilities_logMes('WRITE OUT DOF')
WriteOutDof(freq_write)
chipy.utilities_logMes('WRITE OUT GPV')
chipy.WriteOutGPV(freq_write)
#
utilities_logMes('WRITE OUT GPV')
WriteOutGPV(freq_write)
chipy.utilities_logMes('WRITE OUT Rloc')
chipy.WriteOutVlocRloc(freq_write)
#
utilities_logMes('WRITE OUT Rloc')
WriteOutVlocRloc(freq_write)
#
utilities_logMes('VISU & POSTPRO')
WriteDisplayFiles(freq_display,ref_radius)
WritePostproFiles()
chipy.utilities_logMes('VISU & POSTPRO')
chipy.WriteDisplayFiles(freq_display,ref_radius)
chipy.WritePostproFiles()
......@@ -15,86 +15,86 @@ Additional parameters are necessary at the beginning of the script ::
Here is a typical time loop ::
# Newton loop parameters:
NewtonRaphson_SetFinalTime(t_final)
NewtonRaphson_SetMinTimeStep(dt_min)
NewtonRaphson_SetMaxTimeStep(dt_max)
NewtonRaphson_SetMaxIter(NR_max_iter)
NewtonRaphson_SetIncPatience(NR_adapt)
utilities_logMes('COMPUTE MASS')
ComputeMass()
while TimeEvolution_GetTime() < t_final :
#
utilities_logMes('INCREMENT STEP')
IncrementStep()
utilities_logMes('COMPUTE Fext')
ComputeFext()
# Newton loop
NewtonRaphson_Initialize(NR_tol)
is_converged = 1
k=0
#looping until something changes in CheckConvergence
while is_converged == 1 :
k+=1
utilities_logMes('COMPUTE BULK')
ComputeBulk()
utilities_logMes('ASSEMB RHS/KT')
AssembleMechanicalRHS()
AssembleMechanicalLHS()
utilities_logMes('COMPUTE Free Vlocy')
ComputeFreeVelocity()
#
utilities_logMes('SELECT PROX TACTORS')
SelectProxTactors(freq_detect)
#
### Signorini Coulomb
RecupRloc()
ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
StockRloc()
###
utilities_logMes('COMPUTE DOF')
ComputeDof()
#
if k > 1:
NR_norm = mecaMAILx_ComputeResidueNorm()
is_converged = NewtonRaphson_CheckConvergence(NR_norm)
### end while NR
utilities_logMes('COMPUTE TIME STEP')
#istate = 1 => redo step
#istate = 2 => stop
istate = NewtonRaphson_ComputeTimeStep()
if not istate == 1 :
utilities_logMes('UPDATE TACT BEHAV')
UpdateTactBehav()
StockRloc()
utilities_logMes('UPDATE DOF')
UpdateStep()
#
### write results ###
#
WriteOutDof(freq_write)
WriteOutGPV(freq_write)
WriteOutVlocRloc(freq_write)
WriteDisplayFiles(freq=freq_display,ref_radius=ref_radius)
WritePostproFiles()
if istate == 2 :
# istate => Stop
break
chipy.NewtonRaphson_SetFinalTime(t_final)
chipy.NewtonRaphson_SetMinTimeStep(dt_min)
chipy.NewtonRaphson_SetMaxTimeStep(dt_max)
chipy.NewtonRaphson_SetMaxIter(NR_max_iter)
chipy.NewtonRaphson_SetIncPatience(NR_adapt)
chipy.utilities_logMes('COMPUTE MASS')
chipy.ComputeMass()
while chipy.TimeEvolution_GetTime() < t_final :
#
chipy.utilities_logMes('INCREMENT STEP')
chipy.IncrementStep()
chipy.utilities_logMes('COMPUTE Fext')
chipy.ComputeFext()
# Newton loop
chipy.NewtonRaphson_Initialize(NR_tol)
is_converged = 1
k=0
#looping until something changes in CheckConvergence
while is_converged == 1 :
k+=1
chipy.utilities_logMes('COMPUTE BULK')
chipy.ComputeBulk()
chipy.utilities_logMes('ASSEMB RHS/KT')
chipy.AssembleMechanicalRHS()
chipy.AssembleMechanicalLHS()
chipy.utilities_logMes('COMPUTE Free Vlocy')
chipy.ComputeFreeVelocity()
#
chipy.utilities_logMes('SELECT PROX TACTORS')
chipy.SelectProxTactors(freq_detect)
#
### Signorini Coulomb
chipy.RecupRloc()
chipy.ExSolver(solver_type, norm, tol, relax, gs_it1, gs_it2)
chipy.StockRloc()
###
chipy.utilities_logMes('COMPUTE DOF')
chipy.ComputeDof()
#
if k > 1:
NR_norm = chipy.mecaMAILx_ComputeResidueNorm()
is_converged = chipy.NewtonRaphson_CheckConvergence(NR_norm)
### end while NR
chipy.utilities_logMes('COMPUTE TIME STEP')
#istate = 1 => redo step
#istate = 2 => stop
istate = chipy.NewtonRaphson_ComputeTimeStep()
if not istate == 1 :
chipy.utilities_logMes('UPDATE TACT BEHAV')
chipy.UpdateTactBehav()
chipy.StockRloc()
chipy.utilities_logMes('UPDATE DOF')
chipy.UpdateStep()
#
### write results ###
#
chipy.WriteOutDof(freq_write)
chipy.WriteOutGPV(freq_write)
chipy.WriteOutVlocRloc(freq_write)
chipy.WriteDisplayFiles(freq=freq_display,ref_radius=ref_radius)
chipy.WritePostproFiles()
if istate == 2 :
# istate => Stop
break
### end while time loop ###
......
......@@ -4,33 +4,46 @@ Time loop for rigid bodies
Here is a typical time loop for the modelling of a rigid sample (assumes *deformable = 0*) ::
# since constant compute elementary mass once
ComputeMass()
# since constant compute elementary mass once
chipy.utilities_logMes('COMPUTE MASS')
chipy.ComputeMass()
for k in xrange(0,nb_steps):