Plugins
ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra > Class Template Reference

Dirichlet BC for a rot-rot operator. More...

#include <nedelec_dirichlet.h>

+ Inheritance diagram for ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >:

Classes

struct  TConstBC
 structure for the Dirichlet BC that is constant over a patch More...
 
struct  TUserDataBC
 Structure for the Dirichlet BC that are given by a function. More...
 

Public Types

typedef TAlgebra algebra_type
 type of algebra More...
 
typedef IDomainConstraint< TDomain, TAlgebra > base_type
 base type More...
 
typedef TDomain domain_type
 type of domain More...
 
typedef algebra_type::matrix_type matrix_type
 type of algebra matrix More...
 
typedef domain_type::position_type position_type
 type of position coordinates (e.g. position_type) More...
 
typedef NedelecDirichletBC< TDomain, TAlgebra > this_type
 this type More...
 
typedef algebra_type::vector_type vector_type
 type of algebra vector More...
 
- Public Types inherited from ug::IDomainConstraint< TDomain, TAlgebra >
typedef TAlgebra algebra_type
 
typedef TDomain domain_type
 
typedef algebra_type::matrix_type matrix_type
 
typedef algebra_type::vector_type vector_type
 
- Public Types inherited from ug::IConstraint< class >
typedef TAlgebra algebra_type
 
typedef algebra_type::matrix_type matrix_type
 
typedef algebra_type::vector_type vector_type
 

Public Member Functions

void add (MathVector< dim > &value, const char *function, const char *subsets)
 adds a constant Dirichlet value on a subset More...
 
void add (SmartPtr< UserData< MathVector< dim >, dim > > &func, const char *function, const char *subsets)
 adds a position-dependent Dirichlet BC based on UserData More...
 
void add (std::vector< number > vValue, const char *function, const char *subsets)
 adds a constant Dirichlet value on a subset More...
 
void add_0 (const char *subsets)
 adds a zero Dirichlet value on a subset More...
 
