Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:results:courbes_res

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:results:courbes_res [2021/11/25 11:01] – [Extracting elementary values] papeleuxdoc:user:results:courbes_res [2026/03/09 14:32] (current) – [ValuesManager] papeleux
Line 28: Line 28:
  
   valuesmanager = metafor.getValuesManager()   valuesmanager = metafor.getValuesManager()
-  valuesmanager.add(nbr, extractor, name = ""       # manages extraction, result storage...  +  valuesmanager.add(no, extractor, name = ""        # manages extraction, result storage...  
-  valuesmanager.add(nbr, extractor, v2sOp, name = "") # same + transformation from vector to scalar+  valuesmanager.add(no, extractor, v2sOp, name = "" # same + transformation from vector to scalar
   valuesmanager.getDataVector(nbr)                    # returns a reference of the vector storing values        valuesmanager.getDataVector(nbr)                    # returns a reference of the vector storing values     
                                                       # (for example to create and view curves)                                                       # (for example to create and view curves)
   valuesmanager.setOnFile(False)                      # Keep curves in memory instead of writing    valuesmanager.setOnFile(False)                      # Keep curves in memory instead of writing 
                                                       # .v and .ascii files                                                       # .v and .ascii files
 +  # option by curve
 +  valuesmanager(no).setExport2Ascii(True/False)       # export curve no to Ascii (def : True)
 +  valuesmanager(no).setExport2Npy(True/False)         # export curve no to .npy (binary numpy array) (def : False)
 +  valuesmanager(no).setExportInterval(1)              # export curve no with an interval (def : 1)
 +  #
 +  # global options 
 +  # (BE CAREFULL THAT THEY ARE ONLY APPLIED ON CURVES ALLREADY DEFINED)
 +  valuesmanager.setExport2Ascii(True/False)           # export all curves allready defined to Ascii (def : True)
 +  valuesmanager.setExport2Npy(True/False)             # export all curves allready defined to .npy (binary numpy array) (def : False)
 +  valuesmanager.setExportInterval(1)                  # export all curves allready defined with an interval (def : 1)
 +  
 +  
                                                                                                              
 where  where 
  
-| ''nbr''       | number of the curve (unique) | +| ''no''        | number of the curve (unique) | 
 | ''extractor'' | reference of a [[#ValueExtractor]] |  | ''extractor'' | reference of a [[#ValueExtractor]] | 
 | ''v2sOp'' | Operator such as [[#VectorToScalarOperator]] | | ''v2sOp'' | Operator such as [[#VectorToScalarOperator]] |
Line 128: Line 140:
 Extract values stored in the data base, On geometrically defined point (positions, displacements, temperature, forces, velocities, ...).  Extract values stored in the data base, On geometrically defined point (positions, displacements, temperature, forces, velocities, ...). 
  
-  valueExtractor = DbGeoPointValueExtractor (pointList, mesh, field)+  valueExtractor = DbGeoPointValueExtractor (pointList, meshedObject, field) 
 +  valueExtractor = DbGeoPointValueExtractor (pointList, meshedObjectList, field)
   valueExtractor.setEulerian(True)    valueExtractor.setEulerian(True) 
   valueExtractor.setOutsideTol(tol)   valueExtractor.setOutsideTol(tol)
Line 134: Line 147:
 where where
  
-| ''listPt''  | List of points where the field is extracted                         | +| ''listPt''         | List of points where the field is extracted                         | 
-| ''mesh''    | Mesh from which the value is extracted                              |  +| ''meshObject''     Meshed Object from where the point will try to find the element from which the value is interpolated |  
-| ''dbField'' | [[doc:user:general:locks|Field1D]] describing the scalar to extract |  +| ''meshObjectList'' | List of Mesh Meshed Object from where the point will try to find the element from which the value is interpolated |  
-| ''tol''     | Outside tolerance in terms of reduced coordinate (default = 0.2)    | +| ''dbField''        | [[doc:user:general:locks|Field1D]] describing the scalar to extract |  
 +| ''tol''            | Outside tolerance in terms of reduced coordinate (default = 0.2)    | 
  
  
Line 144: Line 158:
  
     pt102 = pointset.define(102,0.15*Lx,0.75*Ly,0)     # geo point of extraction (must be in pointset)     pt102 = pointset.define(102,0.15*Lx,0.75*Ly,0)     # geo point of extraction (must be in pointset)
-    dyPt102 = DbGeoPointValueExtractor([pt102,], geometry.getMesh(), Field1D(TY, RE))+    dyPt102 = DbGeoPointValueExtractor([pt102,], [volset(idx+1), volset(idx+2)], Field1D(TY, RE))
     dyPt102.setEulerian(True)                       # Eulerian point (not moving with elements)     dyPt102.setEulerian(True)                       # Eulerian point (not moving with elements)
     dyPt102.setOutsideTol(0.5)                      # half an element outside detection tolerance     dyPt102.setOutsideTol(0.5)                      # half an element outside detection tolerance
Line 154: Line 168:
 Value are interpolated from Integration Points Values. Value are interpolated from Integration Points Values.
  
-  valueExtractor = IFGeoPointValueExtractor (pointList, mesh, InternalField)+  valueExtractor = IFGeoPointValueExtractor (pointList, meshedObject, InternalField) 
 +  valueExtractor = IFGeoPointValueExtractor (pointList, meshedObjectList, InternalField)
   valueExtractor.setEulerian(True)    valueExtractor.setEulerian(True) 
   valueExtractor.setOutsideTol(tol)   valueExtractor.setOutsideTol(tol)
Line 160: Line 175:
 where where
  
-| ''listPt''  | List of points where the field is extracted                         | +| ''listPt''         | List of points where the field is extracted                         | 
-| ''mesh''    | Mesh from which the value is extracted                              |  +| ''meshObject''     Meshed Object from where the point will try to find the element from which the value is interpolated |  
-| ''InternalField'' | [[doc:user:general:ifields|internal field]] of the element extrapolated in the node |  +| ''meshObjectList'' | List of Mesh Meshed Object from where the point will try to find the element from which the value is interpolated |  
-| ''tol''     | Outside tolerance in terms of reduced coordinate (default = 0.2)    | +| ''InternalField''  | [[doc:user:general:ifields|internal field]] of the element extrapolated in the node |  
 +| ''tol''            | Outside tolerance in terms of reduced coordinate (default = 0.2)    | 
  
 __Example:__ __Example:__
  
     pt102 = pointset.define(102,0.15*Lx,0.75*Ly,0)     # geo point of extraction (must be in pointset)     pt102 = pointset.define(102,0.15*Lx,0.75*Ly,0)     # geo point of extraction (must be in pointset)
-    eplPt102 = IFGeoPointValueExtractor([pt102,], geometry.getMesh(), IF_EPL) +    eplPt102 = IFGeoPointValueExtractor([pt102,], volset(101), IF_EPL) 
     eplPt102.setEulerian(True)                        # Eulerian point (not moving with elements)     eplPt102.setEulerian(True)                        # Eulerian point (not moving with elements)
     eplPt102.setOutsideTol(0.5)                       # half an element outside detection tolerance      eplPt102.setOutsideTol(0.5)                       # half an element outside detection tolerance 
          
  
-=== GeoPtValueExtractor ===+=== StrainGaugeValueExtractor ===
  
-Extract fields at given positionInterpolates nodal value of the corresponding element. These nodal values are either variables stored in these nodes (positions, displacements, temperature, fores, velocities, ...or an extrapolation and average of variables stored at the integration points.+It is possible to modelize strainGauge in Metafor using GeoPointValueExtractorsSelecting the 2 geometrical points  (anywhere in the meshdefining the Strain Gauge, the distance between the tho points can be computed during the simulation allowing to define a StrainGaufeValueExtractorThe strain measure define the kind of extractor : 
  
-  valueExtractor = GeoPtValueExtractor (listPt, meshfield+  valueExtractor = BiotStrainGaugeValueExtractor(listPt, meshedObject) 
-  valueExtractor = GeoPtValueExtractor (listPt, meshfieldsOp None)+  valueExtractor = BiotStrainGaugeValueExtractor(listPtmeshedObjectList
 +  valueExtractor = GLStrainGaugeValueExtractor(listPt, meshedObject) 
 +  valueExtractor = GLStrainGaugeValueExtractor(listPtmeshedObjectList) 
 +  valueExtractor = NatStrainGaugeValueExtractor(listPtmeshedObject) 
 +  valueExtractor NatStrainGaugeValueExtractor(listPt, meshedObjectList)
  
 where where
  
-| ''listPt''  | List of points where the field is extracted +| ''listPt''         | List of the 2 points defining the strain Gauge 
-| ''mesh''    Mesh from which the value is extracted |  +| ''meshObject''     Meshed Object from where the point will try to find the element from which the value is interpolated |  
-| ''field''   [[doc:user:general:locks|Field1D]] describing the scalar to extract or [[doc:user:general:ifields|internal field]] of the element extrapolated and averaged in the node |  +| ''meshObjectList''List of Mesh Meshed Object from where the point will try to find the element from which the value is interpolated  
-''sOp''     [[doc:user:general:SortingOperator|SortingOperator]] : sort nodes according to a geometric criterion  ''def=None'' will give the order in which these nodes are generated (not reliable) | +and if $\lambda = \frac{l}{l_0}$ the ratio of current to initial length of the Strain Gauge 
- +BiotStrainGaugeValueExtractor $\epsilon  \lambda-1 = \frac{l}{l_0}-1$ (Engineer Strain) | 
-__Example:__ +| GLStrainGaugeValueExtractor   | $\epsilon  = 0.5*(\lambda^2-1) $ | 
- +| NatStrainGaugeValueExtractor  | $\epsilon  = ln(\lambda)$ |
-  valuesmanager.add(8, GeoPtValueExtractor [point1, point2], Field1D(T0,RE)), 'temperature_P1_P2')+
  
-Extract a result curve numbered 8 defined by the temperature in points 1 and 2. This curve is named ''temperature_P1_P2''. 
 === TdFieldValueExtractor === === TdFieldValueExtractor ===
  
Line 264: Line 282:
 |              | 3D : Topological volume | |              | 3D : Topological volume |
 | ''ifield''   | [[doc:user:general:ifields|internal field]] of the element extrapolated to the node |  | ''ifield''   | [[doc:user:general:ifields|internal field]] of the element extrapolated to the node | 
-|              | ''TX'' : X coordinate|  +|              | if ifield = TXTY or TZ the extractor computes the current position of the Integration Point 
-|              | ''TY'' : Y coordinate| +
-|              | ''TZ'' : Z coordinate|+
  
-:!: works, but :!::!::!:+:!: works, but it is difficult to select the topoCell :!::!::!:
  
-==== Extracting elementary values ====+=== IFGPInteractionValueExtractor=== 
 + 
 +Extract values of [[doc:user:general:ifields|internal fields]] at the integration points for all the elements of aninteraction. 
 + 
 +  valueExtractor = IFGPInteractionValueExtractor(inter, ifield) 
 + 
 +where  
 + 
 +| ''inter''   | Reference to a volumic interaction (FieldApplicator) | 
 +| ''ifield''  | [[doc:user:general:ifields|internal field]] of the element extrapolated to the node |  
 + 
 + 
 + 
 + 
 +==== Extracting mean elementary values ====
  
 === IFElementValueExtractor === === IFElementValueExtractor ===
Line 285: Line 315:
 | ''ifield''   | [[doc:user:general:ifields|internal field]] of the element averaged over the element |  | ''ifield''   | [[doc:user:general:ifields|internal field]] of the element averaged over the element | 
  
-:!: works, but :!::!::!:+:!: works, but selection of the topoCell may be difficult :!::!::!: 
 + 
 +=== IFElementsValueExtractor === 
 + 
 +Extract values of [[doc:user:general:ifields|internal fields]] averaged on each element of an interaction (1 mean value by element). 
 + 
 +  valueExtractor = IFElementsValueExtractor (inter, ifield) 
 + 
 +where 
 + 
 +| ''inter'' | Reference to a volumic Interaction (FieldApplicator) | 
 +| ''ifield''   | [[doc:user:general:ifields|internal field]] of the element averaged over the element |  
  
 ==== Extracting analysis values (MiscValueExtractor) ==== ==== Extracting analysis values (MiscValueExtractor) ====
doc/user/results/courbes_res.1637834463.txt.gz · Last modified: by papeleux

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki