Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
ShapeGenerator Namespace Reference

Functions

template<int dim>
const DeprecatedEnumNames< typename Shape< dim >::ShapeType > & deprecated_shape_type_names ()
template<int dim>
Shape< dim >::ShapeType string_to_shape_type (const std::string &type)
template<int dim>
std::shared_ptr< Shape< dim > > initialize_shape (const std::string &type, const std::string &shape_arguments_str, const Point< dim > &position, const Tensor< 1, 3 > &orientation)
template<int dim>
std::shared_ptr< Shape< dim > > initialize_shape_from_vector (const std::string &type, const std::vector< double > &shape_arguments, const Point< dim > &position, const Tensor< 1, 3 > &orientation)
template<int dim>
std::shared_ptr< Shape< dim > > initialize_shape_from_file (const std::string &type, const std::string &file_name, const Point< dim > &position, const Tensor< 1, 3 > &orientation)

Function Documentation

◆ deprecated_shape_type_names()

template<int dim>
template const DeprecatedEnumNames< Shape< 3 >::ShapeType > & ShapeGenerator::deprecated_shape_type_names< 3 > ( )

Return the deprecated strings of the shape types, which remain accepted in parameter files, composite shape files and particle files.

Template Parameters
dimNumber of spatial dimensions.
Returns
The deprecated strings, each paired with its shape type.

Definition at line 12 of file shape_parsing.cc.

◆ initialize_shape()

template<int dim>
std::shared_ptr< Shape< dim > > ShapeGenerator::initialize_shape ( const std::string & type,
const std::string & shape_arguments_str,
const Point< dim > & position,
const Tensor< 1, 3 > & orientation )

Initializes the shape from its type and arguments

Parameters
typethe type of shape
shape_arguments_strthe raw arguments
positionthe position of the shape
orientationthe orientation of the shape

Definition at line 37 of file shape_parsing.cc.

References initialize_shape_from_file(), initialize_shape_from_vector(), and string_to_shape_type().

◆ initialize_shape_from_file()

template<int dim>
std::shared_ptr< Shape< dim > > ShapeGenerator::initialize_shape_from_file ( const std::string & type,
const std::string & file_name,
const Point< dim > & position,
const Tensor< 1, 3 > & orientation )

Initializes the shape from its type and a text file that contains the real initialization data

Parameters
typethe type of shape
file_namethe name of the file that contains the initialization data
positionthe position of the shape
orientationthe orientation of the shape

Definition at line 195 of file shape_parsing.cc.

References CompositeShape< dim >::Difference, initialize_shape(), CompositeShape< dim >::Intersection, string_to_shape_type(), and CompositeShape< dim >::Union.

◆ initialize_shape_from_vector()

template<int dim>
std::shared_ptr< Shape< dim > > ShapeGenerator::initialize_shape_from_vector ( const std::string & type,
const std::vector< double > & shape_arguments,
const Point< dim > & position,
const Tensor< 1, 3 > & orientation )

Initializes the shape from its type and numerical arguments

Parameters
typethe type of shape
shape_argumentsthe numerical arguments
positionthe position of the shape
orientationthe orientation of the shape

Definition at line 70 of file shape_parsing.cc.

References string_to_shape_type().

◆ string_to_shape_type()

template<int dim>
template Shape< 3 >::ShapeType ShapeGenerator::string_to_shape_type< 3 > ( const std::string & type)

Return the shape type designated by a string, which is either the name of a Shape<dim>::ShapeType enumerator or one of the deprecated strings given by deprecated_shape_type_names(). No deprecation warning is printed, since the string may come from a composite shape file or a particle file rather than from a parameter.

Template Parameters
dimNumber of spatial dimensions.
Parameters
[in]typeString designating the type of shape.
Returns
The corresponding shape type. An exception is thrown if type designates no shape type.

Definition at line 26 of file shape_parsing.cc.

References deprecated_shape_type_names(), and string_to_enum().