30 #include "MeshKernel/RangeCheck.hpp"
86 range_check::CheckGreater(parameters.
num_columns, 0,
"Number of columns");
87 range_check::CheckGreater(parameters.
num_rows, 0,
"Number of rows");
88 range_check::CheckInClosedInterval(parameters.
angle, {-90.0, 90.0},
"Grid angle");
89 range_check::CheckGreater(parameters.
block_size_x, 0.0,
"X block size");
90 range_check::CheckGreater(parameters.
block_size_y, 0.0,
"Y block size");
91 range_check::CheckGreaterEqual(parameters.
radius_curvature, 0.0,
"Radius of curvature");
97 auto isFinite = [](
const double value)
98 {
return std::isfinite(value); };
100 range_check::CheckPrecondition(parameters.
block_size_x,
"X block size",
"value is finite", isFinite);
101 range_check::CheckPrecondition(parameters.
block_size_y,
"Y block size",
"value is finite", isFinite);
102 range_check::CheckPrecondition(parameters.
radius_curvature,
"Radius of curvature",
"value is finite", isFinite);
104 range_check::CheckPrecondition(parameters.
maximum_uniform_size_rows,
"Maximum size / delta-y",
"value is finite", isFinite);
105 range_check::CheckPrecondition(parameters.
uniform_columns_fraction,
"Uniform m-fraction",
"value is finite", isFinite);
106 range_check::CheckPrecondition(parameters.
uniform_rows_fraction,
"Uniform n-fraction",
"value is finite", isFinite);
130 range_check::CheckGreater(parameters.
m_refinement, 0,
" M-refinement factor");
131 range_check::CheckGreater(parameters.
n_refinement, 0,
"N-refinement factor");
133 range_check::CheckInClosedInterval(parameters.
smoothing_parameter, {0.0, 1.0},
"Smoothing parameter");
173 range_check::CheckGreater(parameters.
aspect_ratio, 0.0,
"Aspect ratio");
175 range_check::CheckGreater(parameters.
average_width, 0.0,
"Average width");
177 range_check::CheckOneOf(parameters.
grow_grid_outside, {0, 1},
"Grow grid outside");
224 range_check::CheckGreater(parameters.
min_edge_size, 0.0,
"Min edge size");
227 static std::vector<int>
const ValidMeshRefinementTypes{1, 2, 3};
228 range_check::CheckOneOf(parameters.
refinement_type, ValidMeshRefinementTypes,
"Refinement type");
232 range_check::CheckGreater(parameters.
max_courant_time, 0.0,
"Max courant time");
260 range_check::CheckGreater(parameters.
outer_iterations, 0,
"Outer iterations");
262 range_check::CheckGreater(parameters.
inner_iterations, 0,
"Inner iterations");
int num_columns
The number of columns in x direction.
Definition: Parameters.hpp:40
double average_width
Average mesh width on center spline.
Definition: Parameters.hpp:147
double angle
The grid angle.
Definition: Parameters.hpp:46
double uniform_rows_fraction
Fraction of cells containing the default grid row size.
Definition: Parameters.hpp:75
int boundary_iterations
Number of boundary iterations in grid/net orthogonalization within itatp.
Definition: Parameters.hpp:243
int remove_skinny_triangles
Check for collisions with other parts of the front.
Definition: Parameters.hpp:168
double areal_to_angle_smoothing_factor
Factor between smoother 1d0 and area-homogenizer 0d0.
Definition: Parameters.hpp:255
int check_front_collisions
Check for collisions with other parts of the front, 1 or not 0.
Definition: Parameters.hpp:165
int inner_iterations
Number of inner iterations in grid/net orthogonalization within itbnd.
Definition: Parameters.hpp:246
A struct used to describe the spline to curvilinear grid parameters in a C-compatible manner.
Definition: Parameters.hpp:138
int refinement_type
Refinement criterion type.
Definition: Parameters.hpp:201
double block_size_y
The grid block size in y dimension, used only for squared grids.
Definition: Parameters.hpp:58
int directional_refinement
Directional refinement, cannot be used when the number of smoothing iterations is larger than 0.
Definition: Parameters.hpp:216
double maximum_uniform_size_rows
Maximum element row size.
Definition: Parameters.hpp:81
int smoothing_iterations
Nr. of inner iterations in regular grid smoothing.
Definition: Parameters.hpp:119
double origin_x
The x coordinate of the origin, located at the bottom left corner.
Definition: Parameters.hpp:49
double upper_right_x
The x coordinate of the upper right corner.
Definition: Parameters.hpp:61
double orthogonalization_to_smoothing_factor_at_boundary
Minimum ATPF on the boundary.
Definition: Parameters.hpp:252
int outer_iterations
Number of outer iterations in orthogonalization. Increase this parameter for complex grids.
Definition: Parameters.hpp:240
This struct describes the necessary parameters to create a new curvilinear grid in a C-compatible man...
Definition: Parameters.hpp:37
double radius_curvature
Radius of curvature.
Definition: Parameters.hpp:67
double aspect_ratio
Aspect ratio (mfacmax)
Definition: Parameters.hpp:141
double smoothing_parameter
Smoothing parameter.
Definition: Parameters.hpp:122
A struct used to describe parameters for generating a curvilinear grid in a C-compatible manner.
Definition: Parameters.hpp:110
int n_refinement
N-refinement factor for regular grid generation (nfacmax)
Definition: Parameters.hpp:116
double maximum_uniform_size_columns
Maximum element column size.
Definition: Parameters.hpp:78
double min_edge_size
Minimum edge size in meters.
Definition: Parameters.hpp:198
Contains the logic of the C++ static library.
Definition: AveragingInterpolation.hpp:36
double attraction_parameter
Attraction/repulsion parameter.
Definition: Parameters.hpp:125
double orthogonalization_to_smoothing_factor
Factor from 0 to 1. between grid smoothing and grid orthogonality.
Definition: Parameters.hpp:249
double min_cosine_crossing_angles
Minimum allowed absolute value of crossing-angle cosine.
Definition: Parameters.hpp:162
int m_refinement
M-refinement factor for regular grid generation (mfacmax)
Definition: Parameters.hpp:113
A struct used to describe the mesh refinement parameters in a C-compatible manner.
Definition: Parameters.hpp:186
int smoothing_iterations
The number of smoothing iterations.
Definition: Parameters.hpp:210
double aspect_ratio_grow_factor
Grow factor of aspect ratio.
Definition: Parameters.hpp:144
int maximum_num_faces_in_uniform_part
Maximum number of layers in the uniform part.
Definition: Parameters.hpp:156
int connect_hanging_nodes
Connect hanging nodes at the end of the iteration, 1 yes or 0 no.
Definition: Parameters.hpp:204
double origin_y
The y coordinate of the origin, located at the bottom left corner.
Definition: Parameters.hpp:52
double upper_right_y
The y coordinate of the upper right corner.
Definition: Parameters.hpp:64
int refine_intersected
Whether to compute faces intersected by polygon (yes=1/no=0)
Definition: Parameters.hpp:192
int use_mass_center_when_refining
Whether to use the mass center when splitting a face in the refinement process (yes=1/no=0)
Definition: Parameters.hpp:195
double uniform_columns_fraction
Fraction of cells containing the default grid column size.
Definition: Parameters.hpp:72
int max_num_refinement_iterations
Maximum number of refinement iterations, set to 1 if only one refinement is wanted.
Definition: Parameters.hpp:189
int account_for_samples_outside
Take samples outside face into account , 1 yes 0 no.
Definition: Parameters.hpp:207
double max_courant_time
Maximum courant time in seconds.
Definition: Parameters.hpp:213
double block_size_x
The grid block size in x dimension, used only for squared grids.
Definition: Parameters.hpp:55
double nodes_on_top_of_each_other_tolerance
On-top-of-each-other tolerance.
Definition: Parameters.hpp:159
int grow_grid_outside
Grow the grid outside the prescribed grid height.
Definition: Parameters.hpp:153
int num_rows
The number of rows in y direction.
Definition: Parameters.hpp:43
A struct used to describe the orthogonalization parameters in a C-compatible manner.
Definition: Parameters.hpp:237
int curvature_adapted_grid_spacing
Curvature adapted grid spacing, 1 or not 0.
Definition: Parameters.hpp:150