next up previous contents index
Next: I.5 The ``ResKeyList'' class Up: I. FeResPost Reference Manual Previous: I.3 The ``Group'' class   Contents   Index

Subsections


I.4 The ``Result'' class

The ``Result'' class is devoted to the manipulation of finite element Results. Examples of Results are stress tensor on volumic or surfacic elements, displacements, grid point forces,... The ruby class ``Result'' is a wrapping around the C++ class ``Result''.

Results can be read from various solver binary files. See Part III for more information.

The ``Result'' class allows the storage and manipulation of Real as well as Complex values. Note however that several of the methods of Result class do not allow the manipulation of Complex Results. Therefore, indications are inserted here and there in this Chapter to provide information about the ``Complex capabilities'' of the different methods.

An important comment must be done: Even though the results can be imported into a DataBase, this does not mean that the manipulation of the results is correct. Indeed, all manipulation that involve transformation of coordinate systems can be incorrect because geometric non-linearities are not taken into account. Methods that can be affected by this limitation are for example: ``modifyRefCoordSys'', ``modifyPositionRefCoordSys'' and ``calcResultingFM''.

A list of the methods defined in ``Result'' class is given in Table I.4.1.

Table I.4.1: The different methods that have been defined in ``Result'' class. userManual.Result.methods.tab
(FeResPost list of classes is given in Table 1 page [*].)
Method Name Description Example
     
Creation and initialization methods
Result.newnew I.4.13 IV.2.4.6
Result.initializeinitialize I.4.13  
Result.cloneclone I.4.13 IV.2.4.6
Manipulation of data
Result.Name=Name= I.4.5.1  
Result.NameName I.4.5.1  
Result.clearDataclearData I.4.5.1  
Result.getDatagetData I.4.9 IV.2.4.2
Result.SizeSize I.4.13 IV.2.4.1
Result.Format=Format= I.4.5.1  
Result.FormatFormat I.4.5.1  
Result.TensorOrder=TensorOrder= I.4.5.1  
Result.TensorOrderTensorOrder I.4.5.1  
Result.setIntIdsetIntId I.4.5.1  
Result.getIntIdgetIntId I.4.5.1  
Result.setRealIdsetRealId I.4.5.1  
Result.getRealIdgetRealId I.4.5.1  
Result.insertinsert I.4.5.1  
Result.insertRklValsinsertRklVals I.4.5.1  
Result.setComponentsetComponent I.4.5.1  
Result.setRefCoordSyssetRefCoordSys I.4.5.2  
Result.renumberLayersrenumberLayers I.4.5.3  
Result.renumberSubLayersrenumberSubLayers I.4.5.4  
Result.removeLayersremoveLayers I.4.5.5  
Result.removeSubLayersremoveSubLayers I.4.5.6  
Result.modifyRefCoordSysmodifyRefCoordSys I.4.5.7 IV.2.4.5
Result.modifyPositionRefCoordSysmodifyPositionRefCoordSys I.4.5.8 IV.2.5.2
Result.setToCombilisetToCombili I.4.5.9  
Extraction methods
Result.extractResultOnEntitiesextractResultOnEntities I.4.2.1  
Result.extractResultOnLayersextractResultOnLayers I.4.2.2  
Result.extractResultOnSubLayersextractResultOnSubLayers I.4.2.3  
Result.extractResultOnRklextractResultOnRkl I.4.2.4 IV.2.4.2
Result.extractResultOnResultKeysextractResultOnResultKeys I.4.2.5  
Result.extractResultOnRangeextractResultOnRange I.4.2.6  
Result.extractResultForNbrValsextractResultForNbrVals I.4.2.7  
Result.extractResultMinextractResultMin I.4.2.8  
Result.extractResultMaxextractResultMax I.4.2.9 IV.2.4.2
Result.extractRklOnRangeextractRklOnRange I.4.2.10  
Result.extractRklForNbrValsextractRklForNbrVals I.4.2.11  
Result.extractRklMinextractRklMin I.4.2.12  
Result.extractRklMaxextractRklMax I.4.2.13  
Result.extractRklextractRkl I.4.2.14 IV.2.4.2
Result.extractLayersextractLayers I.4.2.18  
Result.extractSubLayersextractSubLayers I.4.2.19  
Result.extractGroupextractGroup I.4.2.17  
Result.extractGroupOnRangeextractGroupOnRange I.4.2.15  
Result.extractGroupForNbrValsextractGroupForNbrVals I.4.2.16  
Derivation methods
Result.deriveScalToScalderiveScalToScal I.4.3.1 IV.2.4.2
Result.deriveScalPerComponentderiveScalPerComponent I.4.3.2 IV.2.4.2
Result.deriveVectorToOneScalderiveVectorToOneScal I.4.3.3 IV.2.5.4
Result.deriveVectorToVectorderiveVectorToVector I.4.3.4  
Result.deriveVectorToTensorderiveVectorToTensor I.4.3.5  
Result.deriveTensorToOneScalderiveTensorToOneScal I.4.3.6  
Result.deriveTensorToTwoScalsderiveTensorToTwoScals I.4.3.7  
Result.deriveTensorToThreeScalsderiveTensorToThreeScals I.4.3.8  
Result.deriveDyadicderiveDyadic I.4.4  
Result.deriveByRemappingderiveByRemapping I.4.3.9  
Global Force and Moment
Result.calcResultingFMcalcResultingFM I.4.7 IV.2.5.3
Operators
Result.++ I.4.6.1  
Result.- I.4.6.2  
Result.** I.4.6.3 IV.2.5.2
Result.// I.4.6.4  
Result.**** I.4.6.5  
BLOBs for SQL
Result.toBlobtoBlob I.4.10 IV.2.6, VIII.1.5, VI.1.8
Result.fromBlobfromBlob I.4.10  
Iterators
Result.eacheach I.4.11 IV.2.4.4
Result.each_keyeach_key I.4.11 IV.2.4.5
Result.each_valueseach_values I.4.11 IV.2.4.5
Complex Results manipulation
Result.set2RIset2RI I.4.8.1 IV.2.4.6
Result.set2MPset2MP I.4.8.1 IV.2.4.6
Result.conjugateconjugate I.4.8.2  
Result.getRgetR I.4.8.4 IV.2.4.6
Result.getMgetM I.4.8.4 IV.2.4.6
Result.getIgetI I.4.8.4 IV.2.4.6
Result.getPgetP I.4.8.4 IV.2.4.6
Result.rotateByrotateBy I.4.8.3  
Result.assembleComplexassembleComplex I.4.8.5 IV.2.4.6
A few singleton methods
Result.layerStr2IntlayerStr2Int I.4.12  
Result.layerInt2StrlayerInt2Str I.4.12  
Result.subLayerStr2IntsubLayerStr2Int I.4.12  
Result.subLayerInt2StrsubLayerInt2Str I.4.12  
Attributes
Result.NameName I.4.5.1  
Other methods
Result.to_sto_s I.4.13  
Attributes
Result.NameName I.4.5.1  
Result.SizeSize I.4.13 (read only)
Result.FormatFormat I.4.5.1  
Result.TensorOrderTensorOrder I.4.5.1  
     


I.4.1 The concept of ``Result''

Basically, a Result may be considered as a mapping between ``keys'' and ``values''. These two concepts are discussed in sections I.4.1.1 and I.4.1.2 respectively.

Otherwise several member data of Result objects can be accessed at ruby level. This is the case for Result name, integer and real identifiers. Those are discussed in section I.4.1.3.


I.4.1.1 ``Keys''

The ``keys'' of Results correspond to the entities to which ``values'' are associated. For example, a key may be:

So, at C++ level, each key is characterized by four integers: At ruby level, one can work with either the C++ integer ids, or their string correspondent. The correspondence between string and integers are given in Tables I.4.2, I.4.3, I.4.4 and I.4.5. The data given in these Tables can be completed by additional data peculiar to the different supported solvers. (See Part III for more information.)

In Table I.4.4, the last layers IDs cannot be attributed to Result keys. The elements corresponds to groups of layers and are used to perform extraction operations:


Table I.4.2: Correspondence between element strings and their integer ids.
No element association
"NONE" -1
For Results associated to elements
"elem 1" 1
"elem 2" 2
"elem 3" 3
"elem ..." ...


Table I.4.3: Correspondence between special nodes for element Results and their integer ids.
No node association
"NONE" -999
For Results associated to nodes
"node 1" 1
"node 2" 2
"node 3" 3
"node ..." ...


Table I.4.4: Correspondence between Result layer names and their integer ids.
For unlayered Results
NONE
-999
Undefined layer
UNDEF
-300
For stress recovery in bars and beams
"PointA" -201
"PointB" -202
"PointC" -203
"PointD" -204
"PointE" -205
"PointF" -206
For 2D elements
"Z0"I.41 -100
"Z1" -101
"Z2" -102
For Results in laminates (positive layers)
"layer 1" 1
"layer 2" 2
"layer 3" 3
"layer ..." ...
Group of layers for extraction operations
"Beam Points" -2001
"Shell Layers" -2002
"All Plies" -2003
"All Layers" -2004


Table I.4.5: Correspondence between Result sub-layer names and their integer ids. ("All Sub-Layers" is used for extractions only.)
"NONE" 0
"All Sub-Layers" 50
"Bottom" 101
"Mid" 102
"Top" 103

Note that the notion of ``key'' is also closely related to the ``ResKeyList'' ruby class which is simply a list of key objects (see Chapter I.5).


I.4.1.2 ``Values''

The values of Result are characterized by an integer value (32 bits integer) and one or several real values. The integer value corresponds to the coordinate system into which the components are expressed:

Obviously, for several types of coordinate system, the values must be attached to an element to make sense. This is the case for ``elemIJK'', ``plyCS'', ``matCS'', ``elemCS'',...

The real values correspond to the components:

Note that the name of the components given above matter, as they may be used to extract a single component out of a vectorial or tensorial Result. For Complex Result, the numbers of components mentioned above is multiplied by two. They are presented in the following order: The components are stored in single precision real values (float coded on 32 bits). This means that there is no advantage at using double precision real values in your programming as far as the manipulation of results is concerned.


I.4.1.3 Identification of Result objects

Besides the mapping from key to values, the Result objects contain information that allow their identification. The identification information is:

The methods used to access these member data are described in section I.4.5.1.


I.4.1.4 Other characteristics

A Result object is also characterized by two other integer values:

Methods used to manipulate these data are described in section I.4.5.1. These two integers are attributes of the class.


I.4.2 Extraction methods

The class ``Result'' defines several methods allowing the construction of a new Result object, or of a ``ResKeyList'' object from a previously existing Result by an appropriate selection on the keys. The extraction methods defined in class Result are defined in the following sections.


I.4.2.1 ``Result.extractResultOnEntitiesextractResultOnEntities'' method

This method is used to extract a sub-set of keys and values from an existing Result object. The method returns the newly created Result object. The method has up to four arguments:

  1. The ``Method'' argument is a String object specifying the algorithm to be used to select the keys and values to be inserted in the new Result object. Possible values of this argument are:
  2. The ``Target'' argument is a Group containing the elements and/or nodes used by some of the algorithms described above to select sub-sets of Results.
  3. The ``LayersList'' argument is an Array containing the list of layers on which the pairs of key and value must be extracted. If the Array is void, then data corresponding to all layers are extracted. If the Array is not void, the elements must be String or integer objects
  4. The ``SubLayersList'' argument is an Array containing the list of sub-layers on which the pairs of key and value must be extracted. If the Array is void, then data corresponding to all sub-layers are extracted. If the Array is not void, the elements must be String or integer objects
The two last arguments are optional. Note that the ``Method'' argument described above is the same as the ``Method'' argument of the DataBase member method ``DataBase.getResultgetResult'' described in section I.1.3.

This method works for Real as well as for Complex Results.


I.4.2.2 ``Result.extractResultOnLayersextractResultOnLayers'' method

This method is used to extract a sub-set of keys and values from an existing Result object. The method returns the newly created Result object. The method has one ``LayersList'' argument: it is an Array containing the list of layers on which the pairs of key and value must be extracted. The elements of the Array argument are integers or String values.

This method works for Real as well as for Complex Results.


I.4.2.3 ``Result.extractResultOnSubLayersextractResultOnSubLayers'' method

This method is used to extract a sub-set of keys and values from an existing Result object. The method returns the newly created Result object. The method has one ``SubLayersList'' argument: it is an Array containing the list of sub-layers on which the pairs of key and value must be extracted. The elements of the Array argument are integers or String values.

This method works for Real as well as for Complex Results.


I.4.2.4 ``Result.extractResultOnRklextractResultOnRkl'' method

This method returns a Result object build by extraction of the values corresponding to the keys contained in the ResKeyList ``Target'' argument.

This method works for Real as well as for Complex Results.


I.4.2.5 ``Result.extractResultOnResultKeysextractResultOnResultKeys'' method

This method returns a Result object build by extraction of the values corresponding to the keys contained in the Result ``Target'' argument. (This method is very similar to ``Result.extractResultOnRklextractResultOnRkl'' method, except that the target is given by a Result argument.)

This method works for Real as well as for Complex Results.


I.4.2.6 ``Result.extractResultOnRangeextractResultOnRange'' method

This method returns a Result object build by extraction of the values selected by specifying a range. This method can be applied to scalar Result objects only as the range is specified by one or two Real values. The arguments of the method are:

  1. The ``Method'' String argument specifies the extraction algorithm that is used. Four values are possible:
  2. The ``LowerBound'' argument is a real value specifying the lower bound of the range. For some algorithms, this value may be unused and irrelevant.
  3. The ``UpperBound'' argument is a real value specifying the upper bound of the range. For some algorithms, this value may be unused and irrelevant.
This method works for Real Results only.


I.4.2.7 ``Result.extractResultForNbrValsextractResultForNbrVals'' method

This method returns a Result object build by extraction of maximum ``NbrVals'' values. This method can be applied to scalar Result objects only and has two arguments:

  1. The ``Method'' String argument specifies the extraction algorithm that is used. Two values are possible:
  2. ``NbrVals'' is an integer argument corresponding to the number of values to be kept.
This method works for Real Results only.


I.4.2.8 ``Result.extractResultMinextractResultMin'' method

This method returns a Result object build by extraction of the minimum value and corresponding key. This method can be applied to scalar Result objects only.

This method works for Real Results only.


I.4.2.9 ``Result.extractResultMaxextractResultMax'' method

This method returns a Result object build by extraction of the maximum value and corresponding key. This method can be applied to scalar Result objects only.

This method works for Real Results only.


I.4.2.10 ``Result.extractRklOnRangeextractRklOnRange'' method

This method works exactly as method ``Result.extractResultOnRangeextractResultOnRange'' described in section I.4.2.6 but returns a ResKeyList object instead of a Result object. This means that one returns only a list of keys, but not the associated values.

This method works for Real Results only.


I.4.2.11 ``Result.extractRklForNbrValsextractRklForNbrVals'' method

This method works exactly as method ``Result.extractResultForNbrValsextractResultForNbrVals'' described in section I.4.2.7 but returns a ResKeyList object instead of a Result object. This means that one returns only a list of keys, but not the associated values.

This method works for Real Results only.


I.4.2.12 ``Result.extractRklMinextractRklMin'' method

This method returns a ResKeyList object build by extraction of the key corresponding to the minimum value. This method can be applied to scalar Result objects only.

This method works for Real Results only.


I.4.2.13 ``Result.extractRklMaxextractRklMax'' method

This method returns a ResKeyList object build by extraction of the key corresponding to the maximum value. This method can be applied to scalar Result objects only.

This method works for Real Results only.


I.4.2.14 ``Result.extractRklextractRkl'' method

This method returns a ResKeyList object build by extraction of all the keys of the Result object to which the method is applied.

This method works for Real as well as for Complex Results.


I.4.2.15 ``Result.extractGroupOnRangeextractGroupOnRange'' method

This method works exactly as method ``Result.extractResultOnRangeextractResultOnRange'' described in section I.4.2.6 but returns a Group object instead of a Result object. The Group contains the element and node entities for which values in the specified range have been found.

This method works for Real Results only.


I.4.2.16 ``Result.extractGroupForNbrValsextractGroupForNbrVals'' method

This method works exactly as method ``Result.extractResultForNbrValsextractResultForNbrVals'' described in section I.4.2.7 but returns a Group object instead of a Result object. The Group contains the element and node entities for which values in the specified range have been found.

This method works for Real Results only.


I.4.2.17 ``Result.extractGroupextractGroup'' method

This method returns a Group object containing the elements and nodes that are referenced in the Result object. This method has no argument.

This method works for Real as well as for Complex Results.


I.4.2.18 ``Result.extractLayersextractLayers'' method

This method returns an Array of String and integers corresponding to the layers that are referenced in the Result object. This method has no argument.

This method works for Real as well as for Complex Results.


I.4.2.19 ``Result.extractSubLayersextractSubLayers'' method

This method returns an Array of String and integers corresponding to the sub-layers that are referenced in the Result object. This method has no argument.

This method works for Real as well as for Complex Results.


I.4.3 Derivation monadic methods

All the methods presented in this section are devoted to the production of new results by performing operations on the values of the Result object to which they are applied. Each method produces Results with as many pairs ``key-values'' as in the Result object to which it is applied, but the number of components associated to each key may be different than the original number of components. Indeed, the original Result and derived Result have not necessarily a same tensor order.

Most of the methods presented below have only one argument: a Method String object corresponding to the algorithm of derivation. The use of the methods defined below leads sometimes to very heavy notations for simple or very often used operations. Therefore, short-cuts to some methods have been defined in the ``Post'' module (Chapter I.6).


I.4.3.1 ``Result.deriveScalToScalderiveScalToScal'' method

This method builds a new Result object by performing an operation on all the values of the Result object to which it is applied. Both Result objects correspond to scalar values. The Possible values of the ``Method'' argument are:

The method works for Real Results as well as Complex Results. However, some of the methods are not available for Complex Results: ``asin'', ``acos'', ``atan'' and ``sgn'' can be used with Real Results only.


I.4.3.2 ``Result.deriveScalPerComponentderiveScalPerComponent'' method

This method builds a new Result object by performing a scalar operation on all the values of the Result object to which it is applied. The Result object can be scalar, vectorial or tensorial. In case, of vectorial or tensorial Result, the scalar operation is performed component-per-component, regardless of the coordinate system in which the values are expressed. The Possible values of the ``Method'' argument are the same as for Result.deriveScalToScalderiveScalToScal method. The method works for Real Results only. (Complex Results are not accepted and an exception is raised.)


I.4.3.3 ``Result.deriveVectorToOneScalderiveVectorToOneScal'' method

This method builds a new Result object by performing an operation on all the values of the Result object to which it is applied. The Result object to which the method is applied must be vectorial. The created Result object is scalar. Possible values of the ``Method'' String argument are:

This method works for Real Results as well as for Complex Results. When applied to a Complex Result object, the method works as follows:


I.4.3.4 ``Result.deriveVectorToVectorderiveVectorToVector'' method

This method builds a new Result object by performing an operation on all the values of the Result object to which it is applied. The Result object to which the method is applied must be vectorial. The created Result object is vectorial too. Possible values of the ``Method'' String argument are:

This method works for Real Results as well as for Complex Results.


I.4.3.5 ``Result.deriveVectorToTensorderiveVectorToTensor'' method

This method builds a new Result object by performing an operation on all the values of the Result object to which it is applied. The Result object to which the method is applied must be vectorial. The created Result object is tensorial too. Possible values of the ``Method'' String argument are:

This method works for Real Results as well as for Complex Results.


I.4.3.6 ``Result.deriveTensorToOneScalderiveTensorToOneScal'' method

This method builds a new Result object by performing an operation on all the values of the Result object to which it is applied. The Result object to which the method is applied must be tensorial. The created Result object is scalar. Possible values of the ``Method'' String argument are:

All the methods listed above work for Real Tensorial Results. For Complex Results, only the methods of Component extractions can be used.


I.4.3.7 ``Result.deriveTensorToTwoScalsderiveTensorToTwoScals'' method

This method returns an Array of two Result objects derived from the tensorial Result object on which the method is applied. The returned Results are scalar. Possible values of the ``Method'' String argument are:

This method works for Real Results only.


