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

# GenerateRandomFields Class Reference

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

an algorithm that computes new field samples from amplitudes and scatter shapes The algorithm is essentially the same is the class FieldDesignsFromAmplitudes, but it is based on the data structures stored in class [RandomFieldContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_random_field_container.md).

## 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 |
| | [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)) computes the new objects |
| | [GenerateRandomFields](#a9b4d942be5d786f7d0e764a62a3ffa94) ([DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) selected\_scalars, bool enforce\_equal\_idents=false) constructor |

## Public Attributes

| Type | Name |
| - | - |
|  bool | [accept\_partial\_subspace](#a591952882aeaa67ab84a56aa4d053268) if true, then one accepts that the set of random field amplitudes is incomplete. E.g. if no amplitude is selected, then one simly assumes a value of "zero" |
|  bool | [overwrite\_existing](#ade25e60bd85c8b4abd4f5b416cae0eb9) if true, existing outut objects will be replaced, otherwise: error if it already exists |

## Detailed Description

an algorithm that computes new field samples from amplitudes and scatter shapes The algorithm is essentially the same is the class FieldDesignsFromAmplitudes, but it is based on the data structures stored in class [RandomFieldContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_random_field_container.md).

> [!WARNING]
>
> ****[Deprecated:](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/deprecated.md#_deprecated000014)****
>
> This class is deprecated with SoS 3.3. It should be removed with SoS 3.4

## Constructor & Destructor Documentation

### GenerateRandomFields()

```cpp theme={null}
GenerateRandomFields(
    DataObjectContainer selected_scalars,
    bool enforce_equal_idents = false
)
```

constructor

**Parameters**

| Name | Description |
| - | - |
| selected\_scalars | the selected scalar quantities that are ALL amplitudes to be used |
| enforce\_equal\_idents | if true, then the same quantity idents are used as the input idents (is only used in optiSLang's simulation flow. Usually objects with that quantity ident already exist!) |

## Member Function Documentation

### check()

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

checks the settings

**Parameters**

| Name | Description |
| - | - |
| database | the database we refer to |

**Exceptions**

| Name | Description |
| - | - |
| an | exception in case of an error |

### compute()

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

computes the new objects

**Parameters**

| Name | Description |
| - | - |
| database | the database we refer to |
