Plugins
ug::Electromagnetism::EMaterial< TDomain > Class Template Reference

Class for subdomain-dependent data for the E-based formulated problems. More...

#include <em_material.h>

Classes

struct  TSubdomData
 data item type More...
 

Public Member Functions

void add (const char *subsets, number mu)
 adds a insulator More...
 
void add (const char *subsets, number mu, number sigma)
 adds a generic subset data item More...
 
const std::vector< int > & base_conductor_index () const
 
int base_conductor_index (int si) const
 
const std::vector< int > & base_conductors () const
 
void close ()
 finalizes the object More...
 
ConstSmartPtr< domain_typedomain () const
 returns pointer to the domain More...
 
 EMaterial (ConstSmartPtr< domain_type > domain)
 Constructor. More...
 
bool finalized () const
 returns true iff closed More...
 
bool get_mu_sigma (int si, number &mu, number &sigma) const
 reads the data for a subdomain from the data item More...
 
const std::vector< int > & min_conductor_ssi () const
 
int min_conductor_ssi (int si) const
 
ConstSmartPtr< subset_handler_typesubset_handler () const
 constant access to the subset handler More...
 
const char * subset_names () const
 returns the string of the subset names More...
 

Private Types

typedef TDomain domain_type
 domain type More...
 
typedef domain_type::subset_handler_type subset_handler_type
 subset handler type More...
 
typedef std::map< int, TSubdomData * > t_data_map
 Data map type. More...
 
typedef EMaterial< TDomain > this_type
 own type More...
 

Private Member Functions

void analyze_topology ()
 analyzes the conductor topology of the domain More...
 
void connectivity (std::vector< int > &minCondInd)
 computes the connectivity of the conductions More...
 

Private Attributes

std::vector< int > m_baseCondInd
 
std::vector< int > m_baseConductors
 
bool m_bClosed
 Flag that indicates that the description of the domain has been completed. More...
 
std::vector< int > m_minCondSsI
 
t_data_map m_mUserDataBC
 Map assigning subdomain indices to the subdomain data items. More...
 
ConstSmartPtr< domain_typem_spDomain
 domain More...
 
std::string m_sSsNames
 String of all the subset names mentioned in the data items. More...
 
std::vector< TSubdomDatam_vSdD
 Subdomain data items. More...
 

Static Private Attributes

static const int dim = domain_type::dim
 world dimension More...
 

Detailed Description

template<typename TDomain>
class ug::Electromagnetism::EMaterial< TDomain >

Class for subdomain-dependent data for the E-based formulated problems.

This class stores the magnetic permeabilities and electric conductivities for the subdomains. It is used as a parameter set for the discretizations. Furthermore, this class finds out the connectivity of the conductors. This information is used (in particular) for the projection of the solution to the divergence-free space.

Member Typedef Documentation

◆ domain_type

template<typename TDomain >
typedef TDomain ug::Electromagnetism::EMaterial< TDomain >::domain_type
private

domain type

◆ subset_handler_type

template<typename TDomain >
typedef domain_type::subset_handler_type ug::Electromagnetism::EMaterial< TDomain >::subset_handler_type
private

subset handler type

◆ t_data_map

template<typename TDomain >
typedef std::map<int, TSubdomData *> ug::Electromagnetism::EMaterial< TDomain >::t_data_map
private

Data map type.

◆ this_type

template<typename TDomain >
typedef EMaterial<TDomain> ug::Electromagnetism::EMaterial< TDomain >::this_type
private

own type

Constructor & Destructor Documentation

◆ EMaterial()

template<typename TDomain >
ug::Electromagnetism::EMaterial< TDomain >::EMaterial ( ConstSmartPtr< domain_type domain)

Constructor.

Constructor: initializes the object and checks the validity of its parts

Parameters
[in]domaindomain of the problem

References ug::Electromagnetism::EMaterial< TDomain >::domain(), ConstSmartPtr< class, FreePolicy >::invalid(), ug::Electromagnetism::EMaterial< TDomain >::subset_handler(), and UG_THROW.

Member Function Documentation

◆ add() [1/2]

template<typename TDomain >
void ug::Electromagnetism::EMaterial< TDomain >::add ( const char *  subsets,
number  mu 
)
inline

adds a insulator

Parameters
[in]subsetsnames of the subsets
[in]mu(nonzero) magnetic permeability

References ug::Electromagnetism::EMaterial< TDomain >::add().

◆ add() [2/2]

template<typename TDomain >
void ug::Electromagnetism::EMaterial< TDomain >::add ( const char *  subsets,
number  mu,
number  sigma 
)

adds a generic subset data item

Adds a data item to the object.

Parameters
[in]subsetsnames of the subsets
[in]mu(nonzero) magnetic permeability
[in]sigmaelectric conductivity

References subset_handler(), and UG_THROW.

Referenced by ug::Electromagnetism::EMaterial< TDomain >::add().

◆ analyze_topology()

template<typename TDomain >
void ug::Electromagnetism::EMaterial< TDomain >::analyze_topology
private

analyzes the conductor topology of the domain

Analyses the conductor topology of the domain.

◆ base_conductor_index() [1/2]

template<typename TDomain >
const std::vector<int>& ug::Electromagnetism::EMaterial< TDomain >::base_conductor_index ( ) const
inline

This function returns the array that assignes to every subset index of a conductor the index of its base conductor in the list of based conductors (as returned by base_conductors). Thus, for a conductor in subset si, min_conductor_ssi (si) == base_conductors () [base_conductor_index () [si]]. If the subset represents an insulator, the array assignes -1 to it. To other subsets, the array assignes <= -2.

References ug::Electromagnetism::EMaterial< TDomain >::m_baseCondInd.

◆ base_conductor_index() [2/2]

template<typename TDomain >
int ug::Electromagnetism::EMaterial< TDomain >::base_conductor_index ( int  si) const
inline

Returns index of the base conductor in base_conductors () for a conductor identified by the subset index of its subset. If the subset represents an insulator, the function returns -1. For other subsets, <= -2 is returned.

Parameters
sithe subset index of the conductor

References ug::Electromagnetism::EMaterial< TDomain >::m_baseCondInd.

◆ base_conductors()

template<typename TDomain >
const std::vector<int>& ug::Electromagnetism::EMaterial< TDomain >::base_conductors ( ) const
inline

This function returns the array of the base conductor subset indices: The list of the smallest indices of the subsets representing conductors. The length of this array is the 2nd Betti number: the number of the insulator-separated subdomains occupied by the conductors. Note that the Dirichlet BC is not taken into account here and some of the conductors may be grounded.

References ug::Electromagnetism::EMaterial< TDomain >::m_baseConductors.

◆ close()

◆ connectivity()

template<typename TDomain >
void ug::Electromagnetism::EMaterial< TDomain >::connectivity ( std::vector< int > &  minCondInd)
private

computes the connectivity of the conductions

Computes the connectivity of the conductors and therefore finds out the topology of the domain.

Parameters
[out]minCondIndan array indexed by the subset indices, so that every entry of a conductor is initialized with the smallest conductor subset id connected to it (and with < 0 for the other subdomains including insulators)
Parameters
[out]minCondIndmin. subset ind. of the conductor connected to a given one (or -1)

References get(), ug::NHT_VERTEX_NEIGHBORS, num_subsets(), subset_handler(), and UG_THROW.

◆ domain()

template<typename TDomain >
ConstSmartPtr<domain_type> ug::Electromagnetism::EMaterial< TDomain >::domain ( ) const
inline

◆ finalized()

template<typename TDomain >
bool ug::Electromagnetism::EMaterial< TDomain >::finalized ( ) const
inline

returns true iff closed

References ug::Electromagnetism::EMaterial< TDomain >::m_bClosed.

◆ get_mu_sigma()

template<typename TDomain >
bool ug::Electromagnetism::EMaterial< TDomain >::get_mu_sigma ( int  si,
number mu,
number sigma 
) const

reads the data for a subdomain from the data item

Gets the data from a subset data item. This function returns true if the specified subset index is not listed in the object, or the required data are not supplied for this subset. (For example, it should return true for low-dimensional subsets.) Otherwise the function returns false. If the object is not finalized, the function throws and exception.

Parameters
[in]sisubset index
[out]mumagnetic permeability
[out]sigmaelectric conductivity

