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

# PiecewiseConstantModel< 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 |
| | [PiecewiseConstantModel](#a55cbb33de43b306528f8bba14651db89) ([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 |

## 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) |
| [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. |
| [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 |
| [DataObjectPtr](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_ptr.md) | [stddev](#af24a4523c727241b8dc9d7114f595c30) standard deviation of the field |

## Detailed Description

#### template\<dataobject\_types TYPE>  class PiecewiseConstantModel\< 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

### PiecewiseConstantModel()

```cpp theme={null}
PiecewiseConstantModel(
    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\_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 |
