v0.13.2
Loading...
Searching...
No Matches
ISManager.hpp
Go to the documentation of this file.
1/** \file ISManager.hpp
2 * \brief Interface managing IS
3 * \ingroup mofem_is_managers
4 *
5 * Managing problems, build and partitioning.
6 *
7 */
8
9#ifndef _ISMANAGER_HPP__
10#define _ISMANAGER_HPP__
11
12#include "UnknownInterface.hpp"
13
14namespace MoFEM {
15
16/**
17 * \brief Section manager is used to create indexes and sections
18 * \ingroup mofem_is_managers
19 *
20 * FIXME: ISManager is not properly testsed by atom tests.
21 *
22 */
23struct ISManager : public UnknownInterface {
24
25 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
26 UnknownInterface **iface) const;
27
29 bool dEbug;
30
31 ISManager(const MoFEM::Core &core);
32
33 /**
34 * \brief Destructor
35 */
36 virtual ~ISManager() = default;
37
38 /**
39 * \brief Create global selection
40 * \ingroup mofem_is_managers
41 *
42 * Create section for given problem, such that points are sorted by UId,
43 * and number of dofs on point is equal to number of dofs on entity
44 *
45 * It takes all fields
46 *
47 * @param problem_name
48 * @param fields_list
49 * @param s
50 * @param row_col ROE or COL, default is ROW
51 * @return error code
52 */
53 MoFEMErrorCode sectionCreate(const std::string problem_name, PetscSection *s,
54 const RowColData row_col = COL) const;
55
56 /**
57 * \brief Create global selection
58 * \ingroup mofem_is_managers
59 *
60 * Create section for given problem, such that points are sorted by UId,
61 * and number of dofs on point is equal to number of dofs on entity
62 *
63 * It takes all fields
64 *
65 * @param problem_name
66 * @param fields_list
67 * @param s
68 * @param row_col ROE or COL, default is ROW
69 * @return error code
70 */
72 sectionCreate(const std::string problem_name,
73 const RowColData row_col = COL) const;
74
75 /**
76 * @brief Create IS for problem
77 *
78 * @param problem_name
79 * @param rc
80 * @param is
81 * @return MoFEMErrorCode
82 */
83 MoFEMErrorCode isCreateProblem(const std::string problem_name, RowColData rc,
84 IS *is) const;
85
86 /**
87 * @brief Create IS for problem
88 *
89 * @param problem_name
90 * @param rc
91 * @param is
92 * @return MoFEMErrorCode
93 */
94 MoFEMErrorCode isCreateProblem(const std::string problem_name, RowColData rc,
95 SmartPetscObj<IS> &is) const;
96
97 /**
98 * \brief create IS for given order range (collective)
99 * \ingroup mofem_is_managers
100
101 * \param problem name
102 * \param rc ROW or COL
103 * \param min_order
104 * \param max_order
105 * \retval is out value
106
107 */
108 MoFEMErrorCode isCreateProblemOrder(const std::string problem_name,
109 RowColData rc, int min_order,
110 int max_order, IS *is) const;
111
112 /**
113 * @copydoc MoFEM::ISManager::isCreateProblemOrder
114 */
115 MoFEMErrorCode isCreateProblemOrder(const std::string problem_name,
116 RowColData rc, int min_order,
117 int max_order,
118 SmartPetscObj<IS> &is) const;
119
120 /**
121 * \brief create IS for given problem, field and rank range (collective)
122 * \ingroup mofem_is_managers
123
124 * \param problem name
125 * \param rc ROW or COL
126 * \param field name
127 * \param min_coeff_idx
128 * \param max_coeff_idx
129 * \param ents if not null get dofs only on given entities
130 * \retval is out value
131
132 */
133 MoFEMErrorCode isCreateProblemFieldAndRank(const std::string problem_name,
134 RowColData rc,
135 const std::string field,
136 int min_coeff_idx,
137 int max_coeff_idx, IS *is,
138 Range *ents = nullptr) const;
139
140 /**
141 * \copybrief create IS for given problem, field and rank range (collective)
142 * \ingroup mofem_is_managers
143 *
144 * \param problem name
145 * \param rc ROW or COL
146 * \param field name
147 * \param min_coeff_idx
148 * \param max_coeff_idx
149 * \param ents if not null get dofs only on given entities
150 * \retval is out value
151 */
153 isCreateProblemFieldAndRank(const std::string problem_name, RowColData rc,
154 const std::string field, int min_coeff_idx,
155 int max_coeff_idx, SmartPetscObj<IS> &smart_is,
156 Range *ents = nullptr) const;
157
158 /**
159 * @brief create IS for given problem, field and type range (collective)
160 * \ingroup mofem_is_managers
161 *
162 * @param problem
163 * @param rc
164 * @param field
165 * @param low_type
166 * @param hi_type
167 * @param min_coeff_idx
168 * @param max_coeff_idx
169 * @param is
170 * @param ents
171 * @return MoFEMErrorCode
172 */
174 const std::string problem_name, RowColData rc, const std::string field,
175 EntityType low_type, EntityType hi_type, int min_coeff_idx,
176 int max_coeff_idx, IS *is, Range *ents = nullptr) const;
177
178 /** \brief create IS for give two problems and field
179 * \ingroup mofem_is_managers
180
181 Note that indices are ordered in ascending order of local indices in
182 problem_y
183
184 \param x_problem name of problem
185 \param x_field_name name of field in problem_x
186 \param x_rc that is ROW or COL
187 \param y_problem name of problem
188 \param y_field_name name of field in problem_y
189 \param y_rc that is ROW or COL
190
191 \retval idx indexes in problem_x
192 \retval idy indexes in problem_y
193
194 */
196 const std::string x_problem, const std::string x_field_name,
197 RowColData x_rc, const std::string y_problem,
198 const std::string y_field_name, RowColData y_rc, std::vector<int> &idx,
199 std::vector<int> &idy) const;
200
201 /** \brief create IS for give two problems and field
202 * \ingroup mofem_is_managers
203
204 Indices are sorted by global PETSc index in problem_x.
205
206 \param x_problem name of problem
207 \param x_field_name name of field in problem_x
208 \param x_rc that is ROW or COL
209 \param y_problem name of problem
210 \param y_field_name name of field in problem_y
211 \param y_rc that is ROW or COL
212
213 \retval ix IS indexes in problem_x (can be PETSC_NULL)
214 \retval iy IS indexes in problem_y
215
216 */
218 const std::string x_problem, const std::string x_field_name,
219 RowColData x_rc, const std::string y_problem,
220 const std::string y_field_name, RowColData y_rc, IS *ix, IS *iy) const;
221
222 /**
223 * @brief Create is from one problem to other problem
224 * @ingroup mofem_is_managers
225 *
226 * @param x_problem
227 * @param x_rc
228 * @param y_problem
229 * @param y_rc
230 * @param idx
231 * @param idy
232 * @return MoFEMErrorCode
233 */
235 const std::string x_problem, RowColData x_rc, const std::string y_problem,
236 RowColData y_rc, std::vector<int> &idx, std::vector<int> &idy) const;
237
238 /**
239 * @brief Create is from one problem to other problem
240 * @ingroup mofem_is_managers
241 *
242 * @param x_problem
243 * @param x_rc
244 * @param y_problem
245 * @param y_rc
246 * @param ix
247 * @param iy
248 * @return MoFEMErrorCode
249 */
250 MoFEMErrorCode isCreateFromProblemToOtherProblem(const std::string x_problem,
251 RowColData x_rc,
252 const std::string y_problem,
253 RowColData y_rc, IS *ix,
254 IS *iy) const;
255};
256
257} // namespace MoFEM
258
259/**
260 * \defgroup mofem_is_managers Index sets (IS)
261 * \brief Construct index sets for MoFEM problems
262 *
263 * \ingroup mofem
264 */
265
266#endif // _ISMANAGER_HPP__
MoFEM interface.
RowColData
RowColData.
Definition: definitions.h:123
@ COL
Definition: definitions.h:123
MoFEMErrorCode isCreateFromProblemFieldToOtherProblemField(const std::string x_problem, const std::string x_field_name, RowColData x_rc, const std::string y_problem, const std::string y_field_name, RowColData y_rc, std::vector< int > &idx, std::vector< int > &idy) const
create IS for give two problems and field
Definition: ISManager.cpp:368
MoFEMErrorCode sectionCreate(const std::string problem_name, PetscSection *s, const RowColData row_col=COL) const
Create global selection.
Definition: ISManager.cpp:20
MoFEMErrorCode isCreateProblemFieldAndEntityType(const std::string problem_name, RowColData rc, const std::string field, EntityType low_type, EntityType hi_type, int min_coeff_idx, int max_coeff_idx, IS *is, Range *ents=nullptr) const
create IS for given problem, field and type range (collective)
Definition: ISManager.cpp:350
MoFEMErrorCode isCreateFromProblemToOtherProblem(const std::string x_problem, RowColData x_rc, const std::string y_problem, RowColData y_rc, std::vector< int > &idx, std::vector< int > &idy) const
Create is from one problem to other problem.
Definition: ISManager.cpp:492
MoFEMErrorCode isCreateProblemOrder(const std::string problem_name, RowColData rc, int min_order, int max_order, IS *is) const
create IS for given order range (collective)
Definition: ISManager.cpp:197
MoFEMErrorCode isCreateProblemFieldAndRank(const std::string problem_name, RowColData rc, const std::string field, int min_coeff_idx, int max_coeff_idx, IS *is, Range *ents=nullptr) const
create IS for given problem, field and rank range (collective)
Definition: ISManager.cpp:265
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
Core (interface) class.
Definition: Core.hpp:82
Deprecated interface functions.
Section manager is used to create indexes and sections.
Definition: ISManager.hpp:23
MoFEMErrorCode isCreateProblem(const std::string problem_name, RowColData rc, IS *is) const
Create IS for problem.
Definition: ISManager.cpp:149
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: ISManager.cpp:10
const MoFEM::Interface & cOre
Definition: ISManager.hpp:28
virtual ~ISManager()=default
Destructor.
intrusive_ptr for managing petsc objects
base class for all interface classes