> ## 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.

# RandomFieldModel< TYPE > Class Template Reference

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

Provides random field models.

## Public Types

| Type | Name |
| - | - |
|  typedef boost::function\< number([TVector3](#ac0d670e6fce88a32ba09b94ee2986486) x, [TVector3](#ac0d670e6fce88a32ba09b94ee2986486) y)> | [TCorrelationFunction](#ae4d13ee9cee1411b69a1ffd9af194792) a function which is called to analyze the correlation |
|  typedef std::vector\< number > | [TDoubleVector](#a21c6585e88c32a52212d4ac105eb39ff) a vector of floating point numbers |
|  typedef Eigen::Vector3d | [TVector3](#ac0d670e6fce88a32ba09b94ee2986486) a 3D vector type |

## Public Member Functions

| Type | Name |
| - | - |
| | [check](#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([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)) checks the settings on plausibility |
| | [compute](#ab08e112d95fe611e7eb25491c354d115) ([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)) does the action |
| | [RandomFieldModel](#ace13351ede0c8b63e0a5be83e7684940) ([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), string the\_quantity\_ident, [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) the\_mean, [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) the\_stddev) default constructor |
| | [setExponentialCorrelation](#a7f2216977cc501be2e472a247d24271d) (number length) Defines the correlation model in standard-normal space being a simple exponential one using the distance between two points. |
| | [setSquaredExponentialCorrelation](#a0fb1b39a30ea9919c30896528c9f711c) (number length) Defines the correlation model in standard-normal space being an exponential one using the squared distance between two points. |

## Public Attributes

| Type | Name |
| - | - |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [bounds\_lower](#a6008fdd8bc9379f4a074ccf57abd1cbe) lower bounds (may be an empty pointer) |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [bounds\_upper](#ac0b91270e206e0b5236cc4d17a215d56) upper bounds (may be an empty pointer) |
|  bool | [compute\_cumulative\_variations](#a90e0662e0da2173b7b39687519f6653a) true, if the cumulative variations are to be computed |
|  bool | [compute\_variations](#a6ff9b92e10644b70006b0bb16db05514) true, if the individual variations are to be computed |
|  number | [desired\_variation](#a5ecc81a378f43a9771f33fde41beab13) the desired variation (when reducing the model; 0\<x\<1). Default: 0.9 |
| [MultivariateDistributionTypes::enum\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_multivariate_distribution_types.md#af7ca783694e51f78ef01ceb1e00104c5) | [distribution\_type](#a0c6e3d3e7e9a9245af75b6f9ef2f5c76) The ident of the probability distribution that is assumed to convert data from original space to Gaussian. If empty (default), then it is automatically chosen. |
|  number | [max\_number](#a71834b001cda26914823c8b04b030cb4) the maximum number of vectors to be computed. Default: 5 |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [mean](#a071ffc5c9bc6ab830900c5727e1392c1) mean value of the field |
|  bool | [overwrite\_existing](#ade25e60bd85c8b4abd4f5b416cae0eb9) Is true if already existing output data objects will be replaced. In this case, also all depending objects of the already existing one will be deleted. |
|  string | [quantity\_ident](#a0bbf72a5fdb5d02b186d0cf2392939f2) the ident of the quantity for which the random field is to be generated |
|  size\_t | [seed](#a46d5ac75b96c0be73dfef4955cec41ac) the initial random seed used for random number generators used internally. |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [stddev](#af24a4523c727241b8dc9d7114f595c30) standard deviation of the field |
|  number | [sub\_space\_dimension](#a36cd5d971bf3ecc306f0bb6f3b6380d4) the sub space dimension This is the number of points in sub space for which the full and dense correlation matrix is created. Must not be too large. Absolute maximum (on 64 bit CPUs): 16000. Recommended maximum: 2000. |

## Detailed Description

#### template\<dataobject\_types TYPE>  class RandomFieldModel\< TYPE >

Provides random field models.

**Template Parameters**

| Name | Description |
| - | - |
| TYPE | the field data type |

This class provides random field correlation models. Herein, the required information to simulate random fields (scatter shapes, distribution information etc.) are based on a simple numerical model assumption. Such models may be used if there is not sufficient data available for the estimation of the true correlation structure.

The correlation models employed here refer to the correlation matrix that is created after transforming the field marginal CDF to standard normal space.

## Constructor & Destructor Documentation

### RandomFieldModel()

```cpp theme={null}
RandomFieldModel(
    Structure database,
    string the_quantity_ident,
    DataObjectPtr the_mean,
    DataObjectPtr the_stddev
)
```

default constructor

**Parameters**

| Name | Description |
| - | - |
| database | the database where all data is stored into |
| the\_quantity\_ident | sets quantity\_ident |
| the\_mean | sets mean |
| the\_stddev | sets stddev |

## Member Function Documentation

### check()

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

checks the settings on plausibility

It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine.

**Parameters**

| Name | Description |
| - | - |
| database | the SoS structure |

### compute()

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

does the action

**Parameters**

| Name | Description |
| - | - |
| database | the database where all data is stored into |

### setExponentialCorrelation()

```cpp theme={null}
setExponentialCorrelation(number length)
```

Defines the correlation model in standard-normal space being a simple exponential one using the distance between two points.

**Parameters**

| Name | Description |
| - | - |
| length | the correlation length (as absolute number) |

### setSquaredExponentialCorrelation()

```cpp theme={null}
setSquaredExponentialCorrelation(number length)
```

Defines the correlation model in standard-normal space being an exponential one using the squared distance between two points.

**Parameters**

| Name | Description |
| - | - |
| length | the correlation length (as absolute number) |
