Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
argupta
openfpm_numerics
Commits
858741a6
Commit
858741a6
authored
Aug 20, 2017
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing documentation + coverity error
parent
4cbdaaa7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
14 deletions
+33
-14
src/Matrix/SparseMatrix_petsc.hpp
src/Matrix/SparseMatrix_petsc.hpp
+3
-1
src/Operators/Vector/vector_dist_operators_functions.hpp
src/Operators/Vector/vector_dist_operators_functions.hpp
+1
-1
src/Solvers/petsc_solver.hpp
src/Solvers/petsc_solver.hpp
+2
-1
src/Vector/Vector_eigen.hpp
src/Vector/Vector_eigen.hpp
+24
-9
src/Vector/Vector_petsc.hpp
src/Vector/Vector_petsc.hpp
+3
-2
No files found.
src/Matrix/SparseMatrix_petsc.hpp
View file @
858741a6
...
@@ -80,7 +80,9 @@ public:
...
@@ -80,7 +80,9 @@ public:
}
}
// Default constructor
// Default constructor
triplet
()
{};
triplet
()
:
row_
(
0
),
col_
(
0
),
val_
(
0
)
{};
};
};
/*! \brief Sparse Matrix implementation, that map over Eigen
/*! \brief Sparse Matrix implementation, that map over Eigen
...
...
src/Operators/Vector/vector_dist_operators_functions.hpp
View file @
858741a6
...
@@ -234,7 +234,7 @@ public:
...
@@ -234,7 +234,7 @@ public:
//! constructor from an epxression exp1 and a vector vd
//! constructor from an epxression exp1 and a vector vd
vector_dist_expression_op
(
const
exp1
&
o1
,
const
vector_type
&
vd
)
vector_dist_expression_op
(
const
exp1
&
o1
,
const
vector_type
&
vd
)
:
o1
(
o1
),
vd
(
vd
)
:
o1
(
o1
),
val
(
0
),
vd
(
vd
)
{}
{}
//! sum reduction require initialization where we calculate the reduction
//! sum reduction require initialization where we calculate the reduction
...
...
src/Solvers/petsc_solver.hpp
View file @
858741a6
...
@@ -777,6 +777,7 @@ class petsc_solver<double>
...
@@ -777,6 +777,7 @@ class petsc_solver<double>
solError
err
;
solError
err
;
err
.
err_norm
=
norm
/
col
;
err
.
err_norm
=
norm
/
col
;
err
.
err_inf
=
norm_inf
;
err
.
err_inf
=
norm_inf
;
err
.
its
=
0
;
return
err
;
return
err
;
}
}
...
@@ -792,7 +793,7 @@ public:
...
@@ -792,7 +793,7 @@ public:
}
}
petsc_solver
()
petsc_solver
()
:
maxits
(
300
)
:
maxits
(
300
)
,
tmp
(
0
)
{
{
initKSP
();
initKSP
();
...
...
src/Vector/Vector_eigen.hpp
View file @
858741a6
...
@@ -29,21 +29,29 @@
...
@@ -29,21 +29,29 @@
template
<
typename
T
>
template
<
typename
T
>
class
rval
<
T
,
EIGEN_RVAL
>
class
rval
<
T
,
EIGEN_RVAL
>
{
{
// row
//
!
row
long
int
r
;
long
int
r
;
// value
//
!
value
T
val
;
T
val
;
public:
public:
// Get the row
/*! \brief Return the row index
*
* \return a reference to the row index
*
*/
long
int
&
row
()
long
int
&
row
()
{
{
return
r
;
return
r
;
}
}
// Get the value
/*! \brief Return the value
*
* \return a reference to the row value
*
*/
T
&
value
()
T
&
value
()
{
{
return
val
;
return
val
;
...
@@ -52,7 +60,9 @@ public:
...
@@ -52,7 +60,9 @@ public:
/*! \brief Default constructor
/*! \brief Default constructor
*
*
*/
*/
rval
()
{}
rval
()
:
r
(
0
)
{}
/*! \brief Constructor from row, colum and value
/*! \brief Constructor from row, colum and value
*
*
...
@@ -70,19 +80,22 @@ public:
...
@@ -70,19 +80,22 @@ public:
template
<
typename
T
>
template
<
typename
T
>
class
Vector
<
T
,
EIGEN_BASE
>
class
Vector
<
T
,
EIGEN_BASE
>
{
{
//! Eigen vector
mutable
Eigen
::
Matrix
<
T
,
Eigen
::
Dynamic
,
1
>
v
;
mutable
Eigen
::
Matrix
<
T
,
Eigen
::
Dynamic
,
1
>
v
;
// row val
ue
vector
//
!
row val vector
mutable
openfpm
::
vector
<
rval
<
T
,
EIGEN_RVAL
>>
row_val
;
mutable
openfpm
::
vector
<
rval
<
T
,
EIGEN_RVAL
>>
row_val
;
//! row val vector received
mutable
openfpm
::
vector
<
rval
<
T
,
EIGEN_RVAL
>>
row_val_recv
;
mutable
openfpm
::
vector
<
rval
<
T
,
EIGEN_RVAL
>>
row_val_recv
;
// global to local map
//
!
global to local map
mutable
std
::
unordered_map
<
size_t
,
size_t
>
map
;
mutable
std
::
unordered_map
<
size_t
,
size_t
>
map
;
// invalid
//
!
invalid
T
invalid
;
T
invalid
;
// Processors from where we gather
//
!
Processors from where we gather
mutable
openfpm
::
vector
<
size_t
>
prc
;
mutable
openfpm
::
vector
<
size_t
>
prc
;
//size of each chunk
//size of each chunk
...
@@ -141,6 +154,7 @@ public:
...
@@ -141,6 +154,7 @@ public:
*
*
*/
*/
Vector
(
const
Vector
<
T
>
&
v
)
Vector
(
const
Vector
<
T
>
&
v
)
:
invalid
(
0
)
{
{
this
->
operator
=
(
v
);
this
->
operator
=
(
v
);
}
}
...
@@ -151,6 +165,7 @@ public:
...
@@ -151,6 +165,7 @@ public:
*
*
*/
*/
Vector
(
const
Vector
<
T
>
&&
v
)
Vector
(
const
Vector
<
T
>
&&
v
)
:
invalid
(
0
)
{
{
this
->
operator
=
(
v
);
this
->
operator
=
(
v
);
}
}
...
...
src/Vector/Vector_petsc.hpp
View file @
858741a6
...
@@ -152,6 +152,7 @@ public:
...
@@ -152,6 +152,7 @@ public:
*
*
*/
*/
Vector
(
Vector
<
T
,
PETSC_BASE
>
&&
v
)
Vector
(
Vector
<
T
,
PETSC_BASE
>
&&
v
)
:
n_row
(
0
),
n_row_local
(
0
),
invalid
(
0
)
{
{
this
->
operator
=
(
v
);
this
->
operator
=
(
v
);
}
}
...
@@ -173,7 +174,7 @@ public:
...
@@ -173,7 +174,7 @@ public:
*
*
*/
*/
Vector
(
size_t
n
,
size_t
n_row_local
)
Vector
(
size_t
n
,
size_t
n_row_local
)
:
n_row_local
(
n_row_local
)
:
n_row_local
(
n_row_local
)
,
invalid
(
0
),
v
(
NULL
)
{
{
// Create the vector
// Create the vector
PETSC_SAFE_CALL
(
VecCreate
(
PETSC_COMM_WORLD
,
&
v
));
PETSC_SAFE_CALL
(
VecCreate
(
PETSC_COMM_WORLD
,
&
v
));
...
@@ -185,7 +186,7 @@ public:
...
@@ -185,7 +186,7 @@ public:
*
*
*/
*/
Vector
()
Vector
()
:
n_row
(
0
),
n_row_local
(
0
)
:
n_row
(
0
),
n_row_local
(
0
)
,
invalid
(
0
)
{
{
// Create the vector
// Create the vector
PETSC_SAFE_CALL
(
VecCreate
(
PETSC_COMM_WORLD
,
&
v
));
PETSC_SAFE_CALL
(
VecCreate
(
PETSC_COMM_WORLD
,
&
v
));
...
...
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