# SMS:Size Function

A size function is a multiple that guides the size of elements to be created in SMS.

A size function determines the element size based off of a dataset that will be created by SMS. Each point is assigned a size value. This size value is the approximate size of the elements to be created in the region where the point is located. The mesh will be denser where the size values are smaller.

Using the Data Calculator allows created size function datasets in SMS. The size function dataset can then be used to redistribute vertices along an arc or used as the bathymetry for polygons.

Size functions can be based off of different criteria. For example, they may be based on either depth, slope, or curvature of the model.

### Size Function Based on Depth

Many coastal models utilize a size function based on depth. As the depth gets shallower, the elements should get smaller. The model will become finer near areas of interest and coarser at deep water areas that are less significant.

A size function based on depth uses the following equation:

${\biggl (}{\Bigl (}{\frac {positive\ depth\ -\ minimum\ depth}{maximum\ depth\ -\ minimum\ depth}}{\Bigr )}\ *\ (maximum\ size\ -\ minimum\ size)\ +\ minimum\ size{\biggr )}$ ### Size Function Based on Slope

Size functions based on slope are helpful when analyzing slope data because as the rate of change of the gradient increases, the smaller the mesh element becomes. Size functions based on slope are mostly applied to riverine models.

A size function based on slope uses the following equation:

$maximum\ size\ -\ {\Bigl (}{\frac {slope\ -\ minimum\ slope}{maximum\ slope\ -\ minimum\ slope}}{\Bigr )}\ *\ (maximum\ size\ -\ minimum\ size)$ 