Skip to main content

oSP3D Script API 2024 R1

ComputeRelativeError< TYPE > Class Template Reference

Last update: 16.07.2025

Computes the relative accuracy between two quantities given using $ \epsilon = \frac{x_{\mbox{other}}}{x_{\mbox{ref}}} $ If set, the relative error is computed using $ \epsilon = \frac{x_{\mbox{other}}-x_{\mbox{ref}}}{max_i |x_{\mbox{ref}}|_i } $. More...

Public Types

enum  eType { ACCURACY = 0, UNSIGNED_ERROR, SIGNED_ERROR, DIFF }
 the type of error function More...
 

Public Member Functions

 check (Structure database)
 
 compute (Structure database)
 
 ComputeRelativeError (string output_quantity_ident, DataObjectContainer reference, DataObjectContainer other)
 Collects all data to compute the relative accuracy between the objects reference and other. More...
 
 ComputeRelativeError (string output_quantity_ident, string reference_ident, string other_ident, Structure database)
 Collects all data to compute the relative accuracy between the objects reference and other. More...
 

Public Attributes

eType error_type
 If false, the error is computed, else the relative accuracy.
 
bool interpolate_missing_items
 If set to true, one uses the interpolated (filled) missing field vector item.
 
DataObjectContainer other
 Defines the quantity ident to be chosen as reference value.
 
string output_quantity_ident
 Defines the name of the new quantity ident.
 
bool overwrite_existing
 Set to true if alredy existing data objects need to be replaced.
 
DataObjectContainer reference
 Defines the quantity ident to be chosen as reference value.
 

Detailed Description

template<dataobject_types TYPE>
class ComputeRelativeError< TYPE >

Computes the relative accuracy between two quantities given using $ \epsilon = \frac{x_{\mbox{other}}}{x_{\mbox{ref}}} $ If set, the relative error is computed using $ \epsilon = \frac{x_{\mbox{other}}-x_{\mbox{ref}}}{max_i |x_{\mbox{ref}}|_i } $.

Template Parameters
TYPE

Member Enumeration Documentation

◆ eType

enum eType

the type of error function

Enumerator
ACCURACY 

compute accuracy in %

UNSIGNED_ERROR 

compute relative error in %

SIGNED_ERROR 

compute relative error in % with a sign indicating the direction

DIFF 

compute abs. error as difference

Constructor & Destructor Documentation

◆ ComputeRelativeError() [1/2]

ComputeRelativeError ( string  output_quantity_ident,
DataObjectContainer  reference,
DataObjectContainer  other 
)

Collects all data to compute the relative accuracy between the objects reference and other.

Parameters
output_quantity_identThe quantiy ident of the new data object
referenceThe reference data object; the divisor.
otherThe other data object, the divident.

◆ ComputeRelativeError() [2/2]

ComputeRelativeError ( string  output_quantity_ident,
string  reference_ident,
string  other_ident,
Structure  database 
)

Collects all data to compute the relative accuracy between the objects reference and other.

Parameters
output_quantity_identThe quantiy ident of the new data object
reference_identThe ident of the reference data object, the divisor.
other_identThe ident of the other data object, the divident.
databaseThe database used to filter the reference as well as the other data object from.

Connect with Ansys