37 #ifndef __H__UG__PLUGINS__ELECTROMAGNETISM__NEDELEC_PROJECT__
38 #define __H__UG__PLUGINS__ELECTROMAGNETISM__NEDELEC_PROJECT__
62 namespace Electromagnetism{
70 template <
typename TDomain,
typename TAlgebra>
155 const char * fct_names
169 const char * u_fct_name,
190 template <
typename TElem>
193 const TDomain & domain,
215 const TDomain & domain,
227 m_pThis->template weak_div_elem_type<TElem>
233 template <
typename TElem>
267 const TDomain & domain,
279 const TDomain & domain,
292 const TDomain & domain,
305 const TDomain & domain,
317 template <
typename TElem>
346 template <
typename TElem>
349 const TDomain & domain,
367 const TDomain & domain,
377 m_pThis->template integrate_div_DVF_elem_type<TElem>
385 template <
typename TElem>
406 static const size_t _C_ = 0;
421 const std::vector<LFEID> & vLfeID,
428 template <
typename TElem>
431 template <
typename TElem>
434 template <
typename TElem>
437 template <
typename TElem>
440 template <
typename TElem>
443 template <
typename TElem>
446 UG_THROW (
"NedelecProject: Attempt to use nonstationary discretization for the potential.");
448 template <
typename TElem>
451 UG_THROW (
"NedelecProject: Attempt to assemble non-linear system for the potential.");
453 template <
typename TElem>
456 UG_THROW (
"NedelecProject: Attempt to use nonstationary discretization for the potential.");
471 template <
typename TElem>
534 const std::vector<number> * vScaleMass = NULL,
535 const std::vector<number> * vScaleStiff = NULL
594 template <
typename TElem>
629 template <
typename TElem>
Common interface to get the Dirichlet boundary conditions.
Definition: em_material.h:287
Class for subdomain-dependent data for the E-based formulated problems.
Definition: em_material.h:63
Class for local assembling of the auxiliary Laplace operator.
Definition: nedelec_project.h:403
void prepare_element_loop(ReferenceObjectID roid, int si)
Definition: nedelec_project_impl.h:926
bool m_do_assemble_here
flag whether to assemble on a given element
Definition: nedelec_project.h:481
virtual void prepare_setting(const std::vector< LFEID > &vLfeID, bool bNonRegular)
switches between non-regular and regular grids
Definition: nedelec_project_impl.h:875
NedelecProject & m_master
the master object of the projection
Definition: nedelec_project.h:478
void ass_dM_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const position_type vCornerCoords[])
Definition: nedelec_project.h:454
void ass_dA_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const position_type vCornerCoords[])
Definition: nedelec_project.h:449
void prepare_element(const LocalVector &u, GridObject *elem, ReferenceObjectID roid, const position_type vCornerCoords[])
Definition: nedelec_project.h:435
void register_loc_discr_func()
Definition: nedelec_project_impl.h:907
AuxLaplaceLocAss(NedelecProject &master)
constructor
Definition: nedelec_project_impl.h:862
void finish_element_loop()
Definition: nedelec_project.h:438
void ass_JA_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const position_type vCornerCoords[])
transfer the local stiffness matrix to the global discretization
Definition: nedelec_project_impl.h:942
static const size_t _C_
a name for the component in the grid functions
Definition: nedelec_project.h:406
void register_all_loc_discr_funcs()
Definition: nedelec_project_impl.h:895
void ass_JM_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const position_type vCornerCoords[])
Definition: nedelec_project.h:444
void ass_rhs_elem(LocalVector &d, GridObject *elem, const position_type vCornerCoords[])
Definition: nedelec_project.h:441
static const size_t maxCorners
maximum number of corners of an element
Definition: nedelec_project.h:409
Constraint that assembles the rhs und the bc for the auxiliary problems.
Definition: nedelec_project.h:486
void adjust_defect(pot_vector_type &d, const pot_vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< pot_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 conductor indices
Definition: nedelec_project_impl.h:1171
void set_base_conductor(int base_cond=-1)
sets the base conductor index (or -1 for the divergence correction)
Definition: nedelec_project.h:506
int type() const
returns the type of the constraints
Definition: nedelec_project.h:575
void adjust_linear(pot_matrix_type &A, pot_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_project.h:549
void set_value_on_subset(int si, number val, pot_vector_type &u, const DoFDistribution *dd)
sets constant value on the closure of a full-dimensional subset
Definition: nedelec_project_impl.h:1070
void set_identity_Dirichlet(pot_matrix_type &A, const DoFDistribution *dd)
sets identity matrix on the whole Dirichlet boundary
Definition: nedelec_project_impl.h:1025
NedelecProject & m_master
the master object of the projection
Definition: nedelec_project.h:663
void set_identity_on_subset(int si, pot_matrix_type &A, const DoFDistribution *dd)
sets identity matrix on the closure of a full-dimensional subset
Definition: nedelec_project_impl.h:1108
DoFDistribution::traits< Vertex >::const_iterator t_vert_iterator
Iterator over vertices.
Definition: nedelec_project.h:495
int m_base_cond
the base conductor index (or -1 for insulators)
Definition: nedelec_project.h:666
static const size_t maxCorners
maximum number of corners of an element
Definition: nedelec_project.h:492
void adjust_rhs(pot_vector_type &b, const pot_vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets the dirichlet value in the right-hand side
Definition: nedelec_project.h:563
void set_zero_Dirichlet(pot_vector_type &u, const DoFDistribution *dd)
sets zero values on the whole Dirichlet boundary
Definition: nedelec_project_impl.h:981
void adjust_jacobian(pot_matrix_type &J, const pot_vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< pot_vector_type > > vSol=SPNULL, const number s_a0=1.0)
sets a unity row for all conductor indices
Definition: nedelec_project_impl.h:1144
DoFDistribution::traits< Edge >::const_iterator t_edge_iterator
Iterator over edges.
Definition: nedelec_project.h:489
AuxLaplaceRHS(NedelecProject &master)
constructor
Definition: nedelec_project_impl.h:970
void adjust_solution(pot_vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets the value in the solution for all conductor indices
Definition: nedelec_project_impl.h:1199
Helper class for assembling the local stiffness matrix of Laplacian in various routines.
Definition: nedelec_project.h:387
static const int numCorners
Definition: nedelec_project.h:390
static void stiffness(GridObject *elem, const position_type vCornerCoords[], number loc_A[numCorners][numCorners])
Computes the local discretization of the Laplace operator.
Definition: nedelec_project_impl.h:828
reference_element_traits< TElem >::reference_element_type ref_elem_type
Definition: nedelec_project.h:389
Projection procedure class.
Definition: nedelec_project.h:72
void project_func(const SmartPtr< TDomain > &domain, const SmartPtr< DoFDistribution > &edgeDD, vector_type &u, size_t fct, const SmartPtr< DoFDistribution > &vertDD, pot_gf_type &aux_rhs, pot_gf_type &aux_cor)
Projects one function (i.e. performs the main action):
Definition: nedelec_project_impl.h:247
void mark_cond_vert_elem_type(DoFDistribution &vertDD, aa_vert_cond_type &vert_base_cond)
Sets the base conductor indices for every vertex (for all elements of the same type)
Definition: nedelec_project_impl.h:702
void assemble_div(const TDomain &domain, const DoFDistribution &edgeDD, const vector_type &u, size_t fct, const DoFDistribution &vertDD, pot_vector_type &div, DenseVector< VariableArray1< number > > &charge)
Assembles the weak divergence operator on the whole grid.
Definition: nedelec_project_impl.h:404
AInt a_vert_cond_type
Type of the attachment and its accessor the base conductor indices.
Definition: nedelec_project.h:111
void distribute_cor(const TDomain &domain, const DoFDistribution &edgeDD, vector_type &u, size_t fct, const DoFDistribution &vertDD, const pot_vector_type &cor)
Updates the grid function by the potential correction.
Definition: nedelec_project_impl.h:461
TPotAlgebra::vector_type pot_vector_type
Vector type for the potential space.
Definition: nedelec_project.h:96
SmartPtr< AuxLaplaceRHS > m_auxLaplaceRHS
Rhs and BC for the auxiliary problem.
Definition: nedelec_project.h:686
void set_Dirichlet(SmartPtr< EMDirichlet< TDomain, TAlgebra > > spDirichlet)
Sets the Dirichlet boundary.
Definition: nedelec_project.h:132
SmartPtr< AssembledLinearOperator< TPotAlgebra > > m_auxLaplaceOp
Matrix of the discretization.
Definition: nedelec_project.h:690
bool m_bDampDVFs
Whether to damp the Dirichlet vector fields (DVFs)
Definition: nedelec_project.h:678
Grid::VertexAttachmentAccessor< a_vert_cond_type > aa_vert_cond_type
Definition: nedelec_project.h:112
GridFunction< TDomain, TPotAlgebra > pot_gf_type
Grid function type for the potential space.
Definition: nedelec_project.h:100
TAlgebra algebra_type
Type of algebra (for the Nedelec-element-based grid functions)
Definition: nedelec_project.h:87
TDomain domain_type
Type of Domain.
Definition: nedelec_project.h:78
~NedelecProject()
Destructor.
Definition: nedelec_project.h:125
SmartPtr< ApproximationSpace< TDomain > > m_spVertApproxSpace
Approximation space for the potential (vertex-centered) space.
Definition: nedelec_project.h:675
TPotAlgebra::matrix_type pot_matrix_type
Matrix type for the potential space.
Definition: nedelec_project.h:98
void compute_DVF_potential_coeffs(const TDomain &domain, DoFDistribution &vertDD)
Computes the potential coefficients.
Definition: nedelec_project_impl.h:617
TAlgebra::vector_type vector_type
Type of Vector (for the Nedelec-element-based grid functions)
Definition: nedelec_project.h:89
SmartPtr< EMDirichlet< TDomain, TAlgebra > > m_spDirichlet
Dirichlet boundary.
Definition: nedelec_project.h:681
void set_dampDVFs(bool val)
Sets whether to damp Dirichlet vector fields.
Definition: nedelec_project.h:140
void clear_div_in_conductors(const DoFDistribution &vertDD, pot_vector_type &div, DenseVector< VariableArray1< number > > &charge)
Sets the div operator to 0 in conductors (for all elements of the same type)
Definition: nedelec_project_impl.h:358
void compute_div(SmartPtr< GridFunction< TDomain, TAlgebra > > sp_u, const char *u_fct_name, SmartPtr< GridFunction< TDomain, TPotAlgebra > > sp_div)
Computes the weak divergence in insulators.
Definition: nedelec_project_impl.h:192
SmartPtr< DomainDiscretization< TDomain, TPotAlgebra > > m_auxLaplaceAss
Global discretization of the auxiliary equations.
Definition: nedelec_project.h:688
SmartPtr< ILinearOperatorInverse< pot_vector_type > > m_potSolver
Solver for the auxliliary equations.
Definition: nedelec_project.h:692
domain_type::subset_handler_type subset_handler_type
Type of subset handler.
Definition: nedelec_project.h:84
NedelecProject(SmartPtr< EMaterial< TDomain > > emMatherial, SmartPtr< ApproximationSpace< TDomain > > vertApproxSpace, SmartPtr< ILinearOperatorInverse< pot_vector_type > > potSolver)
Constructor.
Definition: nedelec_project_impl.h:53
SmartPtr< AuxLaplaceLocAss > m_auxLocLaplace
Local discretization of the auxiliary equations.
Definition: nedelec_project.h:684
void apply(vector_type &vec)
Performs the projection of all functions in a grid function.
Definition: nedelec_project_impl.h:90
DenseMatrix< VariableArray2< number > > m_potCoeff
Potential coefficients:
Definition: nedelec_project.h:696
NedelecProject< TDomain, TAlgebra > this_type
This type.
Definition: nedelec_project.h:74
static const int WDim
world dimention
Definition: nedelec_project.h:103
void alloc_DVFs(const TDomain &domain, pot_gf_type &aux_rhs)
Allocates memory for the DVFs associated with the ungrounded conductors.
Definition: nedelec_project_impl.h:516
std::vector< pot_gf_type * > m_DVF_phi
Dirichlet vector fields (DVFs)
Definition: nedelec_project.h:694
TDomain::position_type position_type
position type
Definition: nedelec_project.h:106
void damp_DVFs(pot_vector_type &cor, const DenseVector< VariableArray1< number > > &charge)
Damps the Dirichlet vector fields (DVFs)
Definition: nedelec_project_impl.h:680
void integrate_div_DVF_elem_type(const TDomain &domain, const DoFDistribution &vertDD, const aa_vert_cond_type &vert_base_cond, DenseMatrix< VariableArray2< number > > &C)
Integrates div E over boundaries of conductors for elements of the same type.
Definition: nedelec_project_impl.h:746
TDomain::grid_type grid_type
Type of Grid:
Definition: nedelec_project.h:81
void compute_DVFs(pot_gf_type &aux_rhs)
Computes the Dirichlet vector fields (DVFs)
Definition: nedelec_project_impl.h:586
SmartPtr< EMaterial< TDomain > > m_spEmMaterial
Properties of the matherials in the domain.
Definition: nedelec_project.h:672
void weak_div_elem_type(const TDomain &domain, const DoFDistribution &edgeDD, const vector_type &u, size_t fct, const DoFDistribution &vertDD, pot_vector_type &div)
Computes the weak divergence (for all elements of the same type)
Definition: nedelec_project_impl.h:289
TAlgebra::matrix_type matrix_type
Type of Vector (for the Nedelec-element-based grid functions)
Definition: nedelec_project.h:91
CPUAlgebra TPotAlgebra
The auxiliary algebra type for the space of the potential. (Note: It should be scalar....
Definition: nedelec_project.h:94
ConstSmartPtr< DoFDistribution > dd(const GridLevel &gl) const
TDomain::position_type position_type
ParallelMatrix< SparseMatrix< double > > matrix_type
ParallelVector< Vector< double > > vector_type
MathVector< dim > position_type
TSubsetHandler subset_handler_type
const NullSmartPtr SPNULL
SurfaceView::traits< TElem >::const_iterator const_iterator
Definition: nedelec_project.h:464
AuxLaplaceLocAss * m_pThis
Definition: nedelec_project.h:466
RegisterLocalDiscr(AuxLaplaceLocAss *pThis)
Definition: nedelec_project.h:465
void operator()(TElem &)
Definition: nedelec_project.h:467
Helper class for 'set_value_on_subset'.
Definition: nedelec_project.h:639
int m_si
Definition: nedelec_project.h:641
SetIdentityOnSubset(AuxLaplaceRHS *pThis, int si, pot_matrix_type &A, const DoFDistribution *dd)
Definition: nedelec_project.h:646
AuxLaplaceRHS * m_pThis
Definition: nedelec_project.h:640
const DoFDistribution * m_dd
Definition: nedelec_project.h:643
pot_matrix_type & m_A
Definition: nedelec_project.h:642
void operator()(TElem &)
Definition: nedelec_project.h:654
Helper class for 'set_value_on_subset'.
Definition: nedelec_project.h:605
SetValueOnSubset(AuxLaplaceRHS *pThis, int si, number val, pot_vector_type &u, const DoFDistribution *dd)
Definition: nedelec_project.h:613
void operator()(TElem &)
Definition: nedelec_project.h:622
pot_vector_type & m_u
Definition: nedelec_project.h:609
const DoFDistribution * m_dd
Definition: nedelec_project.h:610
int m_si
Definition: nedelec_project.h:607
AuxLaplaceRHS * m_pThis
Definition: nedelec_project.h:606
number m_val
Definition: nedelec_project.h:608
Helper class for assembling the weak divergence operator.
Definition: nedelec_project.h:243
this_type * m_pThis
Definition: nedelec_project.h:244
pot_vector_type & m_div
Definition: nedelec_project.h:246
void operator()(TElem &)
Definition: nedelec_project.h:258
ClearDivInConductors(this_type *pThis, const DoFDistribution &vertDD, pot_vector_type &div, DenseVector< VariableArray1< number > > &charge)
Definition: nedelec_project.h:250
const DoFDistribution & m_vertDD
Definition: nedelec_project.h:245
DenseVector< VariableArray1< number > > & m_charge
Definition: nedelec_project.h:247
Helper class for computation of the charges of the DVFs.
Definition: nedelec_project.h:357
IntegrateDivDVF(this_type *pThis, const TDomain &domain, const DoFDistribution &vertDD, const aa_vert_cond_type &vert_base_cond, DenseMatrix< VariableArray2< number > > &C)
Definition: nedelec_project.h:365
const TDomain & m_domain
Definition: nedelec_project.h:359
const aa_vert_cond_type & m_vert_base_cond
Definition: nedelec_project.h:361
const DoFDistribution & m_vertDD
Definition: nedelec_project.h:360
DenseMatrix< VariableArray2< number > > & m_C
Definition: nedelec_project.h:362
void operator()(TElem &)
Definition: nedelec_project.h:375
this_type * m_pThis
Definition: nedelec_project.h:358
Helper class for setting the base conductor indices to vertices.
Definition: nedelec_project.h:326
DoFDistribution & m_vertDD
Definition: nedelec_project.h:328
void operator()(TElem &)
Definition: nedelec_project.h:339
MarkCondVert(this_type *pThis, DoFDistribution &vertDD, aa_vert_cond_type &vert_base_cond)
Definition: nedelec_project.h:332
this_type * m_pThis
Definition: nedelec_project.h:327
aa_vert_cond_type & m_vert_base_cond
Definition: nedelec_project.h:329
Helper class for the computation the weak divergence.
Definition: nedelec_project.h:203
pot_vector_type & m_div
Definition: nedelec_project.h:210
void operator()(TElem &)
Definition: nedelec_project.h:225
const TDomain & m_domain
Definition: nedelec_project.h:205
const DoFDistribution & m_edgeDD
Definition: nedelec_project.h:206
size_t m_fct
Definition: nedelec_project.h:208
this_type * m_pThis
Definition: nedelec_project.h:204
WeakDiv(this_type *pThis, const TDomain &domain, const DoFDistribution &edgeDD, const vector_type &u, size_t fct, const DoFDistribution &vertDD, pot_vector_type &div)
Definition: nedelec_project.h:213
const DoFDistribution & m_vertDD
Definition: nedelec_project.h:209
const vector_type & m_u
Definition: nedelec_project.h:207