doc:user:tutorials:ownfemodel
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:user:tutorials:ownfemodel [2015/01/09 12:58] – created boman | doc:user:tutorials:ownfemodel [2018/10/05 10:10] (current) – boman | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== How to build my own FE model? | + | ====== How to build my own FE model? ====== |
+ | <note important> | ||
+ | |||
+ | {{: | ||
Crushing of a block made of steel by a cylindrical punch | Crushing of a block made of steel by a cylindrical punch | ||
{{: | {{: | ||
+ | |||
+ | What is written in the file tutorial1.py ? | ||
+ | |||
+ | * An input file of Metafor is a python module which contains a function getMetafor(p) | ||
+ | * This function is supposed to create a Metafor object | ||
+ | * The Metafor object is the main object containing everything about a FE simulation (geometry, mesh, boundary conditions, materials, integration scheme, etc.) | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | Main idea: | ||
+ | The input file creates a complete data structure and returns it to the FE code | ||
+ | |||
+ | Data structure of a model | ||
+ | |||
+ | {{: | ||
+ | |||
+ | First lines – header of the file | ||
+ | |||
+ | < | ||
+ | # -*- coding: latin-1; -*- | ||
+ | # $Id: tutorial1.py 1875 2014-01-02 10:10:56Z boman $ | ||
+ | ######################################## | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # a écrouissage isotrope | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | ######################################## | ||
+ | # Tutorial | ||
+ | |||
+ | from wrap import * | ||
+ | import math | ||
+ | </ | ||
+ | |||
+ | |||
+ | * coding: | ||
+ | * miscellaneous comments | ||
+ | * import the C++/python interface of the program (remember the wrap folder in the installation tree) | ||
+ | * import the math module of python for later use | ||
+ | |||
+ | < | ||
+ | metafor = Metafor() | ||
+ | domain = metafor.getDomain() | ||
+ | |||
+ | def getMetafor(p={}): | ||
+ | </ | ||
+ | {{ : | ||
+ | Creation of an instance of the Metafor class | ||
+ | (for now it is almost empty) | ||
+ | We name it metafor | ||
+ | |||
+ | Any Metafor object contains a Domain object. | ||
+ | We retreive the Domain and we name it domain | ||
+ | |||
+ | We define the getMetafor() function (same for all models) | ||
+ | |||
+ | |||
+ | |||
doc/user/tutorials/ownfemodel.1420804713.txt.gz · Last modified: 2016/03/30 15:22 (external edit)