ug4
time_disc_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Author: Andreas Vogel
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__LIB_DISC__TIME_DISC__TIME_DISC_INTERFACE__
34 #define __H__UG__LIB_DISC__TIME_DISC__TIME_DISC_INTERFACE__
35 
36 // extern libraries
37 #include <deque>
38 
39 // other ug libraries
40 #include "common/common.h"
41 
42 // module intern libraries
46 
47 namespace ug{
48 
51 
53 
63 template <typename TAlgebra>
64 class ITimeDiscretization : public IAssemble<TAlgebra>
65 {
66  public:
68  typedef TAlgebra algebra_type;
69 
71  typedef typename algebra_type::vector_type vector_type;
72 
75 
76  public:
78 
82  : m_spDomDisc(spDD)
83  {}
84 
86 
94  number dt) = 0;
95 
97 
109  number dt, const GridLevel& gl) = 0;
111  number dt)
112  {prepare_step_elem(prevSol, dt, GridLevel());}
114 
117 
125 
128 
139  const GridLevel& gl) = 0;
141  {finish_step_elem(currSol, GridLevel());}
143 
145  virtual number future_time() const = 0;
146 
148  virtual size_t num_prev_steps() const = 0;
149 
151  virtual size_t num_stages() const = 0;
152 
154  virtual void set_stage(size_t stage) = 0;
155 
158  {return m_spDomDisc;}
159 
161  virtual size_t num_constraints() const
162  {
163  return m_spDomDisc->num_constraints();
164  }
165 
168  {
169  return m_spDomDisc->constraint(i);
170  }
171 
172  protected:
174 
175  private:
181 };
182 
184 
185 } // end namespace ug
186 
187 #endif /* __H__UG__LIB_DISC__TIME_DISC__TIME_DISC_INTERFACE__ */
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
Definition: grid_level.h:42
Interface providing Jacobian and Defect of a discretization.
Definition: assemble_interface.h:110
Interface for domain discretization.
Definition: domain_disc_interface.h:136
Time Discretization Interface.
Definition: time_disc_interface.h:65
void prepare_step_elem(SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt)
prepares the assembling of Defect/Jacobian for a time step
Definition: time_disc_interface.h:110
virtual void finish_step(SmartPtr< VectorTimeSeries< vector_type > > currSol)=0
algebra_type::vector_type vector_type
Vector type.
Definition: time_disc_interface.h:71
virtual SmartPtr< IConstraint< TAlgebra > > constraint(size_t i)
returns the i'th constraint
Definition: time_disc_interface.h:167
virtual void set_stage(size_t stage)=0
sets the stage
virtual void prepare_step(SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt)=0
prepares the assembling of Defect/Jacobian for a time step
ITimeDiscretization(SmartPtr< IDomainDiscretization< TAlgebra > > spDD)
create and set domain discretization
Definition: time_disc_interface.h:81
virtual void prepare_step_elem(SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt, const GridLevel &gl)=0
prepares the assembling of Defect/Jacobian for a time step
SmartPtr< IDomainDiscretization< TAlgebra > > domain_disc() const
return underlying domain disc
Definition: time_disc_interface.h:157
virtual void finish_step_elem(SmartPtr< VectorTimeSeries< vector_type > > currSol, const GridLevel &gl)=0
virtual size_t num_prev_steps() const =0
returns number of previous time steps needed
SmartPtr< AssemblingTuner< TAlgebra > > ass_tuner()
Definition: time_disc_interface.h:178
ConstSmartPtr< AssemblingTuner< TAlgebra > > ass_tuner() const
Definition: time_disc_interface.h:179
SmartPtr< IDomainDiscretization< TAlgebra > > m_spDomDisc
Domain Discretization.
Definition: time_disc_interface.h:173
virtual number future_time() const =0
returns the future time point (i.e. the one that will be computed)
void finish_step_elem(SmartPtr< VectorTimeSeries< vector_type > > currSol)
Definition: time_disc_interface.h:140
virtual size_t num_constraints() const
returns the number of constraint
Definition: time_disc_interface.h:161
TAlgebra algebra_type
Algebra type.
Definition: time_disc_interface.h:68
virtual size_t num_stages() const =0
returns the number of stages
IDomainDiscretization< TAlgebra > domain_discretization_type
Domain Discretization type.
Definition: time_disc_interface.h:74
time series of solutions and corresponding time point
Definition: solution_time_series.h:59
double number
Definition: types.h:124
the ug namespace