deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
psblas_common.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2019 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_psblas_common_h
14#define dealii_psblas_common_h
15
16#include <deal.II/base/config.h>
17
20
21
22#ifdef DEAL_II_WITH_PSBLAS
23# include <psb_base_cbind.h>
24# include <psb_c_base.h>
25# include <psb_c_dbase.h>
26#endif
27
28
30
31#ifdef DEAL_II_WITH_PSBLAS
32namespace PSCToolkitWrappers
33{
34
35 namespace internal
36 {
37 /*
38 * Custom deleter for PSBLAS descriptor. This will be invoked automatically
39 * by the shared pointer.
40 */
41 struct DescriptorDeleter
42 {
43 void
44 operator()(psb_c_descriptor *p) const
45 {
46 if (p != nullptr)
47 psb_c_cdfree(p);
48 }
49 };
50
54 enum State
55 {
60 Default,
61
67 Build,
68
73 Assembled
74 };
75
76 } // namespace internal
77
82 DeclException1(ExcInitializePSBLASVector,
83 int,
84 << "An error with error number " << arg1
85 << " occurred while initializing a PSBLAS vector.");
86
90 DeclException1(ExcFreePSBLASVector,
91 int,
92 << "An error with error number " << arg1
93 << " occurred while freeing a PSBLAS vector.");
94
98 DeclException1(ExcInitializePSBLASDescriptor,
99 int,
100 << "An error with error number " << arg1
101 << " occurred while initializing a PSBLAS descriptor.");
102
107 DeclException1(ExcAssemblePSBLASVector,
108 int,
109 << "An error with error number " << arg1
110 << " occurred while assembling a PSBLAS vector.");
111
116 DeclException1(ExcAssemblePSBLASDescriptor,
117 int,
118 << "An error with error number " << arg1
119 << " occurred while assembling a PSBLAS descriptor.");
120
121
126 int,
127 << "Vector's state is invalid. It is in "
128 << (arg1 == 0 ? "Default" :
129 arg1 == 1 ? "Build" :
130 "Assembled")
131 << " state. Did you forget to call reinit() or compress()?");
132
139 DeclException1(ExcInvalidStateAssembled,
140 int,
141 << "Vector's state is invalid. It should be in "
142 << "Assembled state but it is in "
143 << (arg1 == 0 ? "Default" : "Build")
144 << " state. Did you forget to call compress()?");
145
152 ExcInvalidDefault,
153 "Vector's state is invalid. It should be in "
154 "Build or Assembled state but it is in Default state. Did you forget"
155 " to call reinit()?");
156
162 DeclException2(ExcCallingPSBLASFunction,
163 int,
164 std::string,
165 << "An error with error number " << arg1
166 << " occurred while calling a PSBLAS function: " << arg2
167 << std::endl);
168
173 DeclException1(ExcAXPBY,
174 int,
175 << "An error with error number " << arg1
176 << " occurred while performing the AXPBY operation.");
177
182 DeclException1(ExcInsertionInPSBLASVector,
183 int,
184 << "An error with error number " << arg1
185 << " occurred while inserting values into a PSBLAS vector.");
186
194 DeclException2(ExcWrongMode,
195 int,
196 int,
197 << "You tried to do a "
198 << (arg1 == 1 ? "'set'" : (arg1 == 2 ? "'add'" : "???"))
199 << " operation but the vector is currently in "
200 << (arg2 == 1 ? "'set'" : (arg2 == 2 ? "'add'" : "???"))
201 << " mode. You first have to call 'compress()'.");
202
208 ExcAccessToNonlocalElement,
209 int,
210 int,
211 int,
212 << "You tried to access element " << arg1
213 << " of a distributed vector, but only elements in range [" << arg2 << ','
214 << arg3 << "] are stored locally and can be accessed."
215 << "\n\n"
216 << "A common source for this kind of problem is that you "
217 << "are passing a 'fully distributed' vector into a function "
218 << "that needs read access to vector elements that correspond "
219 << "to degrees of freedom on ghost cells (or at least to "
220 << "'locally active' degrees of freedom that are not also "
221 << "'locally owned'). You need to pass a vector that has these "
222 << "elements as ghost entries.");
223
227 DeclException1(ExcAllocationPSBLASMatrix,
228 int,
229 << "An error with error number " << arg1
230 << " occurred while allocating a PSBLAS sparse matrix.");
231
237 DeclException1(ExcAssemblePSBLASMatrix,
238 int,
239 << "An error with error number " << arg1
240 << " occurred while assembling a PSBLAS sparse matrix.");
241
247 ExcInsertionInPSBLASMatrix,
248 int,
249 << "An error with error number " << arg1
250 << " occurred while inserting values into a PSBLAS sparse matrix.");
251
256 ExcMatVecPSBLAS,
257 int,
258 << "An error with error number " << arg1
259 << " occurred while performing a matrix-vector operation with a PSBLAS sparse matrix.");
260
266 DeclExceptionMsg(ExcSourceEqualsDestination,
267 "You are attempting an operation on two vectors that "
268 "are the same object, but the operation requires that the "
269 "two objects are in fact different.");
270
271
272} // namespace PSCToolkitWrappers
273
274#endif // DEAL_II_WITH_PSBLAS
275
277
278#endif
*  *  Point< dim > operator()(const Point< dim > &p) const * 
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DeclException2(Exception2, type1, type2, outsequence)
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcInvalidState()
#define DeclException1(Exception1, type1, outsequence)