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
Backofen, Rainer
amdis
Commits
42237fb0
Commit
42237fb0
authored
Aug 21, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some bugs.
parent
83c8b38d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
37 deletions
+56
-37
AMDiS/CMakeLists.txt
AMDiS/CMakeLists.txt
+1
-0
AMDiS/src/MatrixVector.cc
AMDiS/src/MatrixVector.cc
+38
-0
AMDiS/src/MatrixVector.h
AMDiS/src/MatrixVector.h
+4
-0
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
+8
-6
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.h
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.h
+1
-0
AMDiS/src/parallel/PetscSolver.cc
AMDiS/src/parallel/PetscSolver.cc
+0
-24
AMDiS/src/parallel/PetscSolver.h
AMDiS/src/parallel/PetscSolver.h
+0
-4
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+2
-1
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
+2
-2
No files found.
AMDiS/CMakeLists.txt
View file @
42237fb0
...
...
@@ -104,6 +104,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/Line.cc
${
SOURCE_DIR
}
/MacroElement.cc
${
SOURCE_DIR
}
/Marker.cc
${
SOURCE_DIR
}
/MatrixVector.cc
${
SOURCE_DIR
}
/Mesh.cc
${
SOURCE_DIR
}
/MeshStructure.cc
${
SOURCE_DIR
}
/Operator.cc
...
...
AMDiS/src/MatrixVector.cc
0 → 100644
View file @
42237fb0
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
#include "MatrixVector.h"
#include "FiniteElemSpace.h"
#include "DOFMatrix.h"
namespace
AMDiS
{
vector
<
const
FiniteElemSpace
*>
getFeSpaces
(
Matrix
<
DOFMatrix
*>
&
mat
)
{
FUNCNAME
(
"getFeSpaces()"
);
int
nComponents
=
mat
.
getNumRows
();
vector
<
const
FiniteElemSpace
*>
result
(
nComponents
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
if
(
mat
[
i
][
j
])
{
result
[
i
]
=
mat
[
i
][
j
]
->
getRowFeSpace
();
break
;
}
}
}
return
result
;
}
}
AMDiS/src/MatrixVector.h
View file @
42237fb0
...
...
@@ -518,6 +518,10 @@ namespace AMDiS {
z
[
2
]
=
x
[
0
]
*
y
[
1
]
-
x
[
1
]
*
y
[
0
];
}
/// Returns a vector with the FE spaces of each row in the matrix. Thus, the
/// resulting vector may contain the same FE space multiple times.
vector
<
const
FiniteElemSpace
*>
getFeSpaces
(
Matrix
<
DOFMatrix
*>
&
mat
);
}
#endif // AMDIS_MATRIXVECTOR_H
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
View file @
42237fb0
...
...
@@ -89,7 +89,7 @@ namespace AMDiS {
int
nMat
=
uniqueCoarseMap
.
size
()
+
1
;
nnz
.
resize
(
nMat
);
for
(
int
i
=
0
;
i
<
nMat
;
i
++
)
{
nnz
.
resize
(
nMat
);
nnz
[
i
]
.
resize
(
nMat
);
for
(
int
j
=
0
;
j
<
nMat
;
j
++
)
nnz
[
i
][
j
].
clear
();
}
...
...
@@ -105,13 +105,15 @@ namespace AMDiS {
continue
;
if
(
i
==
j
)
{
nnz
[
i
][
j
].
create
(
seqMat
,
mpiCommGlobal
,
coarseSpaceMap
,
NULL
,
nnz
[
i
][
j
].
create
(
seqMat
,
mpiCommGlobal
,
*
(
coarseSpaceMap
[
i
-
1
])
,
NULL
,
meshDistributor
->
getElementObjectDb
());
}
else
{
ParallelDofMapping
*
rowMap
=
NULL
;
ParallelDofMapping
*
colMap
=
NULL
;
nnz
[
i
][
j
].
create
(
seqMat
,
mpiCommGlobal
,
*
rowMap
,
*
colMap
,
NULL
,
ParallelDofMapping
&
rowMap
=
(
i
==
0
?
*
interiorMap
:
*
(
coarseSpaceMap
[
i
-
1
]));
ParallelDofMapping
&
colMap
=
(
j
==
0
?
*
interiorMap
:
*
(
coarseSpaceMap
[
j
-
1
]));
nnz
[
i
][
j
].
create
(
seqMat
,
mpiCommGlobal
,
rowMap
,
colMap
,
NULL
,
meshDistributor
->
getElementObjectDb
());
/*
...
...
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.h
View file @
42237fb0
...
...
@@ -27,6 +27,7 @@
#include <map>
#include <petsc.h>
#include "AMDiS_fwd.h"
#include "parallel/MatrixNnzStructure.h"
namespace
AMDiS
{
...
...
AMDiS/src/parallel/PetscSolver.cc
View file @
42237fb0
...
...
@@ -135,30 +135,6 @@ namespace AMDiS {
}
vector
<
const
FiniteElemSpace
*>
PetscSolver
::
getFeSpaces
(
Matrix
<
DOFMatrix
*>
*
mat
)
{
FUNCNAME
(
"PetscSolver::getFeSpaces()"
);
int
nComponents
=
mat
->
getNumRows
();
vector
<
const
FiniteElemSpace
*>
result
(
nComponents
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
if
((
*
mat
)[
i
][
j
])
{
result
[
i
]
=
(
*
mat
)[
i
][
j
]
->
getRowFeSpace
();
break
;
}
#if (DEBUG != 0)
// === In debug mode, we test if all FE spaces of the matrix are also ===
// === considered by the mesh distributor. ===
checkFeSpaces
(
result
);
#endif
return
result
;
}
vector
<
const
FiniteElemSpace
*>
PetscSolver
::
getFeSpaces
(
SystemVector
*
vec
)
{
FUNCNAME
(
"PetscSolver::getFeSpaces()"
);
...
...
AMDiS/src/parallel/PetscSolver.h
View file @
42237fb0
...
...
@@ -229,10 +229,6 @@ namespace AMDiS {
/// Checks if all given FE spaces are handled by the mesh distributor.
void
checkFeSpaces
(
vector
<
const
FiniteElemSpace
*>&
feSpaces
);
/// Returns a vector with the FE spaces of each row in the matrix. Thus, the
/// resulting vector may contain the same FE space multiple times.
vector
<
const
FiniteElemSpace
*>
getFeSpaces
(
Matrix
<
DOFMatrix
*>
*
mat
);
/// Returns a vector with the FE spaces of all components of a system vector.
vector
<
const
FiniteElemSpace
*>
getFeSpaces
(
SystemVector
*
vec
);
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
42237fb0
...
...
@@ -11,6 +11,7 @@
#include "AMDiS.h"
#include "MatrixVector.h"
#include "parallel/PetscSolverFeti.h"
#include "parallel/PetscSolverFetiStructs.h"
#include "parallel/StdMpi.h"
...
...
@@ -1351,7 +1352,7 @@ namespace AMDiS {
// === Create all sets and indices. ===
vector
<
const
FiniteElemSpace
*>
feSpaces
=
getFeSpaces
(
mat
);
vector
<
const
FiniteElemSpace
*>
feSpaces
=
AMDiS
::
getFeSpaces
(
*
mat
);
initialize
(
feSpaces
);
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
42237fb0
...
...
@@ -24,7 +24,7 @@ namespace AMDiS {
petscData
.
init
(
interiorMap
,
coarseSpaceMap
,
subdomainLevel
,
mpiCommLocal
,
mpiCommGlobal
,
meshDistributor
);
petscData
.
create
();
petscData
.
create
(
*
seqMat
);
if
(
coarseSpaceMap
.
size
())
{
updateSubdomainData
();
...
...
@@ -130,7 +130,7 @@ namespace AMDiS {
TEST_EXIT_DBG
(
coarseSpaceMap
.
size
()
==
seqMat
->
getSize
())
(
"Wrong sizes %d %d
\n
"
,
coarseSpaceMap
.
size
(),
seqMat
->
getSize
());
vector
<
const
FiniteElemSpace
*>
feSpaces
=
getFeSpaces
(
seqMat
);
vector
<
const
FiniteElemSpace
*>
feSpaces
=
AMDiS
::
getFeSpaces
(
*
seqMat
);
int
nRowsRankInterior
=
interiorMap
->
getRankDofs
();
int
nRowsOverallInterior
=
interiorMap
->
getOverallDofs
();
...
...
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