Utilities for extracting components and boundary condition types from strings. More...
Enumerations | |
enum class | Type { all = 0 , scalar = 1 , vector = 2 , normal = 3 , tangential = 4 } |
Enumerator used to identify patterns of components and their size in the a block system. More... | |
Functions | |
template<int dim, int spacedim> | |
std::unique_ptr< FiniteElement< dim, spacedim > > | get_lagrangian_finite_element (const Triangulation< dim, spacedim > &tria, const unsigned int degree=1, const int continuity=0) |
Get a Lagrangian FiniteElement object compatible with the given Triangulation object. More... | |
template<int dim, int spacedim> | |
Quadrature< dim > | get_cell_quadrature (const Triangulation< dim, spacedim > &tria, const unsigned int degree) |
Return a Quadrature object that can be used on the given Triangulation cells. More... | |
template<int dim, int spacedim> | |
Quadrature< dim - 1 > | get_face_quadrature (const Triangulation< dim, spacedim > &tria, const unsigned int degree) |
Return a Quadrature object that can be used on the given Triangulation faces. More... | |
template<typename Container > | |
std::string | join (const Container &strings, const std::string &separator) |
Join strings in a container together using a given separator. More... | |
unsigned int | n_components (const std::string &component_names) |
Count the number of components in the given list of comma separated components. More... | |
unsigned int | n_blocks (const std::string &component_names) |
Count the number of components in the given list of comma separated components. More... | |
std::string | blocks_to_names (const std::vector< std::string > &components, const std::vector< unsigned int > &multiplicities) |
Build component names from block names and multiplicities. More... | |
std::pair< std::vector< std::string >, std::vector< unsigned int > > | names_to_blocks (const std::string &component_names) |
Build block names and multiplicities from component names. More... | |
std::vector< unsigned int > | block_indices (const std::string &component_names, const std::string &selected_components) |
Return the indices within the block corresponding to the given selected components, or numbers::invalid_unsigned_int if the selected components could not be found. More... | |
std::vector< unsigned int > | component_indices (const std::string &component_names, const std::string &selected_components) |
Return the indices within the components corresponding to first component of the given selected components, or numbers::invalid_unsigned_int if the selected components could not be found. More... | |
std::pair< unsigned int, unsigned int > | component_to_indices (const std::string &component_names, const std::string &selected_component) |
Return the indices within the components and within the blocks corresponding to first component of the given selected component, or numbers::invalid_unsigned_int if the selected components could not be found. More... | |
std::string | component_name (const std::string &component_names, const std::string &selected_component) |
Return the canonical component name for the given selected component. More... | |
Type | type (const std::string &component_name, const std::string &selected_component) |
Return the component type for the given selected component. More... | |
ComponentMask | mask (const std::string &component_names, const std::string &selected_component) |
Return a component mask corresponding to a given selected component, from a list of comma separated components. More... | |
Utilities for extracting components and boundary condition types from strings.
|
strong |
Enumerator used to identify patterns of components and their size in the a block system.
Enumerator | |
---|---|
all | All components. |
scalar | Scalar. |
vector | |
normal | Normal component of a vector. |
tangential | Tangential component of a vector. |
Definition at line 43 of file components.h.
std::unique_ptr<FiniteElement<dim, spacedim> > ParsedTools::Components::get_lagrangian_finite_element | ( | const Triangulation< dim, spacedim > & | tria, |
const unsigned int | degree = 1 , |
||
const int | continuity = 0 |
||
) |
Get a Lagrangian FiniteElement object compatible with the given Triangulation object.
The returned object can be either FE_Q, FE_DGQ, FE_P, or FE_DGP according to the types of elements of the Triangulation (quads/hexes VS tria/tets)
tria | The triangulation to inspect |
degree | The polynomial degree of the Lagrangian FiniteElement |
continuity | The continuity of the Lagrangian FiniteElement: 0 for continuous, -1 for discontinuous |
Referenced by PDEs::Serial::ReducedLagrange< dim, spacedim >::generate_grids_and_fes().
Quadrature<dim> ParsedTools::Components::get_cell_quadrature | ( | const Triangulation< dim, spacedim > & | tria, |
const unsigned int | degree | ||
) |
Return a Quadrature object that can be used on the given Triangulation cells.
tria | Triangulation to insepct |
degree | The degree of the 1d quadrature used to generate the actual quadrature. |
Referenced by PDEs::Serial::ReducedLagrange< dim, spacedim >::assemble_system(), PDEs::LinearViscoElasticity< dim, spacedim, LacType >::assemble_system(), PDEs::MPI::Poisson< dim, spacedim >::custom_estimator(), main(), PDEs::LinearElasticity< dim, spacedim, LacType >::postprocess(), PDEs::LinearViscoElasticity< dim, spacedim, LacType >::postprocess(), and PDEs::Serial::ReducedLagrange< dim, spacedim >::setup_coupling().
Quadrature<dim - 1> ParsedTools::Components::get_face_quadrature | ( | const Triangulation< dim, spacedim > & | tria, |
const unsigned int | degree | ||
) |
Return a Quadrature object that can be used on the given Triangulation faces.
tria | Triangulation to insepct |
degree | The degree of the 1d quadrature used to generate the actual quadrature. |
Referenced by PDEs::MPI::Poisson< dim, spacedim >::custom_estimator(), and PDEs::LinearElasticity< dim, spacedim, LacType >::postprocess().
std::string ParsedTools::Components::join | ( | const Container & | strings, |
const std::string & | separator | ||
) |
Join strings in a container together using a given separator.
unsigned int ParsedTools::Components::n_components | ( | const std::string & | component_names | ) |
Count the number of components in the given list of comma separated components.
Definition at line 32 of file components.cc.
References Utilities::split_string_list().
Referenced by mask().
unsigned int ParsedTools::Components::n_blocks | ( | const std::string & | component_names | ) |
Count the number of components in the given list of comma separated components.
Definition at line 217 of file components.cc.
References b(), and names_to_blocks().
std::string ParsedTools::Components::blocks_to_names | ( | const std::vector< std::string > & | components, |
const std::vector< unsigned int > & | multiplicities | ||
) |
Build component names from block names and multiplicities.
Definition at line 40 of file components.cc.
References AssertDimension, and Patterns::Tools::to_string().
std::pair< std::vector< std::string >, std::vector< unsigned int > > ParsedTools::Components::names_to_blocks | ( | const std::string & | component_names | ) |
Build block names and multiplicities from component names.
Definition at line 56 of file components.cc.
References AssertDimension, and Utilities::split_string_list().
Referenced by block_indices(), component_indices(), mask(), n_blocks(), and type().
std::vector< unsigned int > ParsedTools::Components::block_indices | ( | const std::string & | component_names, |
const std::string & | selected_components | ||
) |
Return the indices within the block corresponding to the given selected components, or numbers::invalid_unsigned_int if the selected components could not be found.
Accepted patterns are comma separated versions of the following string types:
Examples:
Definition at line 134 of file components.cc.
References AssertThrow, b(), component_name(), StandardExceptions::ExcMessage(), names_to_blocks(), and Utilities::split_string_list().
Referenced by component_indices(), component_to_indices(), mask(), and PDEs::Serial::Stokes< dim >::setup_system().
std::vector< unsigned int > ParsedTools::Components::component_indices | ( | const std::string & | component_names, |
const std::string & | selected_components | ||
) |
Return the indices within the components corresponding to first component of the given selected components, or numbers::invalid_unsigned_int if the selected components could not be found.
Accepted patterns are comma separated versions of the following string types:
Examples:
If the component names are unique, this is the same as the block_indices() function, otherwise it returns the first component indices.
Definition at line 156 of file components.cc.
References b(), block_indices(), and names_to_blocks().
Referenced by component_to_indices(), and mask().
std::pair< unsigned int, unsigned int > ParsedTools::Components::component_to_indices | ( | const std::string & | component_names, |
const std::string & | selected_component | ||
) |
Return the indices within the components and within the blocks corresponding to first component of the given selected component, or numbers::invalid_unsigned_int if the selected components could not be found.
For example, for component names "u,u,p", there are three components (two for "u" and one for "p"), and two blocks ("u" and "p").
This function returns the indices of the first component of the selected component, and the index of the block, so, for "u" it would return {0,0} and for "p" it would return {2,1} (third component, second block).
Accepted patterns are the following string types:
Examples:
Definition at line 170 of file components.cc.
References AssertDimension, AssertThrow, block_indices(), component_indices(), and StandardExceptions::ExcMessage().
Referenced by type().
std::string ParsedTools::Components::component_name | ( | const std::string & | component_names, |
const std::string & | selected_component | ||
) |
Return the canonical component name for the given selected component.
For example, for component names "u,u,p", there are three components (two for "u" and one for "p"), and two blocks ("u" and "p").
This function returns the canonical component name for an associated pattern of components.
Accepted patterns are the following string types:
Examples:
Definition at line 72 of file components.cc.
References AssertThrow, StandardExceptions::ExcMessage(), Utilities::int_to_string(), Utilities::split_string_list(), and Utilities::string_to_int().
Referenced by block_indices().
Type ParsedTools::Components::type | ( | const std::string & | component_name, |
const std::string & | selected_component | ||
) |
Return the component type for the given selected component.
For example, for component names "u,u,p", there are three components (two for "u" and one for "p"), and two blocks ("u" and "p").
This function returns the component type for an associated pattern of components, according to the multiplicity of the given component, and to the normal or tangential component.
Accepted patterns are the following string types:
Examples:
Definition at line 186 of file components.cc.
References b(), component_to_indices(), names_to_blocks(), and Utilities::split_string_list().
Referenced by ParsedTools::DataOut< dim, spacedim >::add_data_vector().
ComponentMask ParsedTools::Components::mask | ( | const std::string & | component_names, |
const std::string & | selected_component | ||
) |
Return a component mask corresponding to a given selected component, from a list of comma separated components.
Definition at line 226 of file components.cc.
References AssertDimension, AssertThrow, b(), block_indices(), component_indices(), StandardExceptions::ExcMessage(), Utilities::int_to_string(), mask(), n_components(), and names_to_blocks().
Referenced by mask(), and ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().