Loading [MathJax]/extensions/tex2jax.js
Plugins
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
simple_integrator.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2014: G-CSC, Goethe University Frankfurt
3 * SPDX-License-Identifier: LicenseRef-UG4-LGPL-3.0
4 *
5 * Author: Arne Naegel, Andreas Kreienbuehl
6 *
7 * This file is part of UG4.
8 *
9 * UG4 is free software: you can redistribute it and/or modify it under the
10 * terms of the GNU Lesser General Public License version 3 (as published by the
11 * Free Software Foundation) with the following additional attribution
12 * requirements (according to LGPL/GPL v3 §7):
13 *
14 * (1) The following notice must be displayed in the Appropriate Legal Notices
15 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
16 *
17 * (2) The following notice must be displayed at a prominent place in the
18 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
19 *
20 * (3) The following bibliography is recommended for citation and must be
21 * preserved in all covered files:
22 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
23 * parallel geometric multigrid solver on hierarchically distributed grids.
24 * Computing and visualization in science 16, 4 (2013), 151-164"
25 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
26 * flexible software system for simulating pde based models on high performance
27 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
28 *
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU Lesser General Public License for more details.
33 */
34
35#ifndef __H__LIMEX__SIMPLE_INTEGRATOR_HPP__
36#define __H__LIMEX__SIMPLE_INTEGRATOR_HPP__
37
39
40#include "time_integrator.hpp"
41
42namespace ug {
43
45template<class TDomain, class TAlgebra>
47 public INonlinearTimeIntegrator<TDomain, TAlgebra>,
48 public ITimeDiscDependentObject<TAlgebra>,
49 public DebugWritingObject<TAlgebra>
50{
51protected:
53
54public:
57 typedef typename TAlgebra::vector_type vector_type;
61
62 // constructor
69
79
80
81 bool apply
82 (
84 number t1,
86 number t0
87 )
88 {
90
91 if (tdisc.num_stages() == 1)
92 return apply_single_stage(u1,t1,u0,t0);
93 else
94 return apply_multi_stage(u1,t1,u0,t0);
95 }
96
99
102
105
108
109protected:
110
112 (
114 number t1,
116 number t0
117 );
118
120 (
122 number t1,
124 number t0
125 );
126
127 inline bool hasTerminated(double tCurrent, double tStart, double tFinal) const
128 {
129 /*return (! ((tCurrent < tFinal) && (tFinal-tCurrent > base_type::m_precisionBound)));*/
130 return tCurrent >= tFinal || tFinal-tCurrent < (tFinal-tStart)*base_type::m_precisionBound;
131 }
132
135
137
139};
140
141} // ug
142
144
145#endif // __H__LIMEX__SIMPLE_INTEGRATOR_HPP__
Integration of non-linear systems (with bounds on dt)
Definition time_integrator.hpp:351
ITimeDiscDependentObject.
Definition time_integrator.hpp:199
SmartPtr< time_disc_type > m_spTimeDisc
Definition time_integrator.hpp:209
virtual size_t num_stages() const=0
double m_precisionBound
Definition time_integrator.hpp:94
Integrate (a non-linear problem) over a given time interval.
Definition simple_integrator.hpp:50
SimpleTimeIntegrator(SmartPtr< time_disc_type > tDisc, SmartPtr< grid_function_space_type > spSpace)
Definition simple_integrator.hpp:71
number get_consistency_error() const
Definition simple_integrator.hpp:103
void set_banach_space(SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace)
Definition simple_integrator.hpp:106
SimpleTimeIntegrator(SmartPtr< time_disc_type > tDisc)
Definition simple_integrator.hpp:63
bool apply_single_stage(SmartPtr< grid_function_type > u1, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Definition simple_integrator_impl.hpp:42
bool hasTerminated(double tCurrent, double tStart, double tFinal) const
Definition simple_integrator.hpp:127
void set_derivative(SmartPtr< grid_function_type > udot)
Definition simple_integrator.hpp:97
IGridFunctionSpace< grid_function_type > grid_function_space_type
Definition simple_integrator.hpp:59
ITimeDiscretization< TAlgebra > time_disc_type
Definition simple_integrator.hpp:56
VectorTimeSeries< typename base_type::vector_type > vector_time_series_type
Definition simple_integrator.hpp:60
SmartPtr< grid_function_type > m_spDerivative
Definition simple_integrator.hpp:136
bool apply(SmartPtr< grid_function_type > u1, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Definition simple_integrator.hpp:82
base_type::grid_function_type grid_function_type
Definition simple_integrator.hpp:58
SmartPtr< IGridFunctionSpace< grid_function_type > > m_spBanachSpace
metric
Definition simple_integrator.hpp:134
TAlgebra::vector_type vector_type
Definition simple_integrator.hpp:57
number m_initial_consistency_error
Definition simple_integrator.hpp:138
bool apply_multi_stage(SmartPtr< grid_function_type > u1, number t1, ConstSmartPtr< grid_function_type > u0, number t0)
Definition simple_integrator_impl.hpp:191
ITimeDiscDependentObject< TAlgebra > tdisc_dep_type
Definition simple_integrator.hpp:52
SmartPtr< grid_function_type > get_derivative()
Definition simple_integrator.hpp:100
INonlinearTimeIntegrator< TDomain, TAlgebra > base_type
Definition simple_integrator.hpp:55
const NullSmartPtr SPNULL
double number
function ProblemDisc new(problemDesc, dom)