Line data Source code
1 : /*
2 : * Copyright (c) 2013-2015: G-CSC, Goethe University Frankfurt
3 : * Author: Martin Rupp
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 :
34 : // extern headers
35 : #include <iostream>
36 : #include <sstream>
37 : #include <string>
38 :
39 : // include bridge
40 : #include "bridge/bridge.h"
41 : #include "bridge/util.h"
42 : #include "bridge/util_algebra_dependent.h"
43 :
44 : #if 0
45 :
46 : // preconditioner
47 : #include "lib_algebra/lib_algebra.h"
48 : #include "lib_algebra/operator/preconditioner/pilut.h"
49 : using namespace std;
50 :
51 : namespace ug{
52 : namespace bridge{
53 : namespace Preconditioner{
54 :
55 : /**
56 : * \defgroup precond_bridge Preconditioner Bridge
57 : * \ingroup algebra_bridge
58 : * \{
59 : */
60 :
61 : /**
62 : * Class exporting the functionality. All functionality that is to
63 : * be used in scripts or visualization must be registered here.
64 : */
65 : struct Functionality2
66 : {
67 :
68 : /**
69 : * Function called for the registration of Algebra dependent parts.
70 : * All Functions and Classes depending on Algebra
71 : * are to be placed here when registering. The method is called for all
72 : * available Algebra types, based on the current build options.
73 : *
74 : * @param reg registry
75 : * @param parentGroup group for sorting of functionality
76 : */
77 : template <typename TAlgebra>
78 : static void Algebra(Registry& reg, string grp)
79 : {
80 : string suffix = GetAlgebraSuffix<TAlgebra>();
81 : string tag = GetAlgebraTag<TAlgebra>();
82 :
83 : // typedefs for this algebra
84 : typedef typename TAlgebra::vector_type vector_type;
85 : typedef typename TAlgebra::matrix_type matrix_type;
86 :
87 :
88 :
89 : // PILU Threshold
90 : {
91 : typedef PILUTPreconditioner<TAlgebra> T;
92 : typedef IPreconditioner<TAlgebra> TBase;
93 : string name = string("PILUT").append(suffix);
94 : reg.add_class_<T,TBase>(name, grp, "Incomplete LU Decomposition with threshold")
95 : .add_constructor()
96 : .template add_constructor<void (*)(number)>("threshold parameter")
97 : .add_method("set_threshold", &T::set_threshold,
98 : "", "threshold", "sets threshold of incomplete LU factorisation")
99 : .add_method("set_info", &T::set_info,
100 : "", "info", "sets storage information output")
101 : .add_method("set_show_progress", &T::set_show_progress,
102 : "", "onoff", "switches the progress indicator on/off")
103 : //.add_method("set_group_size", &T::set_group_size,"", "groupSize", "sets group size")
104 : .set_construct_as_smart_pointer(true);
105 : reg.add_class_to_group(name, "PILUT", tag);
106 : }
107 : }
108 :
109 :
110 : }; // end Functionality
111 :
112 : // end group precond_bridge
113 : /// \}
114 :
115 : }// end Preconditioner
116 :
117 : /// \addtogroup precond_bridge
118 : void RegisterBridge_PILUT(Registry& reg, string grp)
119 : {
120 : grp.append("/Algebra/Preconditioner");
121 : typedef Preconditioner::Functionality2 Functionality2;
122 :
123 : try{
124 : RegisterAlgebraDependent<Functionality2>(reg,grp);
125 : }
126 : UG_REGISTRY_CATCH_THROW(grp);
127 : }
128 :
129 : } // namespace bridge
130 : } // namespace ug
131 :
132 : #endif
133 :
134 : namespace ug{
135 : namespace bridge{
136 : /// \addtogroup precond_bridge
137 1 : void RegisterBridge_PILUT(Registry& reg, std::string grp)
138 : {
139 :
140 1 : }
141 :
142 : } // namespace bridge
143 : } // namespace ug
|