Plugins
|
Dirichlet BC for a rot-rot operator. More...
#include <nedelec_dirichlet.h>
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, FunctionGroup > | m_mZeroBC |
List of all the Dirichlet subsets with implicitly specified Dirichlet BC: zero values. More... | |
std::vector< TConstBC > | m_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< TUserDataBC > | m_vUserDataBCData |
Dirichlet boundary conditions specified as functions: the specifications. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ug::IDomainConstraint< TDomain, TAlgebra > | |
ConstSmartPtr< DoFDistribution > | dd (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 |
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).
TDomain | domain type |
TAlgebra | algebra type |
typedef TAlgebra ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::algebra_type |
type of algebra
typedef IDomainConstraint<TDomain, TAlgebra> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::base_type |
base type
typedef TDomain ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::domain_type |
type of domain
typedef algebra_type::matrix_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::matrix_type |
type of algebra matrix
typedef domain_type::position_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::position_type |
type of position coordinates (e.g. position_type)
|
private |
iterator over edges
typedef NedelecDirichletBC<TDomain, TAlgebra> ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::this_type |
this type
typedef algebra_type::vector_type ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::vector_type |
type of algebra vector
|
inline |
class constructor
[in] | funcNames | names of the functions for the BC |
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.
value | values of the BC (a dim-vector) |
function | the name of the function to impose the value at |
subsets | the subset of the boundary patch |
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.
func | values of the BC (as a function) |
function | the name of the function to impose the value at |
subsets | the subset of the boundary patch |
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add | ( | std::vector< number > | vValue, |
const char * | function, | ||
const char * | subsets | ||
) |
void ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::add_0 | ( | const char * | subsets | ) |
adds a zero Dirichlet value on a subset
Adds a zero Dirichlet BC
subsets | the subset of the boundary patch |
|
private |
inserts a subset to the list of the Dirichlet subsets
Adds a subset to the list of the Dirichlet boundaries.
f_name | name of the function |
ss_names | names of the subsets |
References ug::TokenizeString(), and UG_THROW.
|
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.
|
virtual |
sets a unity row for all dirichlet indices
Sets the Dirichlet-rows of a given Jacobian to the identity.
Implements ug::IConstraint< class >.
References ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::get_dirichlet_subsets(), ug::SetDirichletRow(), ug::SubsetGroup::size(), ug::FunctionGroup::size(), subset_handler(), and UG_THROW.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_linear().
|
inlinevirtual |
sets unity rows in A and dirichlet values in right-hand side b
Implements ug::IConstraint< class >.
References ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_jacobian(), ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_solution(), ug::IDomainConstraint< TDomain, TAlgebra >::dd(), and ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::type().
|
inlinevirtual |
sets the dirichlet value in the right-hand side
Implements ug::IConstraint< class >.
References ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_solution(), ug::IDomainConstraint< TDomain, TAlgebra >::dd(), and ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::type().
|
private |
Sets the specified Dirichlet values in the solution.
Sets the Dirichlet-entries of a given solution vector to the boundary values.
vUserData | the bc data set |
si | subset index |
u | solution vector to correct |
dd | the DoF distribution |
time | time 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().
|
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 >.
|
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.
u | solution vector to correct |
dd | the DoF distribution |
time | time argument |
References ug::DoFRef(), ug::FunctionGroup::size(), and UG_THROW.
|
private |
Verifies whether the string input represents legal data.
Verifies whether the string input represents proper data in the sence of the approximation space.
functionGroup | the function group (should represent one scalar function) |
subsetGroup | subset group where the boundary condition is imposed |
References ug::SubsetGroup::size(), ug::FunctionGroup::size(), and UG_THROW.
|
inlineprivate |
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.
References ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_implicit(), ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mConstBC, ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_mUserDataBC, ug::IDomainConstraint< TDomain, TAlgebra >::m_spApproxSpace, ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_vConstBCData, ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_vUserDataBCData, and UG_THROW.
|
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.
mvUserDataBndSegment | the map to fill |
vUserData | the bc data set |
References UG_CATCH_THROW.
|
private |
Composes the list of the implicit BC.
Composes the list of the implicit BC
References ug::FunctionGroup::add(), ug::FunctionGroup::set_function_pattern(), ug::SubsetGroup::size(), and UG_CATCH_THROW.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().
|
virtual |
composes an array of subset indices of the Dirichlet boundary
Composes an array of subset indices of the Dirichlet boundary
dirichlet_ssgrp | the 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().
|
inlineprivatevirtual |
sets the approximation space to work on
Reimplemented from ug::IDomainConstraint< TDomain, TAlgebra >.
References ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::m_aaPos, ug::IDomainConstraint< TDomain, TAlgebra >::m_spApproxSpace, and ug::IDomainConstraint< TDomain, TAlgebra >::set_approximation_space().
|
inlinevirtual |
returns the type of the constraints
Implements ug::IDomainConstraint< TDomain, TAlgebra >.
References ug::CT_DIRICHLET.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_linear(), and ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::adjust_rhs().
|
static |
world dimension
|
private |
accessor type for the coordinates of the grid vertices
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::set_approximation_space().
|
private |
Constant values as Dirichlet BC: correspondens between the subsets and the specifications.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().
|
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.
|
private |
Dirichlet BC specified as functions: correspondens between the subsets and the specifications.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().
|
private |
List of all the Dirichlet subsets with implicitly specified Dirichlet BC: zero values.
|
private |
Constant values as Dirichlet boundary conditions: the specifications.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().
|
private |
functions for which the Dirichlet conditions are imposed
|
private |
Dirichlet boundary conditions specified as functions: the specifications.
Referenced by ug::Electromagnetism::NedelecDirichletBC< TDomain, TAlgebra >::extract_data().