Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
806b9b01
Commit
806b9b01
authored
Nov 14, 2013
by
Naumann, Andreas
Browse files
wrong matrix sizes and assembly
parent
7cb341b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/solver/MatrixStreams.h
View file @
806b9b01
...
...
@@ -159,7 +159,7 @@ namespace AMDiS {
for
(
size_t
k
=
0
;
k
<
static_cast
<
size_t
>
(
rhs
.
getSize
());
k
++
)
nnz
[
k
]
=
rhs
.
getBaseMatrix
().
nnz_local
(
k
);
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
rhs
.
getSize
(),
rhs
.
getSize
(
),
0
,
&
(
nnz
[
0
]),
&
mat
);
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
num_rows
(
rhs
.
getBaseMatrix
()),
num_cols
(
rhs
.
getBaseMatrix
()
),
0
,
&
(
nnz
[
0
]),
&
mat
);
initMatrix
=
true
;
}
...
...
@@ -168,7 +168,8 @@ namespace AMDiS {
indices
.
push_back
(
rhs
.
getBaseMatrix
().
ref_minor
()[
i
]);
for
(
PetscInt
i
=
0
;
i
<
static_cast
<
PetscInt
>
(
num_rows
(
rhs
.
getBaseMatrix
()));
i
++
)
{
MatSetValues
(
mat
,
1
,
&
i
,
rhs
.
getBaseMatrix
().
nnz_local
(
i
),
if
(
rhs
.
getBaseMatrix
().
nnz_local
(
i
)
>
0
)
MatSetValues
(
mat
,
1
,
&
i
,
rhs
.
getBaseMatrix
().
nnz_local
(
i
),
&
(
indices
[
rhs
.
getBaseMatrix
().
ref_major
()[
i
]]),
&
(
rhs
.
getBaseMatrix
().
value_from_offset
(
rhs
.
getBaseMatrix
().
ref_major
()[
i
])),
ADD_VALUES
);
}
...
...
@@ -239,7 +240,7 @@ namespace AMDiS {
/// fill PETSc vector from DOFVector
inline
void
operator
<<
(
Vec
&
petscVec
,
/* const */
SystemVector
&
vec
)
{
VecType
vecType
;
// TODO: type changed from petsc 3.2 to petsc 3.3
const
VecType
vecType
;
// TODO: type changed from petsc 3.2 to petsc 3.3
VecGetType
(
petscVec
,
&
vecType
);
if
(
strcmp
(
vecType
,
VECNEST
)
==
0
)
{
...
...
@@ -264,7 +265,7 @@ namespace AMDiS {
/// fill SystemVector from PETSc vector
inline
void
operator
>>
(
const
Vec
&
petscVec
,
SystemVector
&
vec
)
{
VecType
vecType
;
const
VecType
vecType
;
VecGetType
(
petscVec
,
&
vecType
);
if
(
strcmp
(
vecType
,
VECNEST
)
==
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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