> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RandomFieldData Class Reference

Part of [Data](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data)

contains random field data for analysis and simulation for a single random field.

## Public Types

| Type | Name |
| - | - |
|  typedef boost::shared\_ptr\< MultivariateDistributionBase > | [TDistributionPtr](#a24d0dc626d6d31e81a461a20f9557cfa) a shared pointer for multivariate distributions |

## Public Member Functions

| Type | Name |
| - | - |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [computeAmplitudeValues](#acebb4ff4d9a51a69eb9646bb35eb22ea) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) field\_value) computes amplitudes from a single field design |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [computeAmplitudeValues](#a583d020cdb9334f7378c0de7376f8752) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) field\_value, [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) missing\_items) computes amplitudes from a single field design |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [computeFieldValues](#abb292d5fb3d90f98d866dcbd114884b8) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) amplitudes) computes a field design from a single sample of amplitudes |
| | [copyToDatabase](#a0ec04e9e17dee09820302a852e62162b) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b), bool overwrite\_existing) copies contained data to the database (being visible in data object table) |
| [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) | [cumulativeVariations](#adcf200c25db6c2e496eaa66edc51ee97) () |
| | [eraseDatabaseCopies](#a37662babd77d3217b300cc31a4ddf4af) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) deletes all data objects contained in this data structure from the respective database. |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [globalCumulativeVariations](#aa914fa93f4c20c7d8673cdf5e3f8f269) () |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [globalIndividualVariations](#acec8f475d53c2b1e59317c2ef59a32dc) () |
| [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) | [individualVariations](#a4d80880f7c5349051e0575814175de6e) () |
| [RandomFieldData](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_random_field_data.md) | [operator=](#a402db4bc4303a80b04e6d7e94f1a9b6d) ([RandomFieldData](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_random_field_data.md) other) overrides the default assignment operator (making it thread-safe) Only the shared pointers are copied (the objects are not duplicated). The distributions are duplicated! |
| bool | [operator==](#a9a55092319719557b7fdbcdfd93b0912) ([RandomFieldData](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_random_field_data.md) other) |
| string | [quantityIdent](#a99b4f75e16e3f7ea6997ca785617935f) () destructor |
| | [RandomFieldData](#aa3a22354f868058240f0be941b6bb0c7) () a default constructor used for serialization |
| | [RandomFieldData](#a61bdf13d5d68dce2e84400b8522b336f) (string quantity\_ident, [dataobject\_types](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga1bebf1e22deb3cd41d7d99ddcdb15379) [type](#a5419dd52be3756534b1789724f4bfbbd), [TDistributionPtr](#a24d0dc626d6d31e81a461a20f9557cfa) field\_distribution, Eigen::VectorXd global\_variations\_individual, number total\_variation, [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) [shapes](#a997883dcd1950473d4d41087deb0dc56), Eigen::MatrixXd pseudo\_inverse) constructor The constructor creates values for |
| [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) | [shapes](#a997883dcd1950473d4d41087deb0dc56) () |
| number | [totalVariation](#adc06eb4750fed838cee093631b1d58d6) () |
| [dataobject\_types](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga1bebf1e22deb3cd41d7d99ddcdb15379) | [type](#a5419dd52be3756534b1789724f4bfbbd) () |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [variation](#aa55eab527fe10e5f5842ae33cf3bc6f1) () |

## Detailed Description

contains random field data for analysis and simulation for a single random field.

## Constructor & Destructor Documentation

### RandomFieldData()

```cpp theme={null}
RandomFieldData(
    string quantity_ident,
    dataobject_types type,
    TDistributionPtr field_distribution,
    Eigen::VectorXd global_variations_individual,
    number total_variation,
    DataObjectVector shapes,
    Eigen::MatrixXd pseudo_inverse
)
```

constructor The constructor creates values for

* m\_quantity\_ident
* m\_type
* m\_field\_distribution
* m\_gaussan\_distribution
* m\_shapes
* m\_global\_variations\_cumulative
* m\_global\_variations\_individual

  **Parameters**

  | Name | Description |
  | - | - |
  | quantity\_ident | sets m\_quantity\_ident |
  | type | sets m\_type, the dataobject type of this random field |
  | field\_distribution | sets m\_field\_distribution; |
  | global\_variations\_individual | defines the absolute values of the variations of each shape (respective the whole random field group) |
  | total\_variation | the absolute value of the total global variation present in the system (respective the whole random field group) |
  | shapes | the linear scatter shapes |
  | pseudo\_inverse | is a temporary term in the pseudo inverse, i.e. (A'A)^(-1) with A being the matrix of the shapes. For random fields, this is the dialogonal matrix of the inverse eigenvalues. Else it is the true pseudo inverse... |

## Member Function Documentation

### computeAmplitudeValues() \[1/2]

```cpp theme={null}
Matrix computeAmplitudeValues(Matrix field_value)
```

computes amplitudes from a single field design

> [!NOTE]
>
> For cross-correlated fields, you must build the sum of all amplitude vectors of all fields belongig to the same field group.

**Parameters**

| Name | Description |
| - | - |
| field\_value | the field design |

**Returns**

a vector of amplitudes

### computeAmplitudeValues() \[2/2]

```cpp theme={null}
Matrix computeAmplitudeValues(
    Matrix field_value,
    Matrix missing_items
)
```

computes amplitudes from a single field design

> [!NOTE]
>
> For cross-correlated fields, you must build the sum of all amplitude vectors of all fields belongig to the same field group.

> [!NOTE]
>
> Use this function to "reconstruct" missing items. The projection operator will be changed such that the random field can be used for "reconstruction".

**Parameters**

| Name | Description |
| - | - |
| field\_value | the field design |
| missing\_items | defines the missing items: 0 = is existing, !=0 = is missing. |

**Returns**

a vector of amplitudes

### computeFieldValues()

```cpp theme={null}
Matrix computeFieldValues(Matrix amplitudes)
```

computes a field design from a single sample of amplitudes

> [!NOTE]
>
> For cross-correlated fields, you must use the same amplitude values of all fields belongig to the same field group.

**Parameters**

| Name | Description |
| - | - |
| amplitudes | the amplitude values for a single sample |

**Returns**

the field value vector

### copyToDatabase()

```cpp theme={null}
copyToDatabase(
    Structure database,
    bool overwrite_existing
)
```

copies contained data to the database (being visible in data object table)

**Parameters**

| Name | Description |
| - | - |
| database | the target database |
| overwrite\_existing | if true, then data objects with identical ident will be replaced, else an exception is thrown. |

### cumulativeVariations()

```cpp theme={null}
DataObjectVector cumulativeVariations()
```

**Returns**

a const-reference to m\_variations\_cumulative

### eraseDatabaseCopies()

```cpp theme={null}
eraseDatabaseCopies(Structure database)
```

deletes all data objects contained in this data structure from the respective database.

**Parameters**

| Name | Description |
| - | - |
| database | the database to be deleted |

### globalCumulativeVariations()

```cpp theme={null}
Matrix globalCumulativeVariations()
```

**Returns**

a const-reference to m\_global\_variations\_cumulative

### globalIndividualVariations()

```cpp theme={null}
Matrix globalIndividualVariations()
```

**Returns**

a const-reference to m\_global\_variations\_individual

### individualVariations()

```cpp theme={null}
DataObjectVector individualVariations()
```

**Returns**

a const-reference to m\_variations\_individual

### operator=()

```cpp theme={null}
RandomFieldData operator=(RandomFieldData other)
```

overrides the default assignment operator (making it thread-safe) Only the shared pointers are copied (the objects are not duplicated). The distributions are duplicated!

**Parameters**

| Name | Description |
| - | - |
| other | the source object |

**Returns**

a reference to this object

### operator==()

```cpp theme={null}
bool operator==(RandomFieldData other)
```

Both objects must not contain NULL pointers!

**Parameters**

| Name | Description |
| - | - |
| other | the other object to be compared with |

**Returns**

true if both objects contain the same content

> [!NOTE]
>
> This operator should be used with care. It is slow since the data of the distributions are first converted to Meta format and are then compared!

### quantityIdent()

```cpp theme={null}
string quantityIdent()
```

destructor

**Returns**

a const-reference to m\_quantity\_ident

### shapes()

```cpp theme={null}
DataObjectVector shapes()
```

**Returns**

a const-reference to m\_shapes

### totalVariation()

```cpp theme={null}
number totalVariation()
```

**Returns**

a const-reference to m\_total\_variation

### type()

```cpp theme={null}
dataobject_types type()
```

**Returns**

a const-reference to m\_quantity\_ident

### variation()

```cpp theme={null}
DataObjectPtr variation()
```

**Returns**

a const-reference to m\_variation
