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

# FreeFormVariationModel< 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 |
| | [FreeFormVariationModel](#aec126b3dd03818d82d08a1c5e754d066) ([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, string the\_set\_part\_ident, string the\_set\_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 |

## Public Attributes

| Type | Name |
| - | - |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [boundary\_indices](#abb9e9eb503998d60ccf0cc0cc126a058) data indices of nodes/elements which define the boundary of the set (this is used as base to automatically place the points) |
| [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\_distances](#a4747182e290167f628dc2d28252d2b80) if true then the distance vectors are exported |
|  bool | [compute\_variations](#a6ff9b92e10644b70006b0bb16db05514) true, if the individual variations are to be computed |
| [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. |
| bool | [enforce\_zero\_at\_fixed\_boundary](#a8025221d9d946cfd26bdb58445a467e3) if true (default), then a smooth transition is done at the interface between the morphed and fixed boundary. (actually zero displacement at interface) |
|  bool | [erase\_degenerated\_shapes](#ae0ad6fb9c609ccb4e5420a4145a760f2) if true, then alle shapes being associated with too small correlations lengths will be eliminated from the model. The option 'num\_optimal\_points' is then an upper limit |
| [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 | [normalized](#abd25a61e43bde861a1884014fcbab45d) if true (default), then the shapes are normalized such that they behave as partition of unity. |
|  number | [num\_optimal\_points](#a858d5fd93f354af40736c0fb5529a99f) if >0 then additionally to the support point group (if any) the algorithm tries to find an optimal pattern with the given additional number of points |
|  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 |
|  bool | [scale\_mean](#a126ea7d9e7d5164e5ed97b2e3f004030) if true, the mean is associated with a scaling parameter and will be the first shape |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [stddev](#af24a4523c727241b8dc9d7114f595c30) standard deviation of the field |
|  string | [support\_set\_ident](#a2d58793abae634cf4ecabf6a7135a7fe) the ident of the given set of supports |
|  string | [support\_set\_part\_ident](#a53536e46e87404af1bcdd7058b885b78) the part ident of the given set of supports |
| bool | [use\_topological\_distance](#a5fd63b096f890c414a2d9c9eee572f57) if true (default) then the topological distance is used, else the spatial distance |

## Detailed Description

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

Provides random field models.

**Template Parameters**

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

This class provides a field parameterization similar to random field correlation models. The basic idea is that one creates "tents" around given support points. The tent is actually given through an autocorrelation function (governed by a correlation length parameter) centered around each support point. The supports are defined through sets.

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

### FreeFormVariationModel()

```cpp theme={null}
FreeFormVariationModel(
    Structure database,
    string the_quantity_ident,
    string the_set_part_ident,
    string the_set_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\_set\_part\_ident | the part ident of the given set of supports |
| the\_set\_ident | the ident of the given set of supports |
| 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 |

## Member Data Documentation

### enforce\_zero\_at\_fixed\_boundary

```cpp theme={null}
bool enforce_zero_at_fixed_boundary
```

if true (default), then a smooth transition is done at the interface between the morphed and fixed boundary. (actually zero displacement at interface)

> [!NOTE]
>
> This is only working if a normalized shape is used.

### use\_topological\_distance

```cpp theme={null}
bool use_topological_distance
```

if true (default) then the topological distance is used, else the spatial distance

> [!NOTE]
>
> If you use the spatial distance then no edges or regions are supported by manually define support point sets!
