Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:tutorials:tuto1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:user:tutorials:tuto1 [2015/01/09 12:01] – [How to write an input file?] bomandoc:user:tutorials:tuto1 [2016/07/11 16:45] (current) – [Temporal Integration] boemer
Line 49: Line 49:
 The first line imports the Python/C++ interface of Metafor (called ''wrap'') in the current namespace, so that all compiled C++ objects of Metafor are available in Python. The first line imports the Python/C++ interface of Metafor (called ''wrap'') in the current namespace, so that all compiled C++ objects of Metafor are available in Python.
    
-The ''math'' module is also imported, in this case, to use the functions sine and cosine later.+The ''math'' module is also imported, in this case, to use the sine and cosine functions later.
  
   metafor = Metafor()   metafor = Metafor()
   domain = metafor.getDomain()   domain = metafor.getDomain()
  
-The main object of the module is now created as an instance of the ''Metafor'' class. This command ''Metafor()'' creates an [[doc:user:tutorials:tuto0#objets|object]] Metafor, from which we can extract a ''Domain''. The domain is a container (see [[doc:user:general:références#References]]). It contains all objects that are required by the model (geometry, elements, nodes, fixations and other boundary conditions, materials, ...).+The main object of the module is now created as an instance of the ''Metafor'' class. This command ''Metafor()'' creates an [[doc:user:tutorials:tuto0#objets|object]] Metafor, from which we can extract a ''Domain''. The domain is a container (see [[doc:user:general:références#References]]). It contains all objects that are required by the model (geometry, elements, nodes, fixations and other boundary conditions, materials, ...).
  
 The analysis will then handle data from this domain to, for example, integrate temporally over its evolution equations.  The analysis will then handle data from this domain to, for example, integrate temporally over its evolution equations. 
Line 103: Line 103:
  
   geometry = domain.getGeometry()   geometry = domain.getGeometry()
-  geometry.setDimPlaneStrain()+  geometry.setDimPlaneStrain(1.0)
  
  
Line 132: Line 132:
   * Small objects which require few parameters to be defined, like ''[[doc:user:geometry:user:points|]]'' or [[doc:user:conditions:displacements|fixations]], are defined with the function ''set.define()''.   * Small objects which require few parameters to be defined, like ''[[doc:user:geometry:user:points|]]'' or [[doc:user:conditions:displacements|fixations]], are defined with the function ''set.define()''.
  
-  * Bigger objects which require more arguments, like curves, are defined using a temporary object, which is filled and copied. For example, a curve a curve is created by first defining a line (see below).+  * Bigger objects which require more arguments, like curves, are defined using a temporary object, which is filled and copied. For example, a curve is created by first defining a line (see below).
  
-In this example, ''[[doc:user:geometry:user:points]]'' are defined with the first method, as the function named "define". The first argument is a user number, which must be strictly positive and different for each entity in a common set. The next three arguments are the spatial coordinates $x, y \mbox{ and z$. Since the geometry was set to plane strain, the default plane $z=0$ is considered and only $x$ and $y$ are given.+In this example, ''[[doc:user:geometry:user:points]]'' are defined with the first method, i.e. with the "define"-function. The first argument is a user number, which must be strictly positive and different for each entity in a common set. The next three arguments are the spatial coordinates $x$$yand $z$. Since the geometry was set to plane strain, the default plane $z=0$ is considered and only $x$ and $y$ are given.
  
  
Line 229: Line 229:
 The meshers ([[doc:user:geometry:mesh:1d|1D Mesher]], [[doc:user:geometry:mesh:2d|2D Mesher]]) are linked to the entity that must be meshed and executed with the command ''execute()''. For face 1, the [[doc:user:geometry:mesh:2d|integrated mesher TIM]] (Transfinite Interpolation Method), suitable for quadrangles where two opposite edges have the same numbers of elements, is used. The meshers ([[doc:user:geometry:mesh:1d|1D Mesher]], [[doc:user:geometry:mesh:2d|2D Mesher]]) are linked to the entity that must be meshed and executed with the command ''execute()''. For face 1, the [[doc:user:geometry:mesh:2d|integrated mesher TIM]] (Transfinite Interpolation Method), suitable for quadrangles where two opposite edges have the same numbers of elements, is used.
  
-As for the geometry, it is recommended to visually check whether the piece was meshed properly by opening a ''VizWin'' window with the following lines :+As for the geometry, it is recommended to visually check whether the geometry was meshed properly by opening a ''VizWin'' window with the following lines :
  
  
Line 327: Line 327:
 Now, the boundary conditions are considered. The set which handles all boundary conditions commands is called the ''LoadingSet''. Now, the boundary conditions are considered. The set which handles all boundary conditions commands is called the ''LoadingSet''.
  
-The X component of ligne 4 and the Y component of line 1 must be [[doc:user:conditions:displacements|fixed]], by symmetry.+The X component of line 4 and the Y component of line 1 must be [[doc:user:conditions:displacements|fixed]], by symmetry.
  
  
Line 354: Line 354:
  
  
-Setting fixed ends or displacements is done is the same way as the definition of points in the geometry, with the single ''define()'' command. For the non-zero displacement of the die, the geometric entity ''curveset(5)'' is first given, then the direction ''TY,RE'' (= displacement  along ''Y''), the amplitude -0.4 and finally the temporal evolution, with the reference to the function ''fct''. This means that the movement will be described with ''d(t) = -0.4 * fct(t) = -0.4 * t''+Setting fixed ends or displacements is done in the same way as the definition of points in the geometry, with the single ''define()'' command. For the non-zero displacement of the die, the geometric entity ''curveset(5)'' is first given, then the direction ''TY,RE'' (= displacement  along ''Y''), the amplitude -0.4 and finally the temporal evolution, with the reference to the function ''fct''. This means that the movement will be described with ''d(t) = -0.4 * fct(t) = -0.4 * t''.
  
 ==== Contact ==== ==== Contact ====
Line 388: Line 388:
 The deformable entity is specified with the command ''push()'', the rigid one with ''setTool()''. The deformable entity is specified with the command ''push()'', the rigid one with ''setTool()''.
  
-It should be noted that the contact interaction number must be different that the ''FieldApplicator'' number defined earlier, since both objects are included in the same set ''InteractionSet''.+It should be noted that the contact interaction number must be different from the ''FieldApplicator'' number defined earlier, since both objects are included in the same set ''InteractionSet''.
 ==== Temporal Integration ==== ==== Temporal Integration ====
  
 The description of this model is now over. What is left to consider is the way the ''Metafor'' analysis, in charge of running the simulation, will integrate the equations temporally. The description of this model is now over. What is left to consider is the way the ''Metafor'' analysis, in charge of running the simulation, will integrate the equations temporally.
  
-Many options are available, however the simplest one is chosen here, which is a quasi-static integration (where the inertia is neglected). What remains to define is the temporal interval on which the simulation will be run, and the way the results will be saved (see [[doc:user:integration:general:time_step]]).+Many options are available, however the simplest one is chosen here, which is a quasi-static integration (where the inertia is neglected). What remains to be defined is the temporal interval during which the simulation will be run, and the way the results will be saved (see [[doc:user:integration:general:time_step]]).
  
  
Line 412: Line 412:
      
  
-Afterwards, the ''MechanicalIterationManager'' is considered (see [[doc:user:integration:general:mim_tim]]). This object sets the parameters of Newton-Raphson algorithm, used to solve the equilibrium equations. Here, a maximum of 7 mechanical [[doc:user:general:glossaire#iterations]] is set, with the default tolerance of 1.0e-4.+Afterwards, the ''MechanicalIterationManager'' is considered (see [[doc:user:integration:general:mim_tim]]). This object sets the parameters of the Newton-Raphson algorithm, used to solve the equilibrium equations. Here, a maximum of 7 mechanical [[doc:user:general:glossaire#iterations]] is set, with the default tolerance of 1.0e-4.
 ==== Curves Extraction  ==== ==== Curves Extraction  ====
  
Line 419: Line 419:
   valuesmanager = metafor.getValuesManager()   valuesmanager = metafor.getValuesManager()
   valuesmanager.add(1, MiscValueExtractor(metafor,EXT_T),'time')   valuesmanager.add(1, MiscValueExtractor(metafor,EXT_T),'time')
-  valuesmanager.add(2, DbValueExtractor(curveset(1), Field1D(TY,GF2)), SumOperator(), 'force')+  valuesmanager.add(2, DbNodalValueExtractor(curveset(1), Field1D(TY,GF2)), SumOperator(), 'force')
  
 The first line fetches the ''ValuesManager'', in charge of handling the result curves, from the analysis ''Metafor''. The first line fetches the ''ValuesManager'', in charge of handling the result curves, from the analysis ''Metafor''.
doc/user/tutorials/tuto1.1420801287.txt.gz · Last modified: 2016/03/30 15:22 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki