|
|
OK |
|
|
\ No newline at end of file |
|
|
# Geomeytry and mesh preparation
|
|
|
Geometry and mesh are prepared using Gmsh. Note that the solver identifies the group of elements through *Physical* groups.
|
|
|
|
|
|
# Python code structure
|
|
|
## Include python library after compiling the code
|
|
|
The PYTHONPATH to the compiled directory must be specified in .bashrc for both gmsh and the solve, then the following line must be added in the beginning of the python file:
|
|
|
```python
|
|
|
from gmshpy import *
|
|
|
from dG3Dpy import*
|
|
|
```
|
|
|
## Define Material law and Domain
|
|
|
The basic principle of the FE implementation is to divide the whole domain of interest by domains. Each domain possesses its own constitutive behavior govering by a material law. Mechanical, thermal, or multi-physical coupled domain-material law can be used.
|
|
|
### *Material law*
|
|
|
A material law is defined as
|
|
|
```python
|
|
|
law = MaterialLawName(matNum, Arguments)
|
|
|
```
|
|
|
where the number *matNum* must be a unique integer to identify the law (when multiple laws are considered), *MaterialLawName* and its arguments *Arguments* can be found in the source code. For example, a *J2* plastic model can be defined as follows:
|
|
|
```python
|
|
|
lawnum1 = 11 # unique number of law
|
|
|
E = 210E3
|
|
|
nu = 0.3
|
|
|
K = E/3./(1.-2.*nu) # Bulk mudulus
|
|
|
mu =E/2./(1.+nu) # Shear mudulus
|
|
|
rho = 2.7 # Bulk mass
|
|
|
sy0 = 507.
|
|
|
h = E/100.
|
|
|
# creation of material law
|
|
|
harden = LinearExponentialJ2IsotropicHardening(lawnum1, sy0, h, 0., 10.)
|
|
|
law1 = J2LinearDG3DMaterialLaw(lawnum1,rho,E,nu,harden)
|
|
|
```
|
|
|
### *Domain*
|
|
|
A domain is defined as
|
|
|
```python
|
|
|
domain = dG3DDomain(tag,phys,sp,lnum, fdg, dim, nonLocalVar, nonConstitutiveExtraDOFVar, nonCurlData)
|
|
|
```
|
|
|
where
|
|
|
*) *tag*
|
|
|
|
|
|
|
|
|
```python
|
|
|
nfield = 217 # number of the field (physical number of entity)
|
|
|
dim =3
|
|
|
myfield1 = dG3DDomain(10,nfield,0,lawnum1,0,3)
|
|
|
```
|
|
|
## define solver
|
|
|
## define solver options
|
|
|
## define Boundary condition
|
|
|
## define post processing |
|
|
\ No newline at end of file |