References ug::Electromagnetism::EMaterial< TDomain >::TSubdomData::mu, ug::Electromagnetism::EMaterial< TDomain >::TSubdomData::sigma, and UG_THROW.

◆ min_conductor_ssi() [1/2]

template<typename TDomain >
const std::vector<int>& ug::Electromagnetism::EMaterial< TDomain >::min_conductor_ssi ( ) const
inline

The connectivity of the conductors: This function returns the array indexed by the subset indices, so that to every subset index of a conductor, it assignes the smallest conductor subset index connected to it (and -1 to insulators as well as <= -2 to the other subdomains)

References ug::Electromagnetism::EMaterial< TDomain >::m_minCondSsI.

◆ min_conductor_ssi() [2/2]

template<typename TDomain >
int ug::Electromagnetism::EMaterial< TDomain >::min_conductor_ssi ( int  si) const
inline

For every subset index of a conductor, this function returns the smallest conductor subset index connected to the given conductor (and -1 for insulators as well as <= -2 for the other subdomains)

Parameters
sithe subset index of the conductor

References ug::Electromagnetism::EMaterial< TDomain >::m_minCondSsI.

◆ subset_handler()

template<typename TDomain >
ConstSmartPtr<subset_handler_type> ug::Electromagnetism::EMaterial< TDomain >::subset_handler ( ) const
inline

◆ subset_names()

template<typename TDomain >
const char* ug::Electromagnetism::EMaterial< TDomain >::subset_names ( ) const
inline

Member Data Documentation

◆ dim

template<typename TDomain >
const int ug::Electromagnetism::EMaterial< TDomain >::dim = domain_type::dim
staticprivate

world dimension

◆ m_baseCondInd

template<typename TDomain >
std::vector<int> ug::Electromagnetism::EMaterial< TDomain >::m_baseCondInd
private

Correspondence of subset indices to the indices of the base conductors in m_baseConductors: For every conductor with subset index si, m_minCondSsI [si] == m_baseConductors [m_baseCondInd [si]]. For other subsets, this array keeps either -1 (for insulators) or <= -2 (for low-dimensional subsets etc).

Referenced by ug::Electromagnetism::EMaterial< TDomain >::base_conductor_index().

◆ m_baseConductors

template<typename TDomain >
std::vector<int> ug::Electromagnetism::EMaterial< TDomain >::m_baseConductors
private

Base conductor subset indices: The list of the smallest indices of the subsets representing conductors. The length of this list is the 2nd Betti number: the number of the insulator- separated subdomains occupied by the conductors. Note that the Dirichlet BC is not taken into account here so that some of the base conductors may be grounded.

Referenced by ug::Electromagnetism::EMaterial< TDomain >::base_conductors().

◆ m_bClosed

template<typename TDomain >
bool ug::Electromagnetism::EMaterial< TDomain >::m_bClosed
private

Flag that indicates that the description of the domain has been completed.

Referenced by ug::Electromagnetism::EMaterial< TDomain >::finalized(), and ug::Electromagnetism::EMaterial< TDomain >::subset_names().

◆ m_minCondSsI

template<typename TDomain >
std::vector<int> ug::Electromagnetism::EMaterial< TDomain >::m_minCondSsI
private

The connectivity of the conductors: This array is indexed by the subset indices and assignes to every subset of a conductor the smallest conductor subset index connected to this conductor (and -1 to insulators as well as <= -2 to the other subdomains)

Referenced by ug::Electromagnetism::EMaterial< TDomain >::min_conductor_ssi().

◆ m_mUserDataBC

template<typename TDomain >
t_data_map ug::Electromagnetism::EMaterial< TDomain >::m_mUserDataBC
private

Map assigning subdomain indices to the subdomain data items.

◆ m_spDomain

◆ m_sSsNames

template<typename TDomain >
std::string ug::Electromagnetism::EMaterial< TDomain >::m_sSsNames
private

String of all the subset names mentioned in the data items.

Referenced by ug::Electromagnetism::EMaterial< TDomain >::subset_names().

◆ m_vSdD

template<typename TDomain >
std::vector<TSubdomData> ug::Electromagnetism::EMaterial< TDomain >::m_vSdD
private

Subdomain data items.


The documentation for this class was generated from the following files: