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
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Backofen, Rainer
amdis
Commits
d9e38a34
Commit
d9e38a34
authored
Nov 02, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some work done even today.
parent
c14d2129
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
164 additions
and
32 deletions
+164
-32
AMDiS/src/BoundaryObject.h
AMDiS/src/BoundaryObject.h
+1
-1
AMDiS/src/Debug.cc
AMDiS/src/Debug.cc
+4
-4
AMDiS/src/Mesh.cc
AMDiS/src/Mesh.cc
+2
-2
AMDiS/src/Mesh.h
AMDiS/src/Mesh.h
+4
-6
AMDiS/src/est/ResidualEstimator.cc
AMDiS/src/est/ResidualEstimator.cc
+1
-1
AMDiS/src/parallel/BddcMlSolver.cc
AMDiS/src/parallel/BddcMlSolver.cc
+1
-1
AMDiS/src/parallel/ElementObjectDatabase.h
AMDiS/src/parallel/ElementObjectDatabase.h
+18
-0
AMDiS/src/parallel/InteriorBoundary.cc
AMDiS/src/parallel/InteriorBoundary.cc
+18
-0
AMDiS/src/parallel/InteriorBoundary.h
AMDiS/src/parallel/InteriorBoundary.h
+2
-0
AMDiS/src/parallel/MeshDistributor.cc
AMDiS/src/parallel/MeshDistributor.cc
+1
-1
AMDiS/src/parallel/MeshDistributor.h
AMDiS/src/parallel/MeshDistributor.h
+1
-1
AMDiS/src/parallel/MeshPartitioner.cc
AMDiS/src/parallel/MeshPartitioner.cc
+0
-6
AMDiS/src/parallel/ParallelDebug.cc
AMDiS/src/parallel/ParallelDebug.cc
+3
-3
AMDiS/src/parallel/ParallelTypes.h
AMDiS/src/parallel/ParallelTypes.h
+0
-1
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+27
-5
AMDiS/src/parallel/PetscSolverFetiDebug.cc
AMDiS/src/parallel/PetscSolverFetiDebug.cc
+78
-0
AMDiS/src/parallel/PetscSolverFetiDebug.h
AMDiS/src/parallel/PetscSolverFetiDebug.h
+3
-0
No files found.
AMDiS/src/BoundaryObject.h
View file @
d9e38a34
...
...
@@ -50,7 +50,7 @@ namespace AMDiS {
BoundaryObject
&
obj1
,
const
FiniteElemSpace
*
feSpace
,
BoundaryType
boundary
);
bool
operator
==
(
const
BoundaryObject
&
other
)
const
;
bool
operator
!=
(
const
BoundaryObject
&
other
)
const
;
...
...
AMDiS/src/Debug.cc
View file @
d9e38a34
...
...
@@ -531,7 +531,7 @@ namespace AMDiS {
FUNCNAME
(
"debug::writeCoordsFile()"
);
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"tmp"
);
feSpace
->
getMesh
()
->
getDofIndexCoords
(
feSpace
,
coords
);
feSpace
->
getMesh
()
->
getDofIndexCoords
(
coords
);
std
::
ofstream
file
;
file
.
open
(
filename
.
c_str
());
...
...
@@ -647,7 +647,7 @@ namespace AMDiS {
void
importDofVectorByCoords
(
DOFVector
<
double
>*
vec
,
std
::
string
filename
)
{
DOFVector
<
WorldVector
<
double
>
>
coords
(
vec
->
getFeSpace
(),
"dofCoords"
);
vec
->
getFeSpace
()
->
getMesh
()
->
getDofIndexCoords
(
vec
->
getFeSpace
(),
coords
);
vec
->
getFeSpace
()
->
getMesh
()
->
getDofIndexCoords
(
coords
);
int
dim
=
vec
->
getFeSpace
()
->
getMesh
()
->
getDim
();
std
::
ifstream
file
;
...
...
@@ -690,7 +690,7 @@ namespace AMDiS {
std
::
string
filename
)
{
DOFVector
<
WorldVector
<
double
>
>
coords
(
vec
->
getFeSpace
(),
"dofCoords"
);
vec
->
getFeSpace
()
->
getMesh
()
->
getDofIndexCoords
(
vec
->
getFeSpace
(),
coords
);
vec
->
getFeSpace
()
->
getMesh
()
->
getDofIndexCoords
(
coords
);
int
dim
=
vec
->
getFeSpace
()
->
getMesh
()
->
getDim
();
std
::
ofstream
file
;
...
...
@@ -817,7 +817,7 @@ namespace AMDiS {
dofs0
.
size
(),
dofs1
.
size
());
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"dofCorrds"
);
feSpace
->
getMesh
()
->
getDofIndexCoords
(
feSpace
,
coords
);
feSpace
->
getMesh
()
->
getDofIndexCoords
(
coords
);
for
(
unsigned
int
i
=
0
;
i
<
dofs0
.
size
();
i
++
)
{
WorldVector
<
double
>
tmp
=
coords
[
*
(
dofs0
[
i
])];
...
...
AMDiS/src/Mesh.cc
View file @
d9e38a34
...
...
@@ -943,11 +943,11 @@ namespace AMDiS {
}
void
Mesh
::
getDofIndexCoords
(
const
FiniteElemSpace
*
feSpace
,
DOFVector
<
WorldVector
<
double
>
>&
coords
)
void
Mesh
::
getDofIndexCoords
(
DOFVector
<
WorldVector
<
double
>
>&
coords
)
{
FUNCNAME
(
"Mesh::getDofIndexCoords()"
);
const
FiniteElemSpace
*
feSpace
=
coords
.
getFeSpace
();
const
BasisFunction
*
basFcts
=
feSpace
->
getBasisFcts
();
int
nBasFcts
=
basFcts
->
getNumber
();
vector
<
DegreeOfFreedom
>
dofVec
(
nBasFcts
);
...
...
AMDiS/src/Mesh.h
View file @
d9e38a34
...
...
@@ -487,15 +487,13 @@ namespace AMDiS {
WorldVector
<
double
>&
coords
);
/** \brief
* Traverse the whole mesh and stores to each DOF
of the given finite
*
element space the coordinates in a given DOFVector. Works in the same
*
way as the function \ref getDofIndexCoords
defined above.
* Traverse the whole mesh and stores to each DOF
the coordinates in a given
*
DOFVector. Works in the same way as the function \ref getDofIndexCoords
* defined above.
*
* @param[in] feSpace The FE space to be used for the search.
* @param[out] coords DOF vector that stores the coordinates to each DOF.
*/
void
getDofIndexCoords
(
const
FiniteElemSpace
*
feSpace
,
DOFVector
<
WorldVector
<
double
>
>&
coords
);
void
getDofIndexCoords
(
DOFVector
<
WorldVector
<
double
>
>&
coords
);
/** \brief
* Traverse the mesh and get all DOFs in this mesh for a given FE space.
...
...
AMDiS/src/est/ResidualEstimator.cc
View file @
d9e38a34
...
...
@@ -169,7 +169,7 @@ namespace AMDiS {
return
;
DOFVector
<
WorldVector
<
double
>
>
coords
(
uh
[
0
]
->
getFeSpace
(),
"tmp"
);
mesh
->
getDofIndexCoords
(
uh
[
0
]
->
getFeSpace
(),
coords
);
mesh
->
getDofIndexCoords
(
coords
);
InteriorBoundary
&
intBoundary
=
MeshDistributor
::
globalMeshDistributor
->
getIntBoundary
();
...
...
AMDiS/src/parallel/BddcMlSolver.cc
View file @
d9e38a34
...
...
@@ -179,7 +179,7 @@ namespace AMDiS {
{
DOFVector
<
WorldVector
<
double
>
>
coordDofs
(
feSpace
,
"tmp"
);
mesh
->
getDofIndexCoords
(
feSpace
,
coordDofs
);
mesh
->
getDofIndexCoords
(
coordDofs
);
for
(
int
i
=
0
;
i
<
lxyz2
;
i
++
)
for
(
int
j
=
0
;
j
<
nnods
;
j
++
)
...
...
AMDiS/src/parallel/ElementObjectDatabase.h
View file @
d9e38a34
...
...
@@ -345,6 +345,24 @@ namespace AMDiS {
return
faceInRank
[
face
];
}
/// Get degree of a DOF, thus the number of ranks which contain it.
inline
int
getDegree
(
DegreeOfFreedom
dof
)
{
return
vertexInRank
[
dof
].
size
();
}
/// Get degree of an edge, thus the number of ranks which contain it.
inline
int
getDegree
(
DofEdge
edge
)
{
return
edgeInRank
[
edge
].
size
();
}
/// Get degree of a face, thus the number of ranks which contain it.
inline
int
getDegree
(
DofFace
face
)
{
return
faceInRank
[
face
].
size
();
}
/// Returns to an element object data the appropriate vertex DOF.
DegreeOfFreedom
getVertexLocalMap
(
ElementObjectData
&
data
)
{
...
...
AMDiS/src/parallel/InteriorBoundary.cc
View file @
d9e38a34
...
...
@@ -532,6 +532,24 @@ namespace AMDiS {
}
int
InteriorBoundary
::
getDegreeOwn
(
BoundaryObject
&
bObj
)
{
int
counter
=
0
;
for
(
RankToBoundMap
::
iterator
it
=
own
.
begin
();
it
!=
own
.
end
();
++
it
)
{
for
(
vector
<
AtomicBoundary
>::
iterator
bIt
=
it
->
second
.
begin
();
bIt
!=
it
->
second
.
end
();
++
bIt
)
{
if
(
bIt
->
rankObj
==
bObj
)
{
counter
++
;
break
;
}
}
}
return
counter
;
}
void
InteriorBoundary
::
serialize
(
ostream
&
out
)
{
serialize
(
out
,
own
);
...
...
AMDiS/src/parallel/InteriorBoundary.h
View file @
d9e38a34
...
...
@@ -79,6 +79,8 @@ namespace AMDiS {
return
static_cast
<
bool
>
(
periodic
.
size
());
}
int
getDegreeOwn
(
BoundaryObject
&
bObj
);
/// Writes this object to a file.
void
serialize
(
ostream
&
out
);
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
d9e38a34
...
...
@@ -238,7 +238,7 @@ namespace AMDiS {
#else
int
writePartMesh
=
0
;
#endif
Parameters
::
get
(
"
dbg->write part mesh
"
,
writePartMesh
);
Parameters
::
get
(
"
parallel->debug->write mesh partitioning
"
,
writePartMesh
);
if
(
writePartMesh
>
0
)
{
debug
::
writeElementIndexMesh
(
mesh
,
debugOutputDir
+
"elementIndex"
);
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
d9e38a34
...
...
@@ -309,7 +309,7 @@ namespace AMDiS {
int
level
,
DofContainer
&
dofs
);
const
ElementObjectDatabase
&
getElementObjectDb
()
ElementObjectDatabase
&
getElementObjectDb
()
{
return
elObjDb
;
}
...
...
AMDiS/src/parallel/MeshPartitioner.cc
View file @
d9e38a34
...
...
@@ -55,12 +55,6 @@ namespace AMDiS {
// rank number.
int
elInRank
=
std
::
min
(
elIndex
/
elPerRank
,
mpiSize
-
1
);
// int elInRank = 0;
// if (elIndex <= 11 || elIndex >= 28)
// elInRank = 0;
// else
// elInRank = 1;
elementInRank
[
elIndex
]
=
(
elInRank
==
mpiRank
);
partitionMap
[
elIndex
]
=
elInRank
;
}
else
{
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
d9e38a34
...
...
@@ -353,7 +353,7 @@ namespace AMDiS {
RankToCoords
recvCoords
;
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"dofCorrds"
);
pdb
.
mesh
->
getDofIndexCoords
(
feSpace
,
coords
);
pdb
.
mesh
->
getDofIndexCoords
(
coords
);
for
(
DofComm
::
Iterator
it
(
pdb
.
dofComm
.
getSendDofs
(),
feSpace
);
!
it
.
end
();
it
.
nextRank
())
...
...
@@ -474,7 +474,7 @@ namespace AMDiS {
const
FiniteElemSpace
*
feSpace
=
pdb
.
feSpaces
[
pdb
.
feSpaces
.
size
()
-
1
];
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"tmp"
);
pdb
.
mesh
->
getDofIndexCoords
(
feSpace
,
coords
);
pdb
.
mesh
->
getDofIndexCoords
(
coords
);
typedef
map
<
WorldVector
<
double
>
,
int
>
CoordsIndexMap
;
CoordsIndexMap
coordsToIndex
;
...
...
@@ -772,7 +772,7 @@ namespace AMDiS {
filename
<<
prefix
<<
"-"
<<
MPI
::
COMM_WORLD
.
Get_rank
()
<<
"."
<<
postfix
;
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"tmp"
);
mesh
->
getDofIndexCoords
(
feSpace
,
coords
);
mesh
->
getDofIndexCoords
(
coords
);
typedef
map
<
int
,
vector
<
DegreeOfFreedom
>
>
ElDofMap
;
ElDofMap
elDofMap
;
...
...
AMDiS/src/parallel/ParallelTypes.h
View file @
d9e38a34
...
...
@@ -73,7 +73,6 @@ namespace AMDiS {
int
local
,
global
;
};
// typedef std::map<DegreeOfFreedom, MultiIndex> DofMap;
typedef
boost
::
container
::
flat_map
<
DegreeOfFreedom
,
MultiIndex
>
DofMap
;
typedef
vector
<
MeshStructure
>
MeshCodeVec
;
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
d9e38a34
...
...
@@ -279,6 +279,12 @@ namespace AMDiS {
MSG
(
"FETI-DP timing 01: %.5f seconds (creation of basic data structures)
\n
"
,
timeCounter
);
}
bool
writePrimals
=
false
;
Parameters
::
get
(
"parallel->debug->write primals"
,
writePrimals
);
if
(
writePrimals
)
PetscSolverFetiDebug
::
writePrimalFiles
(
*
this
);
}
...
...
@@ -709,6 +715,9 @@ namespace AMDiS {
bool
PetscSolverFeti
::
testWirebasketEdge
(
BoundaryObject
&
edge
,
const
FiniteElemSpace
*
feSpace
)
{
if
(
meshDistributor
->
getIntBoundary
().
getDegreeOwn
(
edge
)
!=
3
)
return
false
;
Element
*
el
=
edge
.
el
;
int
i0
=
el
->
getVertexOfEdge
(
edge
.
ithObj
,
0
);
int
i1
=
el
->
getVertexOfEdge
(
edge
.
ithObj
,
1
);
...
...
@@ -732,6 +741,9 @@ namespace AMDiS {
if
(
!
augmentedLagrange
)
return
;
int
nEdges
=
0
;
int
nFaces
=
0
;
double
wtime
=
MPI
::
Wtime
();
nOverallEdges
=
0
;
...
...
@@ -755,8 +767,15 @@ namespace AMDiS {
}
}
if
(
!
dirichletOnlyEdge
)
if
(
!
dirichletOnlyEdge
)
{
if
(
it
->
rankObj
.
subObj
==
EDGE
)
nEdges
++
;
if
(
it
->
rankObj
.
subObj
==
FACE
)
nFaces
++
;
allEdges
.
insert
(
it
->
rankObj
);
}
}
}
...
...
@@ -765,6 +784,11 @@ namespace AMDiS {
mpi
::
getDofNumbering
(
mpiCommGlobal
,
nRankEdges
,
rStartEdges
,
nOverallEdges
);
MSG
(
"nRankEdges = %d, nOverallEdges = %d
\n
"
,
nRankEdges
,
nOverallEdges
);
mpi
::
globalAdd
(
nEdges
);
mpi
::
globalAdd
(
nFaces
);
MSG
(
"NEDGES = %d NFACES = %d
\n
"
,
nEdges
,
nFaces
);
nRankEdges
*=
componentSpaces
.
size
();
rStartEdges
*=
componentSpaces
.
size
();
...
...
@@ -884,7 +908,7 @@ namespace AMDiS {
createMatExplicitAugmentedSchurPrimal
();
// === Create KSP solver object and set appropriate solver options. ===
=
// === Create KSP solver object and set appropriate solver options. ===
KSPCreate
(
mpiCommGlobal
,
&
ksp_schur_primal
);
KSPSetOperators
(
ksp_schur_primal
,
mat_schur_primal
,
mat_schur_primal
,
...
...
@@ -1005,9 +1029,7 @@ namespace AMDiS {
// matTmp = inv(A_BB) trans(J) trans(Q)
Mat
qT
,
jTqT
;
MatTranspose
(
mat_augmented_lagrange
,
MAT_INITIAL_MATRIX
,
&
qT
);
// Mat jT;
// MatTranspose(mat_lagrange, MAT_INITIAL_MATRIX, &jT);
MatTranspose
(
mat_augmented_lagrange
,
MAT_INITIAL_MATRIX
,
&
qT
);
MatTransposeMatMult
(
mat_lagrange
,
qT
,
MAT_INITIAL_MATRIX
,
PETSC_DEFAULT
,
&
jTqT
);
petsc_helper
::
blockMatMatSolve
(
subdomain
->
getSolver
(),
jTqT
,
matTmp
);
...
...
AMDiS/src/parallel/PetscSolverFetiDebug.cc
View file @
d9e38a34
...
...
@@ -565,4 +565,82 @@ namespace AMDiS {
return
nZeroRows
;
}
void
PetscSolverFetiDebug
::
writePrimalFiles
(
PetscSolverFeti
&
feti
)
{
FUNCNAME
(
"PetscSolverFetiDebug::writePrimalFiles()"
);
Mesh
*
mesh
=
feti
.
componentSpaces
[
0
]
->
getMesh
();
DOFVector
<
WorldVector
<
double
>
>
coords
(
feti
.
componentSpaces
[
0
],
"coords"
);
mesh
->
getDofIndexCoords
(
coords
);
// === Write vertex primals. ===
{
StdMpi
<
vector
<
double
>
>
stdMpi
(
MPI
::
COMM_WORLD
);
vector
<
double
>
sendData
;
DofMap
&
primals
=
feti
.
primalDofMap
[
0
].
getMap
();
for
(
DofMap
::
iterator
it
=
primals
.
begin
();
it
!=
primals
.
end
();
++
it
)
{
if
(
feti
.
primalDofMap
[
0
].
isRankDof
(
it
->
first
))
{
for
(
int
i
=
0
;
i
<
mesh
->
getDim
();
i
++
)
sendData
.
push_back
(
coords
[
it
->
first
][
i
]);
}
}
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
{
for
(
int
i
=
1
;
i
<
MPI
::
COMM_WORLD
.
Get_size
();
i
++
)
stdMpi
.
recv
(
i
);
}
else
{
stdMpi
.
send
(
0
,
sendData
);
}
stdMpi
.
startCommunication
();
if
(
MPI
::
COMM_WORLD
.
Get_rank
()
==
0
)
{
vector
<
WorldVector
<
double
>
>
allPrimals
;
for
(
int
i
=
1
;
i
<
MPI
::
COMM_WORLD
.
Get_size
();
i
++
)
{
vector
<
double
>
&
recvData
=
stdMpi
.
getRecvData
(
i
);
TEST_EXIT
(
recvData
.
size
()
%
mesh
->
getDim
()
==
0
)
(
"Wrong number of coordinates received!
\n
"
);
int
nCoords
=
recvData
.
size
()
/
mesh
->
getDim
();
int
counter
=
0
;
for
(
int
j
=
0
;
j
<
nCoords
;
j
++
)
{
WorldVector
<
double
>
c
;
for
(
int
k
=
0
;
k
<
mesh
->
getDim
();
k
++
)
c
[
k
]
=
recvData
[
counter
++
];
allPrimals
.
push_back
(
c
);
}
}
ofstream
file
;
file
.
open
(
"primals.xyz"
);
file
<<
allPrimals
.
size
()
<<
"
\n
"
;
file
<<
"Primals
\n
"
;
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
allPrimals
.
size
());
i
++
)
{
file
<<
"P "
;
if
(
mesh
->
getDim
()
==
2
)
file
<<
allPrimals
[
i
][
0
]
<<
" "
<<
allPrimals
[
i
][
1
]
<<
" 0.0"
;
else
file
<<
allPrimals
[
i
][
0
]
<<
" "
<<
allPrimals
[
i
][
1
]
<<
" "
<<
allPrimals
[
i
][
2
];
file
<<
"
\n
"
;
}
file
.
close
();
}
}
// === Write face primals. ===
{
}
}
}
AMDiS/src/parallel/PetscSolverFetiDebug.h
View file @
d9e38a34
...
...
@@ -137,6 +137,9 @@ namespace AMDiS {
* \return int Number of zero rows in matrix;
*/
static
int
testZeroRows
(
Mat
mat
);
/// Write files with information about the primal coarner nodes.
static
void
writePrimalFiles
(
PetscSolverFeti
&
feti
);
};
}
...
...
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