37 #ifndef __H__UG__PLUGINS__ELECTROMAGNETISM__NEDELEC_DIRICHLET__
38 #define __H__UG__PLUGINS__ELECTROMAGNETISM__NEDELEC_DIRICHLET__
58 namespace Electromagnetism{
83 template <
typename TDomain,
typename TAlgebra>
120 const char * funcNames
126 void add_0 (
const char * subsets);
131 void add (std::vector<number> vValue,
const char *
function,
const char * subsets);
137 void add (
const char * name,
const char *
function,
const char * subsets);
176 std::string the_fctName,
177 std::string the_ssName
193 edgeVector -= aaPos [edge->vertex(0)];
218 std::string the_fctName,
219 std::string the_ssName
238 edgeVector -= aaPos [edge->vertex(0)];
241 (*spBCFunc) (func_value, aaPos [edge->vertex(0)], time, si);
242 dofValue = func_value * edgeVector;
244 (*spBCFunc) (func_value, aaPos [edge->vertex(1)], time, si);
245 dofValue += func_value * edgeVector;
288 template <
typename TUserData>
291 std::map<
int, std::vector<TUserData*> >& mvUserDataBndSegment,
292 std::vector<TUserData>& vUserData
297 UG_THROW (
"NedelecDirichletBC: Approximation space not set.");
305 template <
typename TUserData>
308 const std::vector<TUserData *> & vUserData,
347 const std::vector<number> * vScaleMass = NULL,
348 const std::vector<number> * vScaleStiff = NULL
Common interface to get the Dirichlet boundary conditions.
Definition: em_material.h:287
Dirichlet BC for a rot-rot operator.
Definition: nedelec_dirichlet.h:86
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
Definition: nedelec_dirichlet_impl.h:313
NedelecDirichletBC(const char *funcNames)
class constructor
Definition: nedelec_dirichlet.h:119
algebra_type::matrix_type matrix_type
type of algebra matrix
Definition: nedelec_dirichlet.h:107
static const int dim
world dimension
Definition: nedelec_dirichlet.h:98
std::map< int, std::vector< TConstBC * > > m_mConstBC
Constant values as Dirichlet BC: correspondens between the subsets and the specifications.
Definition: nedelec_dirichlet.h:203
algebra_type::vector_type vector_type
type of algebra vector
Definition: nedelec_dirichlet.h:110
domain_type::position_type position_type
type of position coordinates (e.g. position_type)
Definition: nedelec_dirichlet.h:101
std::map< int, std::vector< TUserDataBC * > > m_mUserDataBC
Dirichlet BC specified as functions: correspondens between the subsets and the specifications.
Definition: nedelec_dirichlet.h:254
int type() const
returns the type of the constraints
Definition: nedelec_dirichlet.h:388
void add_subset(const char *f_name, const char *ss_names)
inserts a subset to the list of the Dirichlet subsets
Definition: nedelec_dirichlet_impl.h:50
void extract_data()
Definition: nedelec_dirichlet.h:294
std::vector< TUserDataBC > m_vUserDataBCData
Dirichlet boundary conditions specified as functions: the specifications.
Definition: nedelec_dirichlet.h:252
std::map< std::string, std::vector< std::string > > m_mDirichletSS
all the subsets with the Dirichlet BC
Definition: nedelec_dirichlet.h:161
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.
Definition: nedelec_dirichlet_impl.h:403
void add(MathVector< dim > &value, const char *function, const char *subsets)
adds a constant Dirichlet value on a subset
Definition: nedelec_dirichlet_impl.h:104
domain_type::position_accessor_type m_aaPos
accessor type for the coordinates of the grid vertices
Definition: nedelec_dirichlet.h:150
std::map< int, FunctionGroup > m_mZeroBC
List of all the Dirichlet subsets with implicitly specified Dirichlet BC: zero values.
Definition: nedelec_dirichlet.h:257
void adjust_solution_implicit(vector_type &u, ConstSmartPtr< DoFDistribution > dd, number time)
Sets the zero Dirichlet values for the implicitly specified BC.
Definition: nedelec_dirichlet_impl.h:436
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
Definition: nedelec_dirichlet.h:362
void extract_implicit()
Composes the list of the implicit BC.
Definition: nedelec_dirichlet_impl.h:281
std::vector< std::string > m_vDirichletFunc
functions for which the Dirichlet conditions are imposed
Definition: nedelec_dirichlet.h:153
TDomain domain_type
type of domain
Definition: nedelec_dirichlet.h:95
void check_functions_and_subsets(FunctionGroup &functionGroup, SubsetGroup &subsetGroup)
Verifies whether the string input represents legal data.
Definition: nedelec_dirichlet_impl.h:192
NedelecDirichletBC< TDomain, TAlgebra > this_type
this type
Definition: nedelec_dirichlet.h:92
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
Definition: nedelec_dirichlet.h:376
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
Definition: nedelec_dirichlet_impl.h:357
std::vector< TConstBC > m_vConstBCData
Constant values as Dirichlet boundary conditions: the specifications.
Definition: nedelec_dirichlet.h:201
IDomainConstraint< TDomain, TAlgebra > base_type
base type
Definition: nedelec_dirichlet.h:89
void add_0(const char *subsets)
adds a zero Dirichlet value on a subset
Definition: nedelec_dirichlet_impl.h:92
DoFDistribution::traits< Edge >::const_iterator t_edge_iterator
iterator over edges
Definition: nedelec_dirichlet.h:114
void set_approximation_space(SmartPtr< ApproximationSpace< TDomain > > approxSpace)
sets the approximation space to work on
Definition: nedelec_dirichlet.h:268
TAlgebra algebra_type
type of algebra
Definition: nedelec_dirichlet.h:104
virtual void get_dirichlet_subsets(SubsetGroup &dirichlet_ssgrp) const
composes an array of subset indices of the Dirichlet boundary
Definition: nedelec_dirichlet_impl.h:174
algebra_type::vector_type vector_type
algebra_type::matrix_type matrix_type
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
ConstSmartPtr< DoFDistribution > dd(const GridLevel &gl) const
virtual void set_approximation_space(SmartPtr< ApproximationSpace< TDomain > > approxSpace)
ParallelMatrix< SparseMatrix< double > > matrix_type
ParallelVector< Vector< double > > vector_type
Grid::VertexAttachmentAccessor< position_attachment_type > position_accessor_type
MathVector< dim > position_type
vector< string > TokenizeString(const char *str, const char delimiter=',')
const NullSmartPtr SPNULL
SurfaceView::traits< TElem >::const_iterator const_iterator
structure for the Dirichlet BC that is constant over a patch
Definition: nedelec_dirichlet.h:165
SubsetGroup ssGrp
subset group
Definition: nedelec_dirichlet.h:170
std::string fctName
grid function component name
Definition: nedelec_dirichlet.h:167
TConstBC(MathVector< dim > &the_bcValue, std::string the_fctName, std::string the_ssName)
constructor
Definition: nedelec_dirichlet.h:174
size_t fct
grid function component
Definition: nedelec_dirichlet.h:168
MathVector< dim > bcValue
the boundary condition
Definition: nedelec_dirichlet.h:166
std::string ssName
subset name
Definition: nedelec_dirichlet.h:169
Structure for the Dirichlet BC that are given by a function.
Definition: nedelec_dirichlet.h:207
std::string fctName
grid function component name
Definition: nedelec_dirichlet.h:209
std::string ssName
subset name
Definition: nedelec_dirichlet.h:211
SubsetGroup ssGrp
subset group
Definition: nedelec_dirichlet.h:212
TUserDataBC(SmartPtr< UserData< MathVector< dim >, dim > > the_spFunc, std::string the_fctName, std::string the_ssName)
constructor
Definition: nedelec_dirichlet.h:216
SmartPtr< UserData< MathVector< dim >, dim > > spBCFunc
user-defined function for
Definition: nedelec_dirichlet.h:208
size_t fct
grid function component
Definition: nedelec_dirichlet.h:210