version GIT relicensing-7336-ga5359f9c0a 2026-12-03 09:40:02+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
33{
34
35 namespace internal
36 {
37 /*
38 * Custom deleter for PSBLAS descriptor. This will be invoked automatically
39 * by the shared pointer.
40 */
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 {
61
68
74 };
75
76 } // namespace internal
77
83 int,
84 << "An error with error number " << arg1
85 << " occurred while initializing a PSBLAS vector.");
86
91 int,
92 << "An error with error number " << arg1
93 << " occurred while freeing a PSBLAS vector.");
94
99 int,
100 << "An error with error number " << arg1
101 << " occurred while initializing a PSBLAS descriptor.");
102
108 int,
109 << "An error with error number " << arg1
110 << " occurred while assembling a PSBLAS vector.");
111
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
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
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
163 int,
164 std::string,
165 << "An error with error number " << arg1
166 << " occurred while calling a PSBLAS function: " << arg2
167 << std::endl);
168
174 int,
175 << "An error with error number " << arg1
176 << " occurred while performing the AXPBY operation.");
177
183 int,
184 << "An error with error number " << arg1
185 << " occurred while inserting values into a PSBLAS vector.");
186
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
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
228 int,
229 << "An error with error number " << arg1
230 << " occurred while allocating a PSBLAS sparse matrix.");
231
238 int,
239 << "An error with error number " << arg1
240 << " occurred while assembling a PSBLAS sparse matrix.");
241
248 int,
249 << "An error with error number " << arg1
250 << " occurred while inserting values into a PSBLAS sparse matrix.");
251
257 int,
258 << "An error with error number " << arg1
259 << " occurred while performing a matrix-vector operation with a PSBLAS sparse matrix.");
260
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
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
static ::ExceptionBase & ExcCallingPSBLASFunction(int arg1, std::string arg2)
static ::ExceptionBase & ExcAssemblePSBLASDescriptor(int arg1)
static ::ExceptionBase & ExcInitializePSBLASVector(int arg1)
static ::ExceptionBase & ExcSourceEqualsDestination()
static ::ExceptionBase & ExcAssemblePSBLASVector(int arg1)
static ::ExceptionBase & ExcAssemblePSBLASMatrix(int arg1)
static ::ExceptionBase & ExcAXPBY(int arg1)
static ::ExceptionBase & ExcInsertionInPSBLASMatrix(int arg1)
static ::ExceptionBase & ExcInitializePSBLASDescriptor(int arg1)
static ::ExceptionBase & ExcWrongMode(int arg1, int arg2)
static ::ExceptionBase & ExcFreePSBLASVector(int arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcAllocationPSBLASMatrix(int arg1)
static ::ExceptionBase & ExcAccessToNonlocalElement(int arg1, int arg2, int arg3)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInvalidDefault()
static ::ExceptionBase & ExcMatVecPSBLAS(int arg1)
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcInvalidState()
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcInvalidStateAssembled(int arg1)
static ::ExceptionBase & ExcInsertionInPSBLASVector(int arg1)
void operator()(psb_c_descriptor *p) const