void adjust_defect (vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
 sets a zero value in the defect for all dirichlet indices More...
 
void adjust_jacobian (matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const number s_a0=1.0)
 sets a unity row for all dirichlet indices More...
 
void adjust_linear (matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets unity rows in A and dirichlet values in right-hand side b More...
 
void adjust_rhs (vector_type &b, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets the dirichlet value in the right-hand side More...
 
void adjust_solution (vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets the dirichlet value in the solution for all dirichlet indices More...
 
virtual void get_dirichlet_subsets (SubsetGroup &dirichlet_ssgrp) const
 composes an array of subset indices of the Dirichlet boundary More...
 
 NedelecDirichletBC (const char *funcNames)
 class constructor More...
 
int type () const
 returns the type of the constraints More...
 
- Public Member Functions inherited from ug::IDomainConstraint< TDomain, TAlgebra >
SmartPtr< ApproximationSpace< TDomain > > approximation_space ()
 
ConstSmartPtr< ApproximationSpace< TDomain > > approximation_space () const
 
virtual SmartPtr< IErrEstData< TDomain > > err_est_data ()
 
bool err_est_enabled () const
 
 IDomainConstraint ()
 
void set_ass_tuner (ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssemblingTuner=NULL)
 
void set_error_estimator (SmartPtr< IErrEstData< TDomain > > ee)
 
- Public Member Functions inherited from ug::IConstraint< class >
virtual void adjust_correction (vector_type &c, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 
virtual void adjust_error (const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
 
virtual void adjust_linear_residual (vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 
virtual void adjust_prolongation (matrix_type &P, ConstSmartPtr< DoFDistribution > ddFine, ConstSmartPtr< DoFDistribution > ddCoarse, int type, number time=0.0)
 
virtual void adjust_prolongation (vector_type &uFine, GridLevel fineLvl, const vector_type &uCoarse, GridLevel coarseLvl, int type)
 
virtual void adjust_restriction (matrix_type &R, ConstSmartPtr< DoFDistribution > ddCoarse, ConstSmartPtr< DoFDistribution > ddFine, int type, number time=0.0)
 
virtual void adjust_restriction (vector_type &uCoarse, GridLevel coarseLvl, const vector_type &uFine, GridLevel fineLvl, int type)
 
virtual void modify_solution (SmartPtr< VectorTimeSeries< vector_type > > vSolMod, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd, int type)
 
virtual void modify_solution (vector_type &uMod, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type)
 
virtual ~IConstraint ()
 

Static Public Attributes

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

Private Types

typedef DoFDistribution::traits< Edge >::const_iterator t_edge_iterator
 iterator over edges More...
 

Private Member Functions

void add_subset (const char *f_name, const char *ss_names)
 inserts a subset to the list of the Dirichlet subsets More...
 
template<typename TUserData >
void adjust_solution (const std::vector< TUserData * > &vUserData, int si, vector_type &u, ConstSmartPtr< DoFDistribution > dd, number time)
 Sets the specified Dirichlet values in the solution. More...
 
void adjust_solution_implicit (vector_type &u, ConstSmartPtr< DoFDistribution > dd, number time)
 Sets the zero Dirichlet values for the implicitly specified BC. More...
 
void check_functions_and_subsets (FunctionGroup &functionGroup, SubsetGroup &subsetGroup)
 Verifies whether the string input represents legal data. More...
 
void extract_implicit ()
 Composes the list of the implicit BC. More...
 
void set_approximation_space (SmartPtr< ApproximationSpace< TDomain > > approxSpace)
 sets the approximation space to work on More...
 
template<typename TUserData >
void extract_data (std::map< int, std::vector< TUserData * > > &mvUserDataBndSegment, std::vector< TUserData > &vUserData)
 
void extract_data ()
 

Private Attributes

domain_type::position_accessor_type m_aaPos
 accessor type for the coordinates of the grid vertices More...
 
std::map< int, std::vector< TConstBC * > > m_mConstBC
 Constant values as Dirichlet BC: correspondens between the subsets and the specifications. More...
 
std::map< std::string, std::vector< std::string > > m_mDirichletSS
 all the subsets with the Dirichlet BC More...
 
std::map< int, std::vector< TUserDataBC * > > m_mUserDataBC
 Dirichlet BC specified as functions: correspondens between the subsets and the specifications. More...
 
std::map< int, FunctionGroupm_mZeroBC
 List of all the Dirichlet subsets with implicitly specified Dirichlet BC: zero values. More...
 
std::vector< TConstBCm_vConstBCData
 Constant values as Dirichlet boundary conditions: the specifications. More...
 
std::vector< std::string > m_vDirichletFunc
 functions for which the Dirichlet conditions are imposed More...
 
std::vector< TUserDataBCm_vUserDataBCData
 Dirichlet boundary conditions specified as functions: the specifications. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ug::IDomainConstraint< TDomain, TAlgebra >
ConstSmartPtr< DoFDistributiondd (const GridLevel &gl) const
 
- Protected Attributes inherited from ug::IDomainConstraint< TDomain, TAlgebra >
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
 
ConstSmartPtr< AssemblingTuner< TAlgebra > > m_spAssTuner
 
SmartPtr< IErrEstData< TDomain > > m_spErrEstData
 

Detailed Description

template<typename TDomain, typename TAlgebra>
class ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >

Dirichlet BC for a rot-rot operator.

This class implements a Dirichlet boundary condition for the rot-rot operator. The boundary condition has the form

\begin{eqnarray*} \mathbf{n} \times \mathbf{E} = \mathbf{n} \times \mathbf{E}_\mathrm{bc}, \end{eqnarray*}

where \( \mathbf{E} \) is the unknown function, \( \mathbf{n} \) the unit outer normal to the boundary segment (or patch), \( \mathbf{E}_\mathrm{bc} \) the given boundary condition. Note that \( \mathbf{E}_\mathrm{bc} \) specified by the user is a vector (although the Nedelec DoFs of \( \mathbf{E} \) are scalar).

Remarks
For the time-harmonic problems (or other problems with several components in every dof), the whole boundary segments are considered as Dirichlet boundary for all the specified components if at least one of the component is mentioned in the object of this class. For the components that are not explicitly mentioned in the "add" functions, zero Dirichlet values are imposed (so called "implicit specification").
Template Parameters
TDomaindomain type
TAlgebraalgebra type

Member Typedef Documentation

◆ algebra_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::algebra_type

type of algebra

◆ base_type

template<typename TDomain , typename TAlgebra >
typedef IDomainConstraint<TDomain, TAlgebra> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::base_type

base type

◆ domain_type

template<typename TDomain , typename TAlgebra >
typedef TDomain ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::domain_type

type of domain

◆ matrix_type

template<typename TDomain , typename TAlgebra >
typedef algebra_type::matrix_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::matrix_type

type of algebra matrix

◆ position_type

template<typename TDomain , typename TAlgebra >
typedef domain_type::position_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::position_type

type of position coordinates (e.g. position_type)

◆ t_edge_iterator

template<typename TDomain , typename TAlgebra >
typedef DoFDistribution::traits<Edge>::const_iterator ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::t_edge_iterator
private

iterator over edges

◆ this_type

template<typename TDomain , typename TAlgebra >
typedef NedelecDirichletBC<TDomain, TAlgebra> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::this_type

this type

◆ vector_type

template<typename TDomain , typename TAlgebra >
typedef algebra_type::vector_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::vector_type

type of algebra vector

Constructor & Destructor Documentation

◆ NedelecDirichletBC()

template<typename TDomain , typename TAlgebra >
ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::NedelecDirichletBC ( const char *  funcNames)
inline

class constructor

Parameters
[in]funcNamesnames of the functions for the BC

Member Function Documentation

◆ add() [1/3]

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add ( MathVector< dim > &  value,
const char *  function,
const char *  subsets 
)

adds a constant Dirichlet value on a subset

Adds a constant Dirichlet value on a given subset.

Parameters
valuevalues of the BC (a dim-vector)
functionthe name of the function to impose the value at
subsetsthe subset of the boundary patch

◆ add() [2/3]

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add ( SmartPtr< UserData< MathVector< dim >, dim > > &  func,
const char *  function,
const char *  subsets 
)

adds a position-dependent Dirichlet BC based on UserData

Adds a constant Dirichlet value on a given subset.

Parameters
funcvalues of the BC (as a function)
functionthe name of the function to impose the value at
subsetsthe subset of the boundary patch

◆ add() [3/3]

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add ( std::vector< number vValue,
const char *  function,
const char *  subsets 
)

adds a constant Dirichlet value on a subset

Adds a constant Dirichlet value on a given subset.

Parameters
vValuevalues of the BC (a dim-vector)
functionthe name of the function to impose the value at
subsetsthe subset of the boundary patch

References dim, and UG_THROW.

◆ add_0()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add_0 ( const char *  subsets)

adds a zero Dirichlet value on a subset

Adds a zero Dirichlet BC

Parameters
subsetsthe subset of the boundary patch

◆ add_subset()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add_subset ( const char *  f_name,
const char *  ss_names 
)
private

inserts a subset to the list of the Dirichlet subsets

Adds a subset to the list of the Dirichlet boundaries.

Parameters
f_namename of the function
ss_namesnames of the subsets

References ug::TokenizeString(), and UG_THROW.

◆ adjust_defect()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_defect ( vector_type d,
const vector_type u,
ConstSmartPtr< DoFDistribution dd,
int  type,
number  time = 0.0,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol = SPNULL,
const std::vector< number > *  vScaleMass = NULL,
const std::vector< number > *  vScaleStiff = NULL 
)
virtual

sets a zero value in the defect for all dirichlet indices

Sets the Dirichlet-entries of a given defect vector to 0.

Implements ug::IConstraint< class >.

References ug::DoFRef(), ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::get_dirichlet_subsets(), ug::SubsetGroup::size(), ug::FunctionGroup::size(), subset_handler(), and UG_THROW.

◆ adjust_jacobian()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_jacobian ( matrix_type J,
const vector_type u,
ConstSmartPtr< DoFDistribution dd,
int  type,
number  time = 0.0,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol = SPNULL,
const number  s_a0 = 1.0 
)
virtual

◆ adjust_linear()

◆ adjust_rhs()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_rhs ( vector_type b,
const vector_type u,
ConstSmartPtr< DoFDistribution dd,
int  type,
number  time = 0.0 
)
inlinevirtual

◆ adjust_solution() [1/2]

template<typename TDomain , typename TAlgebra >
template<typename TUserData >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_solution ( const std::vector< TUserData * > &  vUserData,
int  si,
vector_type u,
ConstSmartPtr< DoFDistribution dd,
number  time 
)
private

Sets the specified Dirichlet values in the solution.

Sets the Dirichlet-entries of a given solution vector to the boundary values.

Parameters
vUserDatathe bc data set
sisubset index
usolution vector to correct
ddthe DoF distribution
timetime argument

References ug::DoFRef(), m_aaPos, and UG_THROW.

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_linear(), and ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_rhs().

◆ adjust_solution() [2/2]

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_solution ( vector_type u,
ConstSmartPtr< DoFDistribution dd,
int  type,
number  time = 0.0 
)
virtual

sets the dirichlet value in the solution for all dirichlet indices

sets the dirichlet value in the solution for all dirichlet indices

Implements ug::IConstraint< class >.

◆ adjust_solution_implicit()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_solution_implicit ( vector_type u,
ConstSmartPtr< DoFDistribution dd,
number  time 
)
private

Sets the zero Dirichlet values for the implicitly specified BC.

Sets the zero Dirichlet values for the DoFs that have not been mentioned in the explicit specification.

Parameters
usolution vector to correct
ddthe DoF distribution
timetime argument

References ug::DoFRef(), ug::FunctionGroup::size(), and UG_THROW.

◆ check_functions_and_subsets()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::check_functions_and_subsets ( FunctionGroup functionGroup,
SubsetGroup subsetGroup 
)
private

Verifies whether the string input represents legal data.

Verifies whether the string input represents proper data in the sence of the approximation space.

Parameters
functionGroupthe function group (should represent one scalar function)
subsetGroupsubset group where the boundary condition is imposed

References ug::SubsetGroup::size(), ug::FunctionGroup::size(), and UG_THROW.

◆ extract_data() [1/2]

◆ extract_data() [2/2]

template<typename TDomain , typename TAlgebra >
template<typename TUserData >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data ( std::map< int, std::vector< TUserData * > > &  mvUserDataBndSegment,
std::vector< TUserData > &  vUserData 
)
private

Compiles the BC data into the map assigning the data to the subset id's

Compiles the BC data into the map assigning the data to the subset id's (i.e. fills the map) for a given BC data set.

Parameters
mvUserDataBndSegmentthe map to fill
vUserDatathe bc data set

References UG_CATCH_THROW.

◆ extract_implicit()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_implicit
private

◆ get_dirichlet_subsets()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::get_dirichlet_subsets ( SubsetGroup dirichlet_ssgrp) const
virtual

composes an array of subset indices of the Dirichlet boundary

Composes an array of subset indices of the Dirichlet boundary

Parameters
dirichlet_ssgrpthe group to update

Implements ug::Electromagnetism::EMDirichlet< TDomain, TAlgebra >.

References ug::SubsetGroup::add().

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_defect(), and ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_jacobian().

◆ set_approximation_space()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::set_approximation_space ( SmartPtr< ApproximationSpace< TDomain > >  approxSpace)
inlineprivatevirtual

◆ type()

template<typename TDomain , typename TAlgebra >
int ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::type ( ) const
inlinevirtual

Member Data Documentation

◆ dim

template<typename TDomain , typename TAlgebra >
const int ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::dim = domain_type::dim
static

world dimension

◆ m_aaPos

template<typename TDomain , typename TAlgebra >
domain_type::position_accessor_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_aaPos
private

accessor type for the coordinates of the grid vertices

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::set_approximation_space().

◆ m_mConstBC

template<typename TDomain , typename TAlgebra >
std::map<int, std::vector<TConstBC *> > ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mConstBC
private

Constant values as Dirichlet BC: correspondens between the subsets and the specifications.

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().

◆ m_mDirichletSS

template<typename TDomain , typename TAlgebra >
std::map<std::string, std::vector<std::string> > ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mDirichletSS
private

all the subsets with the Dirichlet BC

The map assignes the functions that have not been mentioned in the explicit specifications to the subsets with the Dirichlet BC.

◆ m_mUserDataBC

template<typename TDomain , typename TAlgebra >
std::map<int, std::vector<TUserDataBC *> > ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mUserDataBC
private

Dirichlet BC specified as functions: correspondens between the subsets and the specifications.

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().

◆ m_mZeroBC

template<typename TDomain , typename TAlgebra >
std::map<int, FunctionGroup> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mZeroBC
private

List of all the Dirichlet subsets with implicitly specified Dirichlet BC: zero values.

◆ m_vConstBCData

template<typename TDomain , typename TAlgebra >
std::vector<TConstBC> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_vConstBCData
private

Constant values as Dirichlet boundary conditions: the specifications.

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().

◆ m_vDirichletFunc

template<typename TDomain , typename TAlgebra >
std::vector<std::string> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_vDirichletFunc
private

functions for which the Dirichlet conditions are imposed

◆ m_vUserDataBCData

template<typename TDomain , typename TAlgebra >
std::vector<TUserDataBC> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_vUserDataBCData
private

Dirichlet boundary conditions specified as functions: the specifications.

Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().


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