v0.13.1
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 given order range (collective)
77 * \ingroup mofem_is_managers
78
79 * \param problem name
80 * \param rc ROW or COL
81 * \param min_order
82 * \param max_order
83 * \retval is out value
84
85 */
86 MoFEMErrorCode isCreateProblemOrder(const std::string problem_name,
87 RowColData rc, int min_order,
88 int max_order, IS *is) const;
89
90 /**
91 * @copydoc MoFEM::ISManager::isCreateProblemOrder
92 */
93 MoFEMErrorCode isCreateProblemOrder(const std::string problem_name,
94 RowColData rc, int min_order,
95 int max_order,
96 SmartPetscObj<IS> &is) const;
97
98 /**
99 * \brief create IS for given problem, field and rank range (collective)
100 * \ingroup mofem_is_managers
101
102 * \param problem name
103 * \param rc ROW or COL
104 * \param field name
105 * \param min_coeff_idx
106 * \param max_coeff_idx
107 * \param ents if not null get dofs only on given entities
108 * \retval is out value
109
110 */
111 MoFEMErrorCode isCreateProblemFieldAndRank(const std::string problem_name,
112 RowColData rc,
113 const std::string field,
114 int min_coeff_idx,
115 int max_coeff_idx, IS *is,
116 Range *ents = nullptr) const;
117
118 /**
119 * \copybrief create IS for given problem, field and rank range (collective)
120 * \ingroup mofem_is_managers
121 *
122 * \param problem name
123 * \param rc ROW or COL
124 * \param field name
125 * \param min_coeff_idx
126 * \param max_coeff_idx
127 * \param ents if not null get dofs only on given entities
128 * \retval is out value
129 */
131 isCreateProblemFieldAndRank(const std::string problem_name, RowColData rc,
132 const std::string field, int min_coeff_idx,
133 int max_coeff_idx, SmartPetscObj<IS> &smart_is,
134 Range *ents = nullptr) const;
135
136 /**
137 * @brief create IS for given problem, field and type range (collective)
138 * \ingroup mofem_is_managers
139 *
140 * @param problem
141 * @param rc
142 * @param field
143 * @param low_type
144 * @param hi_type
145 * @param min_coeff_idx
146 * @param max_coeff_idx
147 * @param is
148 * @param ents
149 * @return MoFEMErrorCode
150 */
152 const std::string problem_name, RowColData rc, const std::string field,
153 EntityType low_type, EntityType hi_type, int min_coeff_idx,
154 int max_coeff_idx, IS *is, Range *ents = nullptr) const;
155
156 /** \brief create IS for give two problems and field
157 * \ingroup mofem_is_managers
158
159 Note that indices are ordered in ascending order of local indices in
160 problem_y
161
162 \param x_problem name of problem
163 \param x_field_name name of field in problem_x
164 \param x_rc that is ROW or COL
165 \param y_problem name of problem
166 \param y_field_name name of field in problem_y
167 \param y_rc that is ROW or COL
168
169 \retval idx indexes in problem_x
170 \retval idy indexes in problem_y
171
172 */
174 const std::string x_problem, const std::string x_field_name,
175 RowColData x_rc, const std::string y_problem,
176 const std::string y_field_name, RowColData y_rc, std::vector<int> &idx,
177 std::vector<int> &idy) const;
178
179 /** \brief create IS for give two problems and field
180 * \ingroup mofem_is_managers
181
182 Indices are sorted by global PETSc index in problem_x.
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 ix IS indexes in problem_x (can be PETSC_NULL)
192 \retval iy IS 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, IS *ix, IS *iy) const;
199
200 /**
201 * @brief Create is from one problem to other problem
202 * @ingroup mofem_is_managers
203 *
204 * @param x_problem
205 * @param x_rc
206 * @param y_problem
207 * @param y_rc
208 * @param idx
209 * @param idy
210 * @return MoFEMErrorCode
211 */
213 const std::string x_problem, RowColData x_rc, const std::string y_problem,
214 RowColData y_rc, std::vector<int> &idx, std::vector<int> &idy) const;
215
216 /**
217 * @brief Create is from one problem to other problem
218 * @ingroup mofem_is_managers
219 *
220 * @param x_problem
221 * @param x_rc
222 * @param y_problem
223 * @param y_rc
224 * @param ix
225 * @param iy
226 * @return MoFEMErrorCode
227 */
228 MoFEMErrorCode isCreateFromProblemToOtherProblem(const std::string x_problem,
229 RowColData x_rc,
230 const std::string y_problem,
231 RowColData y_rc, IS *ix,
232 IS *iy) const;
233};
234
235} // namespace MoFEM
236
237/**
238 * \defgroup mofem_is_managers Index sets (IS)
239 * \brief Construct index sets for MoFEM problems
240 *
241 * \ingroup mofem
242 */
243
244#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:320
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:302
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:444
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:149
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:217
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 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