Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
2c3f1f47
Commit
2c3f1f47
authored
Jun 18, 2020
by
GILLES Sebastien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1531
FromVertexMatching: add a method to print what is required to rebuild an object.
parent
45be8c9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
Sources/OperatorInstances/NonConformInterpolator/FromVertexMatching/FromVertexMatching.cpp
...ormInterpolator/FromVertexMatching/FromVertexMatching.cpp
+27
-0
Sources/OperatorInstances/NonConformInterpolator/FromVertexMatching/FromVertexMatching.hpp
...ormInterpolator/FromVertexMatching/FromVertexMatching.hpp
+16
-1
No files found.
Sources/OperatorInstances/NonConformInterpolator/FromVertexMatching/FromVertexMatching.cpp
View file @
2c3f1f47
...
@@ -219,6 +219,33 @@ namespace MoReFEM
...
@@ -219,6 +219,33 @@ namespace MoReFEM
interpolation_matrix
.
Assembly
(
__FILE__
,
__LINE__
);
interpolation_matrix
.
Assembly
(
__FILE__
,
__LINE__
);
}
}
void
FromVertexMatching
::
Print
(
const
Wrappers
::
Mpi
&
mpi
,
const
FilesystemNS
::
Directory
&
directory
)
const
{
const
auto
matrix_file
=
directory
.
AddFile
(
"matrix.m"
);
GetInterpolationMatrix
().
View
(
mpi
,
matrix_file
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
if
(
matrix_pattern_
!=
nullptr
)
{
const
auto
matrix_pattern_file
=
directory
.
AddFile
(
"matrix_pattern.lua"
);
std
::
ofstream
out
;
FilesystemNS
::
File
::
Create
(
out
,
matrix_pattern_file
,
__FILE__
,
__LINE__
);
out
<<
"iCSR = "
;
Utilities
::
PrintContainer
<>::
Do
(
matrix_pattern_
->
GetICsr
(),
out
,
", "
,
"{"
,
"}"
);
out
<<
"
\n
jCSR = "
;
Utilities
::
PrintContainer
<>::
Do
(
matrix_pattern_
->
GetJCsr
(),
out
,
", "
,
"{"
,
"}"
);
}
}
}
// namespace NonConformInterpolatorNS
}
// namespace NonConformInterpolatorNS
...
...
Sources/OperatorInstances/NonConformInterpolator/FromVertexMatching/FromVertexMatching.hpp
View file @
2c3f1f47
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
# include <memory>
# include <memory>
# include <vector>
# include <vector>
# include "Utilities/Filesystem/Directory.hpp"
# include "Core/LinearAlgebra/GlobalMatrix.hpp"
# include "Core/LinearAlgebra/GlobalMatrix.hpp"
# include "Geometry/Interpolator/VertexMatching.hpp"
# include "Geometry/Interpolator/VertexMatching.hpp"
...
@@ -128,7 +130,7 @@ namespace MoReFEM
...
@@ -128,7 +130,7 @@ namespace MoReFEM
*
*
* \copydoc doxygen_hide_input_data_arg
* \copydoc doxygen_hide_input_data_arg
* \copydetails doxygen_hide_from_vertex_matching_constructor_arg
* \copydetails doxygen_hide_from_vertex_matching_constructor_arg
*/
*/
template
<
class
InputDataT
>
template
<
class
InputDataT
>
explicit
FromVertexMatching
(
const
InputDataT
&
input_data
,
explicit
FromVertexMatching
(
const
InputDataT
&
input_data
,
unsigned
int
source_index
,
unsigned
int
source_index
,
...
@@ -165,6 +167,19 @@ namespace MoReFEM
...
@@ -165,6 +167,19 @@ namespace MoReFEM
*/
*/
const
Wrappers
::
Petsc
::
MatrixPattern
&
GetMatrixPattern
()
const
noexcept
;
const
Wrappers
::
Petsc
::
MatrixPattern
&
GetMatrixPattern
()
const
noexcept
;
/*!
* \brief Write in the chosen directory the interpolation matrix and if relevant the matrix pattern.
*
* By convention:
* - The interpolation matrix is named "matrix.m"
* - The mattrix pattern is named "matrix_pattern.lua" (it is a Lua file which give the fields iCSR and jCSR.
*
* \param[in] directory Directory in which the file(s) will be created. It must exist and allows the creation of the files inside.
* \copydoc doxygen_hide_mpi_param
*/
void
Print
(
const
Wrappers
::
Mpi
&
mpi
,
const
FilesystemNS
::
Directory
&
directory
)
const
;
private:
private:
/*!
/*!
...
...
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