Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MoReFEM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
45
Issues
45
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
3d5f3eb0
Commit
3d5f3eb0
authored
Jun 22, 2020
by
GILLES Sebastien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1533
Add a Petsc wrapper around MatEqual.
parent
870915f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.cpp
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.cpp
+23
-0
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.hpp
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.hpp
+17
-0
No files found.
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.cpp
View file @
3d5f3eb0
...
...
@@ -666,6 +666,29 @@ namespace MoReFEM
mpi
.
Barrier
();
}
bool
AreStrictlyEqual
(
const
Matrix
&
lhs
,
const
Matrix
&
rhs
,
const
char
*
invoking_file
,
int
invoking_line
)
{
PetscBool
value
;
int
error_code
=
MatEqual
(
lhs
.
Internal
(),
rhs
.
Internal
(),
&
value
);
if
(
error_code
)
throw
ExceptionNS
::
Exception
(
error_code
,
"MatEqual"
,
invoking_file
,
invoking_line
);
switch
(
value
)
{
case
PETSC_TRUE
:
return
true
;
case
PETSC_FALSE
:
return
false
;
}
assert
(
false
);
exit
(
EXIT_FAILURE
);
}
}
// namespace Petsc
...
...
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.hpp
View file @
3d5f3eb0
...
...
@@ -621,6 +621,23 @@ namespace MoReFEM
void
Swap
(
Matrix
&
,
Matrix
&
);
/*!
* \brief Checks whether Petsc matrices are equal.
*
* This is a thin wrapper over PETSc's \a MatEqual, it probably won't work if there are rounding errors (see the namesake for PETSc vectors -
* I had to resort to something else than \a VecEqual for this reason).
*
* \copydoc doxygen_hide_lhs_rhs_arg
* \copydoc doxygen_hide_invoking_file_and_line
*
* \return True if lhs and rhs are identical (same pointer or bitwise equality).
*/
bool
AreStrictlyEqual
(
const
Matrix
&
lhs
,
const
Matrix
&
rhs
,
const
char
*
invoking_file
,
int
invoking_line
);
}
// namespace Petsc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment