38 #ifndef __H__UG__PLUGINS__ELECTROMAGNETISM__HIPTMAIR_HYBRID_SMOOTHER__
39 #define __H__UG__PLUGINS__ELECTROMAGNETISM__HIPTMAIR_HYBRID_SMOOTHER__
52 #include "../em_material.h"
55 namespace Electromagnetism{
78 template <
typename TDomain,
typename TAlgebra>
186 UG_THROW (
name() <<
": illegal vert.-centered approx. space");
188 UG_THROW (
name() <<
": illegal edge-centered smoother");
190 UG_THROW (
name() <<
": illegal vert.-centered smoother");
200 const char*
name()
const {
return "Hiptmair hybrid smoother for Whitney-1 elements";}
211 UG_THROW(
name () <<
": Cannot initialize the hybrid smoother without the geometry. Specify the 2nd argument for init!");
222 if(!
apply (c, d))
return false;
226 UG_THROW (
name() <<
"::apply_update_defect: failed to execute matmul_minus");
255 newInst->set_damp (this->
damping ());
298 static inline bool op (
bool a,
bool b) {
return a || b;}
303 static inline bool op (
bool a,
bool b) {
return a && b;}
SmartPtr< IDebugWriter< algebra_type > > debug_writer()
Common interface to get the Dirichlet boundary conditions.
Definition: em_material.h:287
The hybrid smoother by R. Hiptmair.
Definition: hiptmair_hybrid_smoother.h:82
MatrixOperator< matrix_type, vector_type > matrix_operator_type
Matrix Operator type.
Definition: hiptmair_hybrid_smoother.h:91
void collect_edge_defect(const vector_type &d, pot_vector_type &potDefRe, pot_vector_type &potDefIm)
Computes the vertex-centered defect .
Definition: hiptmair_hybrid_smoother_impl.h:357
~TimeHarmonicNedelecHybridSmoother()
Destructor.
Definition: hiptmair_hybrid_smoother.h:194
CPUAlgebra TPotAlgebra
The auxiliary algebra type for the space of the potential. (Note: It should be scalar....
Definition: hiptmair_hybrid_smoother.h:94
TPotGridFunc * m_pPotCorIm
Vertex-centered grid function for the Im-part of potential corrections (this is a GridFunction to all...
Definition: hiptmair_hybrid_smoother.h:121
GridFunction< TDomain, TAlgebra > TGridFunc
Grid function type for the solution.
Definition: hiptmair_hybrid_smoother.h:103
TPotAlgebra::matrix_type pot_matrix_type
Matrix type for the potential space.
Definition: hiptmair_hybrid_smoother.h:98
void set_Dirichlet(SmartPtr< EMDirichlet< TDomain, TAlgebra > > spDirichlet)
Sets the Dirichlet boundary.
Definition: hiptmair_hybrid_smoother.h:233
GridFunction< TDomain, TPotAlgebra > TPotGridFunc
Grid function type for the potential.
Definition: hiptmair_hybrid_smoother.h:105
bool apply_update_defect(vector_type &c, vector_type &d)
Computes the correction and updates the defect d := d - L*c.
Definition: hiptmair_hybrid_smoother.h:219
bool init(SmartPtr< ILinearOperator< vector_type > > J, const vector_type &u)
Initialization using a matrix and a GridFunction (not merely a vector!)
Definition: hiptmair_hybrid_smoother_impl.h:283
void set_skip_edge_smoother(bool skip_edge)
Skip flag the edge smoother.
Definition: hiptmair_hybrid_smoother.h:241
TPotAlgebra::vector_type pot_vector_type
Vector type for the potential space.
Definition: hiptmair_hybrid_smoother.h:96
SmartPtr< matrix_operator_type > m_spSysMat
Edge-centered matrix of the original equation.
Definition: hiptmair_hybrid_smoother.h:113
const char * name() const
Returns the name.
Definition: hiptmair_hybrid_smoother.h:200
MatrixOperator< pot_matrix_type, pot_vector_type > pot_matrix_operator_type
Matrix Operator type for the potential space.
Definition: hiptmair_hybrid_smoother.h:100
TimeHarmonicNedelecHybridSmoother< TDomain, TAlgebra > this_type
Definition: hiptmair_hybrid_smoother.h:83
SmartPtr< DoFDistribution > m_spEdgeDD
DoF distribution for the Nedelec elements.
Definition: hiptmair_hybrid_smoother.h:124
SmartPtr< ApproximationSpace< TDomain > > m_spVertApproxSpace
Approximation space for the potential (vertex-centered) space.
Definition: hiptmair_hybrid_smoother.h:127
bool zero_mass_entry(double val)
Measure for numerically zero entries in the mass matrix.
Definition: hiptmair_hybrid_smoother.h:110
bool apply(vector_type &c, const vector_type &d)
Computes the correction.
Definition: hiptmair_hybrid_smoother_impl.h:455
bool m_bInit
Whether initialized.
Definition: hiptmair_hybrid_smoother.h:165
TAlgebra::matrix_type matrix_type
Matrix type.
Definition: hiptmair_hybrid_smoother.h:89
SmartPtr< ILinearIterator< vector_type > > m_spEdgeSmoother
Smoother for the edge dofs.
Definition: hiptmair_hybrid_smoother.h:135
SmartPtr< ILinearIterator< vector_type, vector_type > > clone()
Clone the smoother by copying the data.
Definition: hiptmair_hybrid_smoother.h:246
void compute_GtMG()
Computes the product .
Definition: hiptmair_hybrid_smoother_impl.h:128
SmartPtr< ILinearIterator< pot_vector_type > > m_spVertSmoother
Smoother for the vertex dofs.
Definition: hiptmair_hybrid_smoother.h:138
bool m_bSkipVertex
Definition: hiptmair_hybrid_smoother.h:168
bool init(SmartPtr< ILinearOperator< vector_type > > L)
We cannot initialize without the geometry (this version of init cannot not work)
Definition: hiptmair_hybrid_smoother.h:209
void compute_potential_matrix(const DoFDistribution *pEdgeDD, const DoFDistribution *pVertDD)
Computes the matrix for the smoother in the potential space and marks the "conductive nodes".
Definition: hiptmair_hybrid_smoother_impl.h:243
SmartPtr< pot_matrix_operator_type > m_spPotMat
Vertex-centered matrix for the potential.
Definition: hiptmair_hybrid_smoother.h:116
SmartPtr< EMDirichlet< TDomain, TAlgebra > > m_spDirichlet
Dirichlet boundary.
Definition: hiptmair_hybrid_smoother.h:141
void distribute_vertex_correction(pot_vector_type &potCorRe, pot_vector_type &potCorIm, vector_type &c)
Adds the vertex-centered correction to the edge-centered one:
Definition: hiptmair_hybrid_smoother_impl.h:395
SmartPtr< DoFDistribution > m_spVertDD
Level DoF distribution for the vertex centered grid func.
Definition: hiptmair_hybrid_smoother.h:129
void set_skip_vertex_smoother(bool skip_vertex)
Skip flag the vertex smoother.
Definition: hiptmair_hybrid_smoother.h:243
bool supports_parallel() const
Currently returns false because the computation of the potentials is not purely parallel up to now.
Definition: hiptmair_hybrid_smoother.h:203
VariableArray1< tEdgeInfo > m_vEdgeInfo
Storage for the information about the edge-vertex interconnections.
Definition: hiptmair_hybrid_smoother.h:162
bool m_bSkipEdge
Needed mainly for debugging: Whether to skip one of the stages.
Definition: hiptmair_hybrid_smoother.h:168
GridLevel m_GridLevel
Grid level (or surface) where to smooth.
Definition: hiptmair_hybrid_smoother.h:132
TimeHarmonicNedelecHybridSmoother(SmartPtr< ApproximationSpace< TDomain > > vertApproxSpace, SmartPtr< ILinearIterator< vector_type > > edgeSmoother, SmartPtr< ILinearIterator< pot_vector_type > > vertSmoother)
Constructor setting the approx. spaces and the default subsmoothers.
Definition: hiptmair_hybrid_smoother.h:173
TPotGridFunc * m_pPotCorRe
Vertex-centered grid function for the Re-part of potential corrections (this is a GridFunction to all...
Definition: hiptmair_hybrid_smoother.h:119
TAlgebra::vector_type vector_type
Vector type.
Definition: hiptmair_hybrid_smoother.h:87
void get_edge_vert_correspondence(const DoFDistribution *pEdgeDD, const DoFDistribution *pVertDD)
Gets the correspondence between the edges and the vertices.
Definition: hiptmair_hybrid_smoother_impl.h:61
SmartPtr< IDamping< X, Y > > damping()
ParallelMatrix< SparseMatrix< double > > matrix_type
ParallelVector< Vector< double > > vector_type
"and" reduction operation class for the conductivity condition
Definition: hiptmair_hybrid_smoother.h:302
static bool op(bool a, bool b)
Definition: hiptmair_hybrid_smoother.h:303
"or" reduction operation class for the conductivity condition
Definition: hiptmair_hybrid_smoother.h:297
static bool op(bool a, bool b)
Definition: hiptmair_hybrid_smoother.h:298
Structure of the storage for the information about the edge-vertex interconnections.
Definition: hiptmair_hybrid_smoother.h:145
void set_init()
Definition: hiptmair_hybrid_smoother.h:159
bool is_Dirichlet()
Definition: hiptmair_hybrid_smoother.h:150
void set_Dirichlet()
Definition: hiptmair_hybrid_smoother.h:156
void set_conductive_vrt_1()
Definition: hiptmair_hybrid_smoother.h:158
bool conductive_vrt_0()
Definition: hiptmair_hybrid_smoother.h:151
void set_conductive_vrt_0()
Definition: hiptmair_hybrid_smoother.h:157
bool is_init()
Definition: hiptmair_hybrid_smoother.h:153
size_t vrt_index[2]
vertex dof's of the beginning and the end of the edge
Definition: hiptmair_hybrid_smoother.h:146
bool conductive_vrt_1()
Definition: hiptmair_hybrid_smoother.h:152
char flags
flags: (0) Dirichlet, (1) conductive vertex 0, (2) conductive vertex 1, (3) init-ed
Definition: hiptmair_hybrid_smoother.h:148
void clear_flags()
Definition: hiptmair_hybrid_smoother.h:155
function ProblemDisc new(problemDesc, dom)