I.4.3.8 ``Result.deriveTensorToThreeScalsderiveTensorToThreeScals'' method

This method returns an Array of three Result objects derived from the tensorial Result object on which the method is applied. The returned Results are scalar. Possible values of the ``Method'' String argument are:

This method works for Real Results only.


I.4.3.9 ``Result.deriveByRemappingderiveByRemapping'' method

This method returns a Result object obtained by remapping the values of the Result object to which the method is applied. This method takes three parameters:

  1. ``FromTo'': a String object specifying the correspondence between the keys of the old Result object and the keys of the new Result object. Eleven different values of the ``FromTo'' argument are allowed:
  2. ``Method'': a String object used to specify the way values associated to different keys are merged into a single value (if this happens). An example of situation in which the case may occur is for example when one uses the ``NodesToCenters'' option and that the values of several nodes are merged into the value of a single element. Five values of ``Method'' argument are allowed: Note that when vectorial or tensorial Results are merged (``sum'' or ``average'' options, their respective coordinate systems must be identical. Otherwise an error message is issued.
  3. ``DB'': a DataBase object used by the method to recover the association of node and elements. This association is often needed to perform the remapping.
The ``Result.deriveByRemappingderiveByRemapping'' method can be used with Real as well as Complex Results. Only, for Complex Results, there are some restriction about the type of ``Method'' argument for merging values: the ``min'' and ``max'' values are not accepted for Complex Results.


I.4.4 Dyadic derivation method

Presently, only one such method is defined: the ``Result.deriveDyadicderiveDyadic'' method. This method returns a new Result object corresponding to the dyadic derivation. This method has two arguments:

Possible values for the ``Method'' argument are: Note that several of the methods above for dyadic derivation have corresponding short-cuts in the ``Post'' module.

The different methods listed above are available for real Results. For Complex Results, only the methods ``vectProduct'', ``sumVectProduct'', ``merge'', ``mergeKeepFirst'' and ``mergeKeepLast'' can be used. Of course, if the ''Second'' argument is a Real object, the ``deriveDyadic'' method cannot be invoked on a Complex Result object.

Note also that all the dyadic derivation methods discussed here are invoked on a Result object which is the first argument. Dyadic derivation methods that allow to replace the first argument by a real or vector object are also defined in the Post module. (See section I.6.3.)


I.4.5 Methods modifying the object

One presents here methods that modify the Result object to which they are applied.


I.4.5.1 Access to and modification of Result data

Each Result object is also characterized by two integer and two real identifiers. Different methods allow to retrieve or modify the Result data.

For the four last methods listed above, the value of index argument can be 0 or 1. Note that several of the methods listed above correspond to the ``Result.NameName'', ``Result.FormatFormat'' and ``Result.TensorOrderTensorOrder'' attributes.

All these methods can be used with Real Results as well as with Complex Results.


I.4.5.2 ``Result.setRefCoordSyssetRefCoordSys''

``setRefCoordSys'' is used to attribute a reference coordinate system to the values of a Result. The method has one argument that can have to types:

Note that only the coordinate system ids of the pairs of key and values are modified. The components of the vectorial or tensorial values are left unchanged.

This method can be used with Real Results as well as with Complex Results.


I.4.5.3 ``Result.renumberLayersrenumberLayers''

``renumberLayers'' is a method used to renumber the layer integer ids of Result keys. The method has one Hash argument corresponding to the pairs of ``old integers IDs'' and ``new integer IDs''.

This method can be used with Real Results as well as with Complex Results.


I.4.5.4 ``Result.renumberSubLayersrenumberSubLayers''

``renumberSubLayers'' is a method used to renumber the sub-layer integer ids of Result keys. The method has one Hash argument corresponding to the pairs of ``old integers IDs'' and ``new integer IDs''.

This method can be used with Real Results as well as with Complex Results.


I.4.5.5 ``Result.removeLayersremoveLayers''

``removeLayers'' is a method used to remove pairs of key and values selected on the basis of the layer ID of the key. The method has one ``LayersList'' argument: it is an Array containing the list of layers for which the pairs of key and value must be removed. The elements of the Array argument are integer or String values.

This method can be used with Real Results as well as with Complex Results.


I.4.5.6 ``Result.removeSubLayersremoveSubLayers''

``removeSubLayers'' is a method used to remove pairs of key and values selected on the basis of the layer ID of the key. The method has one ``SubLayersList'' argument: it is an Array containing the list of sub-layers for which the pairs of key and value must be removed. The elements of the Array argument are integer or String values.

This method can be used with Real Results as well as with Complex Results.


I.4.5.7 ``Result.modifyRefCoordSysmodifyRefCoordSys''

``modifyRefCoordSys'' is used to modify the reference coordinate system wrt which the components of a vectorial or a tensorial Result are applied. If the Result is vectorial it can represent any vectorial quantities except the coordinates. For coordinate vectorial Result, the method ``Result.modifyPositionRefCoordSysmodifyPositionRefCoordSys'' must be used. This method has no effect on scalar Results.

The methods returns nil (no new Result object is created) and takes two, three or five arguments:

  1. A DataBase object.
  2. An object corresponding to the definition of the coordinate system to which one switches. This object may have different types:
    1. A String object with one of the following values: ``elemCS'', ``nodeCS'', ``matCS'', ``plyCS'', ``elemIJK'', ``lamCS''. All those coordinate systems are local to an element or to a node.

      More information about the peculiarities of ``matCS'', ``plyCS'' and ``lamCS'' coordinate system transformations is given in section IX.B.5.

    2. The argument may by a CoordSys object. Then it must be defined wrt a coordinate system defined in the DataBase argument.
    3. The argument may also be an integer larger than or equal to 0. Then the coordinate system must be defined in the DataBase.
  3. The third argument is the direction vector used to build the projected coordinate system on surfacic elements. The vector is given by an Array of three real objects, and is expressed wrt to the coordinate system given in second argument. If one does not wish to transform into a projected coordinate system, then the third argument must be omitted or nil. (However if arguments 4 and 5 are provided, the third argument cannot be omitted.)
  4. An object corresponding to the definition of the coordinate system from which one switches. This object may have the same values as the second argument.
  5. The last argument is a direction vector used to build the projected coordinate system on surfacic elements. The vector is given by an Array of three real objects, and is expressed wrt to the coordinate system given in second argument. If one does not wish to transform into a projected coordinate system, then the third argument must be nil.
The reason why a DataBase object is given as argument is that for curvilinear coordinate systems, much information about the location of Result value is necessary to perform a correct transformation of the components. Also, all coordinate systems are stored in the DataBase object. Therefore, it is very important that the programmer keeps in mind that all Results are related to a DataBase.

Note that some transformation vectorial or tensorial coordinate systems cannot be reversed. For example, once a Result is expressed in a projected coordinate system. Also, if a conversion has been done in a coordinate system that is not defined in the DataBase, the conversion is impossible. After transformation, the coordinate system referenced in Result values is altered (section I.4.1.2).

If arguments 4 and 5 are provided, the method assumes that the values are expressed in that coordinate system definition. This means that the CsId found in each pair ``key-values'' pair of the Result object is totally disregarded. The use of arguments 4 and 5 may allow the modification of Results expressed in a user or projected coordinate system.

More information on the transformation of coordinate systems is given in section IX.B.4.

This method can be used with Real Results as well as with Complex Results.


I.4.5.8 ``Result.modifyPositionRefCoordSysmodifyPositionRefCoordSys''

``modifyPositionRefCoordSys'' is used to modify the reference coordinate system wrt which vectorial Results corresponding to coordinates are expressed. The Results must be vectorial.

The method returns nil (no new Result object is created) and takes two arguments:

  1. A DataBase object.
  2. An integer object corresponding to the index of the coordinate system to which one switches. This index must be larger than or equal to 0 and defined in the DataBase argument. One can also provide a CoordSys object instead of the integer argument.
For the reason of the presence of the DataBase argument, see section I.4.5.7.

This method can be used with real Results only.


I.4.5.9 ``Result.setToCombilisetToCombili''

The method fills the values of the Result object on which the method is called with the linear combination of the elementary Results given as arguments. The arguments are defined as follows:

  1. An Array of Real values containing the factors of the linear combination.
  2. An Array containing the elementary Results.
The lengths of the two Array arguments must match. Also the type of elementary Results (scalar, vectorial or tensorial) must be identical and the coordinate systems must be the same for a same key.

This method can be used with Real Results as well as with Complex Results. Also, the real factors of the linear combination can be replaced by Complex values. However, all the elements of the Array must be of the same type (Real or Complex).


I.4.6 Operators

Five elementary operators on Result objects have been defined. Also, their corresponding assignment method have been defined. Unless otherwise specified, in the examples given below, $ x$ , $ y$ and $ z$ are Result objects. One of the two operands can be replaced by a ``constant'' value in most cases, but at least one of the operands must be a Result object:

By ``constant'' value, one means a scalar real value, a scalar complex value, a real vector (Array of three real values), a complex vector (Array of three complex elements), or a real matrix (Array of $ 3\times 3$ real values). These arguments can be used in addition, substraction and multiplication operations. Note that no constant complex matrix is supported.

For the division operation, $ y$ can be replaced by a scalar real or complex argument, but not by a vector or a matrix. on the other hand, $ x$ can be replaced by constant scalar, vectorial or matrix, real or complex (except for the matrix).

For the exponentiation operator, the two Results must be scalar. Either $ x$ or $ y$ can be replaced by a constant real value.

One can make a few general remarks:

The support for Complex Result operators depends on the type of dyadic operation. See the sub-sections below for more information.


I.4.6.1 Addition operator

The addition operator can be used as follows:

$\displaystyle z=x+y\ .
$

In the previous expression, the Results $ x$ and $ y$ must have the same tensorial order. Of course, the returned $ z$ object is also of the same tensor order as $ x$ and $ y$ .


I.4.6.2 Substraction operator

The substraction operator can be used as follows:

$\displaystyle z=x-y\ .
$

In the previous expression, the Results $ x$ and $ y$ must have the same tensorial order. Of course, the returned $ z$ object is also of the same tensor order as $ x$ and $ y$ .


I.4.6.3 Multiplication operator

The multiplication operator can be used as follows:

$\displaystyle z=x*y\ .
$

The meaning of this operation depends on the tensorial orders of $ x$ and $ y$ . The various possibilities are summarized in Table I.4.6 with a short explanation of the meaning of the operation when deemed necessary.


Table I.4.6: Possible arguments of the Result multiplication operator, returned value, and meaning of the operation.
$ z$ $ x$ $ y$ meaning
S S S --
V S V --
M S M --
V V S --
S V V scalar product of two vectors
V V M left multiplication of a matrix by a vector
M M S --
V M V right multiplication of a matrix by a vector


I.4.6.4 Division operator

The division operator can be used as follows:

$\displaystyle z=x/y\ .
$

In the last expression $ x$ can have any tensorial order. The tensorial order of the returned Result $ z$ is identical to the tensorial order of $ x$ . The argument $ y$ can be either a scalar Result object, or a real value.

Complex Results are partially supported by the division operator. The limitations of the operator for complex arguments are the same as for the multiplication operator.


I.4.6.5 Exponent operator

The exponentiation operator can be used as follows:

$\displaystyle z=x**y\ .
$

In the last expression $ x$ must be a scalar Result. The tensorial order of the returned Result $ z$ is identical to the tensorial order of $ x$ . The argument $ y$ can be either a scalar Result object, or a real value. Complex Results cannot be arguments to this operator. The real values of first Result argument must also be positive.

The two following expressions are equivalent:

            z=x**y
            z=Post.pow(x,y)


I.4.7 ``Result.calcResultingFMcalcResultingFM'' method

This is a class method used to estimate the total force and moment corresponding to a distribution of forces and moments on several points. The method has between 4 and 6 arguments:

  1. A DataBase object containing the model used to calculate the total forces and moments.
  2. A first Result object corresponding to the vectorial forces.
  3. A second Result object corresponding to the vectorial moments.
  4. An object corresponding to the coordinate system in which results and position of recovery point are expressed. If the argument is an integer, it must correspond to the index of a CoordSys object defined in the dataBase. The argument can also be a CoordSys object, but its definition must refer a coordinate system defined in the dataBase.
  5. A vector (Array of three real values) corresponding to the position of the point wrt which the total force and moment are calculated. The position of the point is defined wrt the coordinate system corresponding to the previous argument. (This may different than what other post-processing tools like Patran do.)
  6. A Result object corresponding to the coordinates of the connections that are used to estimate the global moment. (See additional remarks below.)
Note that the two last arguments are optional: The sixth parameter containing the coordinates must be associated to the same Result keys as the forces Result. The parameter can be very useful when the forces are not associated to nodes. This is, for example, the case when the forces correspond to CBUSH element forces. For example, let us assume that the coordinate Results have been generated in the database:
        db.generateCoordResults("COORDS","COORDS","coords")
The coordinates corresponding to the forces can be obtained as follows:
        coords=db.getResultCopy("COORDS","COORDS","coords",forces.extractRkl())
And the global force and moment calculated as follows:
        fm=Result::calcResultingFM(db,forces,moments,csId,nil,Coords)

If argument Results are in Real format, the method returns an Array containing two vectors (i.e. two Arrays of Real objects). These vectors correspond to the total force and total moment respectively. Note that the method produces no new Result object.

If argument Results are Complex, the method returns an Array containing two Complex vectors (i.e. two Arrays of Complex objects). Note However that the Complex values in the resultants are always given in rectangular format (real and imaginary parts). This is true even when the argument Results are in polar (magnitude-phase) format.


I.4.8 Complex Results

Several methods correspond to operations specific to complex Results. These methods are described below.


I.4.8.1 Rectangular-Polar conversions

Two methods allow to tranform Complex Results expressed in real-imaginary format to magnitude-phase format, and reversely:

For these two methods, no complex conversion is performed if the Result is already in the requested format.


I.4.8.2 Conjugate Complex Result

``Result.conjugateconjugate'' produces a Result by initializing its values to conjugate of other values ( $ z\rightarrow\overline{z}$ ). The method has 0 or 1 argument. If the method has one argument, the object on which the method is called is set to the rectangular complex values of its argument. Otherwise, the object on which the methods is called is modified. Note that the method can also be called on a Real Result but has then no effect.


I.4.8.3 Rotation of Complex Result

The method ``Result.rotateByrotateBy'' is used to modify the values of a Complex Result by adding an angle specified in degrees to the corresponding phases. However, the method can be used indifferently with Complex Results in rectangular or in polar formats. The method may have one or two arguments:

Note that the rotation is done by multiplying the Result by a Complex value obtained as follows:

$\displaystyle z=e^{i\theta}=\cos\theta+i\sin\theta .
$

Angle $ \theta$ is always given in $ {}^\circ$ .


I.4.8.4 Extractions from Complex Results

Four methods produce Real Results from Complex Results by extracting the appropriate components:

These methods must be called on Complex Results. The polar or rectangular format of the Complex Results do not matter: if needed a polar-rectangular conversion of the components is done before the extraction.

The two methods ``Result.getRgetR'' and ``Result.getIgetI'' may have an optional Real argument that correspond to a rotation applied to the Result before extracting the Real or Imaginary component Result. More precisely, each component of each value is multiplied by $ e^{i\theta}$ before extracting the real or imaginary component. Angle $ \theta$ is always given in $ {}^\circ$ . Note that the Result on which the method is called is left unmodified.


I.4.8.5 Assembling Complex from Real Results

The ``Result.assembleComplexassembleComplex'' method is used to assemble a Complex Result object from two Real Results. The method is called on a Result object and has three arguments:

  1. An integer corresponding to the format of the new Complex Result. The accepted values are 2 (real-imaginary or rectangular format) or 3 (polar or magnitude-phase format).
  2. A first Result object that will correspond to the real or magnitude components of the assembled Result.
  3. A second Result object that will correspond to the imaginary of phase components of the assembled Result.
Note that the two Result arguments must satisfy several requirements: An example of valid (but not very useful) call to ``Result.assembleComplexassembleComplex'' follows:
    resR=res2.getR
    resI=res2.getI
    
    resRI=Result.new
    resRI.assembleComplex(2,resR,resI)
(At the end, resRI should be the same as res2.)


I.4.9 ``Result.getDatagetData''

The method returns an Array of Arrays containing the data stored in a Result object. The returned Array may actually be considered as a two-dimensional Array with as many lines as there are pairs of key-value in the Result object. Each line of the Array contains five, seven or ten elements:

  1. The first element corresponds to the elemId.
  2. The second element corresponds to the nodeId of the key.
  3. The third element corresponds to the layerId of the key.
  4. The fourth element corresponds to the subLayerId of the key.
  5. The fifth element corresponds to the coordinate system in which the value components are associated. The possible values are summarized in Table I.4.7.
  6. The other elements are real values corresponding to the components (1, 3 or 6 values for a scalar, vectorial or tensorial Result respectively). For the precise meaning of the returned value corresponding to coordinate system, see also section I.4.1.2.
The method may have 5, 4, 3, 2, 1 or no argument. The arguments correspond to the type of the Array elements corresponding to elemId, nodeId, layerId, subLayerId or coordSysId. In the returned Array, these elements may be of String or Integer types. Correspondingly the arguments are Strings the value of which can be "int", "string" or any other String. If any other String is used as argument (for example a void string), the default Integer or String type elements are returned.

For element, node and layer ids, the negative values correspond to ``special'' values. (See Tables I.4.2 to I.4.4.)




Table I.4.7: Correspondence between the integer in C++ ``value'' class and the value returned by Result member method ``Result.getDatagetData''.
integer in C++ ``value'' class returned value in ruby
-9999 nil
-2000 "userCS"
-1000 "projCS"
-5 "elemIJK"
-4 "plyCS"
-3 "matCS"
-2 "nodeCS"
-1 "elemCS"
any other integer the same integer


I.4.10 ``BLOBs''

Result objects can be saved in SQL database as ``BLOB'' objects.

Two methods are defined in Result class to convert object to and from Blobs:


I.4.11 Iterators

Three iterators are defined in the class:

For the meaning of the arguments, see more information in section I.4.9. One difference between the ``Result.eacheach'' iterator and the getData method is that the key and values elements are separated into two Arrays in the block. So the iterator is to be used as follows:
    strain.each("int","int","int") do |key,values|
        ...
    end
    ...
    strain.each("int","int","string","string") do |key,values|
        ...
    end
Note that, as the ``Result.each_keyeach_key'' and ``Result.each_valueseach_values'' iterators return Arrays, one can indifferently recover an Array argument, or its elements in the arguments of the block that follows the iterator. For example, in the following lines:
    stress.each_key do |stressKey|
        ...
    end
``stressKey'' is an Array of three elements. However in the following lines:
    stress.each_key("int","int","int") do |elemId,nodeId,layerId|
        ...
    end
the arguments correspond to the different identifiers of the Result key.


I.4.12 A few singleton (static) methods

Four singleton methods allow to convert layers and sub-layers string/integer IDs:


I.4.13 Other methods

One gives here a list of methods that do not fit in any category listed above.

I.4.13.1 ``Result.newnew''

This method is used to create a new Result object.

I.4.13.2 ``Result.initializeinitialize''

This method initializes or clears a Result object.

I.4.13.3 ``Result.cloneclone''

This method returns a Copy of the Result object to which it is applied.

I.4.13.4 ``Result.initZeroResultinitZeroResult''

this method is used to initialize a Result with zero values using the keys of an existing Result object. The Method has four arguments:

  1. A String corresponding to the Name of the Result.
  2. An integer corresponding to the tensor order (0, 1 or 2).
  3. An integer corresponding to the Format of the Result.
  4. A Result object that provides the keys to which the zero values of the new Result object will be associated.
The method returns the Result object on which it has been called.

I.4.13.5 ``Result.SizeSize'' attribute

Returns an integer containing the numbers of pairs ``key-value'' contained in the Results object. This method has no argument. It corresponds to the ``Size'' read-only attribute.

I.4.13.6 ``Result.to_sto_s''

This method is used for printing the Result object.


next up previous contents index
Next: I.5 The ``ResKeyList'' class Up: I. FeResPost Reference Manual Previous: I.3 The ``Group'' class   Contents   Index
FeResPost 2017-05-28