33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__DOMAIN_DISC__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__DOMAIN_DISC__
76 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
80 protected TGlobAssembler
201 const std::vector<number>& vScaleMass,
202 const std::vector<number>& vScaleStiff,
206 const std::vector<number>& vScaleMass,
207 const std::vector<number>& vScaleStiff,
214 const std::vector<number>& vScaleMass,
215 const std::vector<number>& vScaleStiff,
219 const std::vector<number>& vScaleMass,
220 const std::vector<number>& vScaleStiff,
227 const std::vector<number>& vScaleMass,
228 const std::vector<number>& vScaleStiff,
232 const std::vector<number>& vScaleMass,
233 const std::vector<number>& vScaleStiff,
296 const std::vector<number>& vScaleMass,
297 const std::vector<number>& vScaleStiff,
300 const std::vector<number>& vScaleMass,
301 const std::vector<number>& vScaleStiff,
306 vScaleMass, vScaleStiff, u_vtk);
376 UG_LOG(
"Tried to remove ElemDisc from DomainDisc"
377 ", but could not find it there.");
423 UG_LOG(
"Tried to remove ElemError from DomainDisc"
424 ", but could not find it there.");
469 UG_LOG(
"Tried to remove DomainConstraint from DomainDisc"
470 ", but could not find it there.");
483 for(
size_t i = 0; i < di->num_elem_disc(); ++i)
484 add(di->elem_disc(i));
487 for(
size_t i = 0; i < di->num_constraint(); ++i)
488 add(di->constraint(i));
526 std::vector<SmartPtr<IDomainConstraint<TDomain, TAlgebra> > >
m_vConstraint;
538 template <
typename TElem>
541 int si,
bool bNonRegularGrid,
544 template <
typename TElem>
547 int si,
bool bNonRegularGrid,
550 template <
typename TElem>
553 int si,
bool bNonRegularGrid,
556 template <
typename TElem>
559 int si,
bool bNonRegularGrid,
562 template <
typename TElem>
565 int si,
bool bNonRegularGrid,
568 template <
typename TElem>
571 int si,
bool bNonRegularGrid,
574 template <
typename TElem>
577 int si,
bool bNonRegularGrid,
580 template <
typename TElem>
583 int si,
bool bNonRegularGrid,
585 template <
typename TElem>
588 int si,
bool bNonRegularGrid,
592 template <
typename TElem>
595 int si,
bool bNonRegularGrid,
598 const std::vector<number>& vScaleMass,
599 const std::vector<number>& vScaleStiff);
600 template <
typename TElem>
603 int si,
bool bNonRegularGrid,
607 const std::vector<number>& vScaleMass,
608 const std::vector<number>& vScaleStiff);
609 template <
typename TElem>
612 int si,
bool bNonRegularGrid,
615 const std::vector<number>& vScaleMass,
616 const std::vector<number>& vScaleStiff);
617 template <
typename TElem>
620 int si,
bool bNonRegularGrid,
622 template <
typename TElem>
625 int si,
bool bNonRegularGrid,
626 const std::vector<number>& vScaleMass,
627 const std::vector<number>& vScaleStiff,
629 template <
typename TElem>
632 int si,
bool bNonRegularGrid,
bool bAsTimeDependent);
648 template <
typename TDomain,
typename TAlgebra>
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
base class for approximation spaces without type of algebra or dof distribution
Definition: approximation_space.h:279
The AssemblingTuner class combines tools to adapt the assembling routine.
Definition: ass_tuner.h:90
generic domain discretization implementing the interface
Definition: domain_disc.h:81
void update_constraints()
Definition: domain_disc_impl.h:112
void add_elem_error_indicator(SmartPtr< IElemError< TDomain > > elem)
adds an element error indicator to the assembling process
Definition: domain_disc.h:390
virtual void calc_error(const vector_type &u, ConstSmartPtr< DoFDistribution > dd, error_vector_type *u_vtk=NULL)
Definition: domain_disc_impl.h:2270
virtual void init_all_exports(ConstSmartPtr< DoFDistribution > dd, bool bAsTimeDependent)
Definition: domain_disc_impl.h:2112
void remove(SmartPtr< IElemDisc< TDomain > > elem)
removes a element discretization from the assembling process
Definition: domain_disc.h:363
SmartPtr< AssemblingTuner< TAlgebra > > m_spAssTuner
this object provides tools to adapt the assemble routine
Definition: domain_disc.h:532
std::vector< SmartPtr< IElemDisc< TDomain > > > m_vDomainElemDisc
vector holding all registered elem discs
Definition: domain_disc.h:514
void add(SmartPtr< IDiscretizationItem< TDomain, TAlgebra > > di)
adds a disc item to the assembling process
Definition: domain_disc.h:480
void InitAllExports(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, bool bAsTimeDependent)
Definition: domain_disc_impl.h:2217
void update_elem_discs()
set the approximation space in the elem discs and extract IElemDiscs
Definition: domain_disc_impl.h:68
virtual bool is_error_valid()
returns whether current error values are valid
Definition: domain_disc_impl.h:2841
virtual void calc_error(const vector_type &u, const GridLevel &gl, error_vector_type *u_vtk=NULL)
Definition: domain_disc.h:285
virtual size_t num_constraints() const
returns number of registered constraints
Definition: domain_disc.h:492
TDomain domain_type
Type of Domain.
Definition: domain_disc.h:87
void assemble_defect(vector_type &d, GridFunction< TDomain, TAlgebra > &u)
Definition: domain_disc.h:157
bool m_bErrorCalculated
Definition: domain_disc.h:320
virtual void invalidate_error()
Definition: domain_disc_impl.h:2826
void AssembleJacobian(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &J, const vector_type &u)
Definition: domain_disc_impl.h:615
void AssembleErrorEstimator(const std::vector< IElemError< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, const vector_type &u)
Definition: domain_disc_impl.h:2533
std::vector< IElemDisc< TDomain > * > m_vElemDisc
vector holding all registered elem discs
Definition: domain_disc.h:517
ApproximationSpace< TDomain > approx_space_type
Type of approximation space.
Definition: domain_disc.h:102
void remove_elem_error_indicator(SmartPtr< IElemError< TDomain > > elem)
removes a element discretization from the assembling process
Definition: domain_disc.h:410
virtual void finish_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
finishes time step
Definition: domain_disc_impl.h:2853
TAlgebra algebra_type
Type of algebra.
Definition: domain_disc.h:90
algebra_type::matrix_type matrix_type
Type of algebra matrix.
Definition: domain_disc.h:93
virtual void assemble_rhs(vector_type &rhs, const GridLevel &gl)
assembles the rhs
Definition: domain_disc.h:144
virtual void prepare_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
prepares time step element-wise
Definition: domain_disc_impl.h:1241
static const int dim
world dimension
Definition: domain_disc.h:105
void adjust_solution(GridFunction< TDomain, TAlgebra > &u)
Definition: domain_disc.h:169
virtual void adjust_solution(vector_type &u, number time, const GridLevel &gl)
sets dirichlet values in solution vector
Definition: domain_disc.h:239
virtual void calc_error(const GridFunction< TDomain, TAlgebra > &u)
Definition: domain_disc.h:288
virtual void prepare_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, ConstSmartPtr< DoFDistribution > dd)
prepares time step
Definition: domain_disc_impl.h:1204
virtual void assemble_rhs(vector_type &rhs, const vector_type &u, const GridLevel &gl)
assembles the rhs
Definition: domain_disc.h:138
virtual void assemble_jacobian(matrix_type &J, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const number s_a, const GridLevel &gl)
assembles Jacobian (or Approximation of Jacobian)
Definition: domain_disc.h:193
void update_disc_items()
Definition: domain_disc_impl.h:127
void AssembleMassMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &M, const vector_type &u)
Definition: domain_disc_impl.h:271
virtual void assemble_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles Defect
Definition: domain_disc_impl.h:648
virtual void mark_with_strategy(IRefiner &refiner, SmartPtr< IElementMarkingStrategy< TDomain > > strategy)
Definition: domain_disc_impl.h:2807
void assemble_linear(matrix_type &A, GridFunction< TDomain, TAlgebra > &rhs)
Definition: domain_disc.h:160
void remove(SmartPtr< IDomainConstraint< TDomain, TAlgebra > > pp)
removes a constraint from the assembling process
Definition: domain_disc.h:456
virtual void prepare_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, const GridLevel &gl)
Definition: domain_disc.h:178
void AssembleRhs(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, vector_type &rhs, const vector_type &u)
Definition: domain_disc_impl.h:1124
virtual void assemble_mass_matrix(matrix_type &M, const vector_type &u, const GridLevel &gl)
assembles the mass matrix
Definition: domain_disc.h:264
virtual void adjust_solution(vector_type &u, const GridLevel &gl)
sets dirichlet values in solution vector
Definition: domain_disc.h:149
virtual void assemble_mass_matrix(matrix_type &M, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles the mass matrix
Definition: domain_disc_impl.h:145
DomainDiscretizationBase(SmartPtr< approx_space_type > pApproxSpace)
default Constructor
Definition: domain_disc.h:109
virtual void assemble_linear(matrix_type &mat, vector_type &rhs, const GridLevel &gl)
Assembles Matrix and Right-Hand-Side for a linear problem.
Definition: domain_disc.h:133
virtual void assemble_stiffness_matrix(matrix_type &A, const vector_type &u, const GridLevel &gl)
assembles the stiffness matrix
Definition: domain_disc.h:271
virtual void assemble_defect(vector_type &d, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
assembles Defect
Definition: domain_disc.h:204
IMultigridElementIndicators< TDomain > m_mgElemErrors
Definition: domain_disc.h:319
void assemble_rhs(vector_type &rhs, GridFunction< TDomain, TAlgebra > &u)
Definition: domain_disc.h:163
void AssembleDefect(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, vector_type &d, const vector_type &u)
Definition: domain_disc_impl.h:804
void add(SmartPtr< IElemDisc< TDomain > > elem)
adds an element discretization to the assembling process
Definition: domain_disc.h:342
std::vector< SmartPtr< IElemError< TDomain > > > m_vDomainElemError
vector holding all registered elem discs
Definition: domain_disc.h:520
void add(SmartPtr< IDomainConstraint< TDomain, TAlgebra > > pp)
adds a constraint to the assembling process
Definition: domain_disc.h:435
CPUAlgebra::vector_type error_vector_type
Type of error vector.
Definition: domain_disc.h:99
virtual void assemble_linear(matrix_type &A, vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
Assembles matrix_type and Right-Hand-Side for a linear problem.
Definition: domain_disc.h:217
ConstSmartPtr< DoFDistribution > dd(const GridLevel &gl) const
returns the level dof distribution
Definition: domain_disc.h:510
virtual ~DomainDiscretizationBase()
virtual destructor
Definition: domain_disc.h:115
void AssembleLinear(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &A, vector_type &rhs)
Definition: domain_disc_impl.h:965
std::vector< IElemError< TDomain > * > m_vElemError
vector holding all registered elem discs
Definition: domain_disc.h:523
virtual void assemble_stiffness_matrix(matrix_type &A, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles the stiffness matrix
Definition: domain_disc_impl.h:305
virtual void assemble_rhs(vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
Assembles Right-Hand-Side for a linear problem.
Definition: domain_disc.h:230
virtual void assemble_rhs(vector_type &rhs, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles rhs
Definition: domain_disc_impl.h:998
virtual void assemble_linear(matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd)
Assembles Matrix and Right-Hand-Side for a linear problem.
Definition: domain_disc_impl.h:837
TGlobAssembler gass_type
Type of the global assembler.
Definition: domain_disc.h:83
virtual ConstSmartPtr< AssemblingTuner< TAlgebra > > ass_tuner() const
Definition: domain_disc.h:328
std::vector< SmartPtr< IDomainConstraint< TDomain, TAlgebra > > > m_vConstraint
vector holding all registered constraints
Definition: domain_disc.h:526
void FinishTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
Definition: domain_disc_impl.h:2991
void assemble_jacobian(matrix_type &J, GridFunction< TDomain, TAlgebra > &u)
Definition: domain_disc.h:154
virtual void finish_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
finishes timestep
Definition: domain_disc.h:249
algebra_type::vector_type vector_type
Type of algebra vector.
Definition: domain_disc.h:96
SmartPtr< approx_space_type > approximation_space()
Definition: domain_disc.h:497
virtual void finish_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
finishes timestep
Definition: domain_disc_impl.h:2889
void AssembleStiffnessMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &A, const vector_type &u)
Definition: domain_disc_impl.h:431
ConstSmartPtr< approx_space_type > approximation_space() const
Definition: domain_disc.h:498
void assemble_rhs(GridFunction< TDomain, TAlgebra > &b)
Definition: domain_disc.h:166
void init_all_exports(bool bAsTimeDependent)
Definition: domain_disc.h:258
virtual void assemble_jacobian(matrix_type &J, const vector_type &u, const GridLevel &gl)
assembles Jacobian (or Approximation of Jacobian)
Definition: domain_disc.h:123
SmartPtr< approx_space_type > m_spApproxSpace
current approximation space
Definition: domain_disc.h:529
virtual void calc_error(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl, error_vector_type *u_vtk)
Transient version.
Definition: domain_disc.h:299
virtual void calc_error(const GridFunction< TDomain, TAlgebra > &u, error_vector_type *u_vtk)
Definition: domain_disc.h:290
virtual void prepare_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
Definition: domain_disc.h:185
void PrepareTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
Definition: domain_disc_impl.h:1344
virtual SmartPtr< AssemblingTuner< TAlgebra > > ass_tuner()
Definition: domain_disc.h:327
virtual SmartPtr< IConstraint< TAlgebra > > constraint(size_t i)
returns the i'th constraint
Definition: domain_disc.h:495
virtual void assemble_jacobian(matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles Jacobian (or Approximation of Jacobian)
Definition: domain_disc_impl.h:471
void update_error_items()
Definition: domain_disc_impl.h:134
virtual void init_all_exports(const GridLevel &gl, bool bAsTimeDependent)
Definition: domain_disc.h:256
void update_elem_errors()
Definition: domain_disc_impl.h:89
virtual void adjust_solution(vector_type &u, ConstSmartPtr< DoFDistribution > dd)
sets dirichlet values in solution vector
Definition: domain_disc_impl.h:1156
virtual void assemble_rhs(vector_type &rhs, ConstSmartPtr< DoFDistribution > dd)
assembles rhs
Definition: domain_disc.h:142
virtual void assemble_defect(vector_type &d, const vector_type &u, const GridLevel &gl)
assembles Defect
Definition: domain_disc.h:128
virtual void finish_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
Definition: domain_disc.h:244
domain discretization implementing the interface
Definition: domain_disc.h:651
virtual ~DomainDiscretization()
virtual destructor
Definition: domain_disc.h:681
TDomain domain_type
Type of Domain.
Definition: domain_disc.h:657
TAlgebra algebra_type
Type of algebra.
Definition: domain_disc.h:660
static const int dim
world dimension
Definition: domain_disc.h:672
algebra_type::vector_type vector_type
Type of algebra vector.
Definition: domain_disc.h:666
StdGlobAssembler< TDomain, TAlgebra > gass_type
Type of the global assembler.
Definition: domain_disc.h:653
algebra_type::matrix_type matrix_type
Type of algebra matrix.
Definition: domain_disc.h:663
DomainDiscretization(SmartPtr< approx_space_type > pApproxSpace)
default Constructor
Definition: domain_disc.h:676
ApproximationSpace< TDomain > approx_space_type
Type of approximation space.
Definition: domain_disc.h:669
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
SmartPtr< DoFDistribution > dof_distribution()
Definition: grid_function.h:236
SmartPtr< DoFDistribution > dd()
Definition: grid_function.h:237
Definition: grid_level.h:42
@ TOP
Definition: grid_level.h:45
TAlgebra algebra_type
Algebra type.
Definition: assemble_interface.h:113
TAlgebra::vector_type vector_type
Type of algebra vector.
Definition: assemble_interface.h:119
TAlgebra::matrix_type matrix_type
Type of algebra matrix.
Definition: assemble_interface.h:116
Definition: disc_item.h:43
Definition: constraint_interface.h:162
Interface for domain discretization.
Definition: domain_disc_interface.h:136
Interface for an object that can mark elements based on a strategy.
Definition: domain_disc_interface.h:107
Definition: elem_disc_interface.h:800
Definition: elem_disc_interface.h:760
Abstract base class for element marking (in adaptive refinement)
Definition: error_elem_marking_strategy.h:125
This class encapsulates the multi-grid attachments for error estimation.
Definition: error_elem_marking_strategy.h:54
The refiner interface allows to mark elements for refinement and to call refine.
Definition: refiner_interface.h:67
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
Global assembler based on the straightforward application of the local discretizations.
Definition: elem_disc_assemble_util.h:78
time series of solutions and corresponding time point
Definition: solution_time_series.h:59
#define UG_LOG(msg)
Definition: log.h:367
double number
Definition: types.h:124
CPUAlgebra::vector_type vector_type
function ProblemDisc new(problemDesc, dom)