Loading [MathJax]/extensions/tex2jax.js
Plugins
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
newton_limex.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3 * SPDX-License-Identifier: LicenseRef-UG4-LGPL-3.0
4 *
5 * Author: Markus Breit,
6 * but largely copied from ugcore Newton implementation by Andreas Vogel
7 *
8 * This file is part of UG4.
9 *
10 * UG4 is free software: you can redistribute it and/or modify it under the
11 * terms of the GNU Lesser General Public License version 3 (as published by the
12 * Free Software Foundation) with the following additional attribution
13 * requirements (according to LGPL/GPL v3 §7):
14 *
15 * (1) The following notice must be displayed in the Appropriate Legal Notices
16 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (2) The following notice must be displayed at a prominent place in the
19 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
20 *
21 * (3) The following bibliography is recommended for citation and must be
22 * preserved in all covered files:
23 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
24 * parallel geometric multigrid solver on hierarchically distributed grids.
25 * Computing and visualization in science 16, 4 (2013), 151-164"
26 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
27 * flexible software system for simulating pde based models on high performance
28 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
29 *
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU Lesser General Public License for more details.
34 */
35
36#ifndef UG_PLUGINS__LIMEX__NEWTON_LIMEX
37#define UG_PLUGINS__LIMEX__NEWTON_LIMEX
38
42
46
47
48namespace ug {
49
51template <typename TAlgebra>
53 : public IOperatorInverse<typename TAlgebra::vector_type>
54 //public DebugWritingObject<TAlgebra>
55{
56 public:
58 typedef TAlgebra algebra_type;
59
61 typedef typename TAlgebra::vector_type vector_type;
62
64 typedef typename TAlgebra::matrix_type matrix_type;
65
66 public:
69
72
75
79
81 virtual bool init(SmartPtr<IOperator<vector_type> > N);
82
84 virtual bool prepare(vector_type& u);
85
87 virtual bool apply(vector_type& u);
88
96 virtual std::string config_string() const;
97
100
102 int linear_solver_steps() const;
103
104 private:
107 void write_debug(const vector_type& vec, const char* filename);
108 void write_debug(const matrix_type& mat, const char* filename);
110
111 private:
114
115
118
121
124
125
131};
132
133} // namespace ug
134
135#include "newton_limex_impl.h"
136
137#endif // UG_PLUGINS__LIMEX__NEWTON_LIMEX
Newton solver for assembling-based discretizations solved using Limex.
Definition newton_limex.h:55
TAlgebra algebra_type
algebra type
Definition newton_limex.h:58
SmartPtr< AssembledLinearOperator< algebra_type > > m_J
jacobi operator
Definition newton_limex.h:120
number m_linSolverRate
Definition newton_limex.h:129
TAlgebra::vector_type vector_type
vector type
Definition newton_limex.h:61
LimexNewtonSolver()
default constructor
Definition newton_limex_impl.h:59
virtual bool prepare(vector_type &u)
prepare operator
Definition newton_limex_impl.h:109
size_t m_linSolverSteps
Definition newton_limex.h:128
void write_debug(const vector_type &vec, const char *filename)
TAlgebra::matrix_type matrix_type
matrix type
Definition newton_limex.h:64
SmartPtr< ILinearOperatorInverse< vector_type > > m_spLinearSolver
linear solver
Definition newton_limex.h:113
number linear_solver_rate() const
prints average linear solver convergence
Definition newton_limex_impl.h:211
SmartPtr< IAssemble< TAlgebra > > m_spAss
assembling
Definition newton_limex.h:123
virtual bool init(SmartPtr< IOperator< vector_type > > N)
This operator inverts the operator N: Y -> X.
Definition newton_limex_impl.h:96
SmartPtr< AssembledOperator< algebra_type > > m_N
assembling routine
Definition newton_limex.h:117
void set_linear_solver(SmartPtr< ILinearOperatorInverse< vector_type > > LinearSolver)
sets the linear solver
Definition newton_limex.h:77
virtual std::string config_string() const
Returns information about configuration parameters. This should return necessary information about pa...
Definition newton_limex_impl.h:223
virtual bool apply(vector_type &u)
apply operator, i.e. N^{-1}(0) = u
Definition newton_limex_impl.h:116
void write_debug(const matrix_type &mat, const char *filename)
int linear_solver_steps() const
information on linear solver convergence
Definition newton_limex_impl.h:217
double number