Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:general:fonctions

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:general:fonctions [2014/08/06 17:58] jorisdoc:user:general:fonctions [2021/01/28 18:28] (current) papeleux
Line 1: Line 1:
-====== Evolution function ======+ 
 +====== Functions y=f(t) ======
  
-Functions are quite useful to describe how some parameters evolve, over time for example. They can be used to [[doc:user:conditions:displacements|set displacements]] or to define [[doc:user:elements:volumes:start|hardening laws]].+Functions are quite useful to describe how some parameters evolve, over time for example. They can be used to [[doc:user:conditions:displacements|prescribe displacements]] or to define [[doc:user:elements:volumes:start|hardening laws]].
  
 ===== PieceWiseLinearFunction ===== ===== PieceWiseLinearFunction =====
Line 18: Line 19:
 | ''ord1'', ''ord2'', ... | list of ordinates | | ''ord1'', ''ord2'', ... | list of ordinates |
  
-__Remark #1:__ Evolution functions are objects derived from ''refCounted''. Once associated to a loading, their reference is incremented and memory management is associated to the object which uses them. Therefore, it is no longer required to define them as global.+{{ doc:user:piecewise.gif |Piecewise linear function}}
  
-{{ doc:user:piecewise.gif |Fonction linéaire par morceaux}}+__Remark:__ As can be seen above, the first and last segments are extrapolated if a value of the function is required outside its domain.
  
-__Remark #2:__ As can be seen above, the first and last segments are extrapolated if a value of the function is required outside its domain.+===== CyclicPieceWiseLinearFunction ===== 
 +The ''CyclicPieceWiseLinearFunction'' allows to duplicate infinitely  a ''PieceWiseLinearFunction''
 + 
 +{{ :doc:user:cyclicpiecewiselinearfunction.png?600 |}} 
 + 
 +constrains are applied on Data  
 +  - the first abcisse must be equal to 0.0 (abs1 = 0.0) 
 +  - the cycle must be closed (ord1 = ordLast)
  
 ===== PythonOneParameterFunction ===== ===== PythonOneParameterFunction =====
  
-If function is too complex to be defined with a ''PieceWiseLinearFunction'', it must be defined analytically, with the function ''PythonOneParameterFunction''.+If function is mathematically too complex to be defined with a ''PieceWiseLinearFunction'', it can be defined analytically, with ''PythonOneParameterFunction'' object.
  
-The goal is to give as argument a Python function as ''OneParameterFunction''.+  def f(x): 
 +      [function calculating y=f(x)] 
 +      return y 
 +  fct1 = PythonOneParameterFunction(f)
  
 For example, this is used to: For example, this is used to:
-    * Configure the mesher ([[doc:user:geometry:mesh:1d]]). +    * Set the node density for a 1D mesher ([[doc:user:geometry:mesh:1d]]). 
-    * Pilot most metafor objects in a more advanced way ([[doc:user:conditions:displacements]]).+    * define elaborated prescribed displacements ([[doc:user:conditions:displacements]]).
     * Define a hardening function with Python ([[doc:user:elements:volumes:start]]).     * Define a hardening function with Python ([[doc:user:elements:volumes:start]]).
  
-__Example:__ the ramp function:+===== Examples ===== 
 + 
 +The ramp function:
  
     fct1 = PieceWiseLinearFunction()     fct1 = PieceWiseLinearFunction()
-    fct1.setdata(0,0) +    fct1.setData(0,0) 
-    fct1.setdata(1,1)+    fct1.setData(1,1)
  
-becomes with interpreted Python:+can be also defined with a classical python function:
  
-    def f(a): +    def f(x): 
-        return a+        return x
     fct1 = PythonOneParameterFunction(f)     fct1 = PythonOneParameterFunction(f)
  
Line 52: Line 65:
     fct1 = PythonOneParameterFunction(f)     fct1 = PythonOneParameterFunction(f)
  
 +===== Advanced use =====
 +{{:doc:user:ico-advanced.png?40 |Advanced}}
 The value can also be displayed for each estimation, and a more complex function can also be defined using all Python tools. For example, a load function can be first defined with a parabola, then with a straight line, the change between these two being controlled by an conditional structure. The value can also be displayed for each estimation, and a more complex function can also be defined using all Python tools. For example, a load function can be first defined with a parabola, then with a straight line, the change between these two being controlled by an conditional structure.
  
doc/user/general/fonctions.txt · Last modified: 2021/01/28 18:28 by papeleux

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki