Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iwr
amdis
Commits
cfc99b53
Commit
cfc99b53
authored
13 years ago
by
Thomas Witkowski
Browse files
Options
Downloads
Patches
Plain Diff
Work on integration of the BDDCML library.
parent
47507fab
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AMDiS/src/parallel/BddcMlSolver.cc
+166
-0
166 additions, 0 deletions
AMDiS/src/parallel/BddcMlSolver.cc
AMDiS/src/parallel/BddcMlSolver.h
+56
-0
56 additions, 0 deletions
AMDiS/src/parallel/BddcMlSolver.h
AMDiS/src/parallel/PetscProblemStat.cc
+7
-0
7 additions, 0 deletions
AMDiS/src/parallel/PetscProblemStat.cc
with
229 additions
and
0 deletions
AMDiS/src/parallel/BddcMlSolver.cc
0 → 100644
+
166
−
0
View file @
cfc99b53
//
// 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.
extern
"C"
{
#include
<bddcml_interface_c.h>
}
#include
"parallel/BddcMlSolver.h"
namespace
AMDiS
{
#ifdef HAVE_BDDC_ML
void
BddcMlSolver
::
fillPetscMatrix
(
Matrix
<
DOFMatrix
*>
*
mat
)
{
FUNCNAME
(
"BddcMlSolver::fillPetscMatrix()"
);
}
void
BddcMlSolver
::
fillPetscRhs
(
SystemVector
*
vec
)
{
FUNCNAME
(
"BddcMlSolver::fillPetscRhs()"
);
}
void
BddcMlSolver
::
solvePetscMatrix
(
SystemVector
&
vec
,
AdaptInfo
*
adaptInfo
)
{
FUNCNAME
(
"BddcMlSolver::solvePetscMatrix()"
);
int
nComponents
=
vec
.
getSize
();
const
FiniteElemS
ü
ace
*
feSpace
=
vec
.
getFeSpace
(
0
);
Mesh
*
mesh
=
feSpace
->
getMesh
();
// === First, create a continous leaf element index on each subdomain ===
std
::
set
<
int
>
leafElIndex
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_LEAF_EL
);
while
(
elInfo
)
{
leafElIndex
.
insert
(
elInfo
->
getElement
()
->
getIndex
());
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
map
<
int
,
int
>
mapElIndex
;
int
c
=
nLeafEls
;
for
(
std
::
set
<
int
>::
iterator
it
=
leafElIndex
.
begin
();
it
!=
leafElIndex
.
end
();
++
it
)
mapElIndex
[
*
it
]
=
nLeafEls
++
;
int
nLevel
=
1
;
int
nSubdomains
=
meshDistributor
->
getMpiSize
();
int
length
=
1
;
int
nSubPerProc
=
1
;
MPI_Fint
c2f
=
MPI_Comm_c2f
(
MPI
::
COMM_WORLD
);
int
verboseLevel
=
2
;
int
numbase
=
0
;
bddcml_init
(
&
nLevel
,
&
nSubdomains
,
&
length
,
&
nSubPerProc
,
&
c2f
,
&
verboseLevel
,
&
numbase
);
// global number of elements
int
nelem
=
mesh
->
getNumberOfLeaves
();
mpi
::
globalAdd
(
nelem
);
// global number of nodes
int
nnod
=
meshDistributor
->
getNumberOverallDofs
(
feSpace
);
// global number of dofs
int
ndof
=
nnod
*
nComponents
;
// space dimenstion
int
ndim
=
2
;
// mesh dimension
int
meshdim
=
2
;
// global indes of subdomain
int
isub
=
meshDistributor
->
getMpiRank
();
// local number of elements
int
nelems
=
nLeafEls
;
// local number of nodes
int
nnods
=
feSpace
->
getUsedSize
();
// local number of dofs
int
ndofs
=
nnods
*
nComponents
;
// Length of array inet
int
linet
=
nelems
*
3
;
// Local array with indices of nodes on each element
int
inet
[
linet
];
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_LEAF_EL
);
while
(
elInfo
)
{
int
localElIndex
=
mapElIndex
[
elInfo
->
getElement
()
->
getIndex
()];
for
(
int
i
=
0
;
i
<
3
;
i
++
)
inet
[
localElIndex
*
3
+
i
]
=
elInfo
->
getElement
()
->
getDof
(
i
,
0
);
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
// local array of number of nodes per element
int
nnet
[
nelems
];
for
(
int
i
=
0
;
i
<
nelems
;
i
++
)
nnet
[
i
]
=
3
;
// local array with number of DOFs per node.
int
nndf
[
nnod
];
for
(
int
i
=
0
;
i
<
nnod
;
i
++
)
nndf
[
i
]
=
nComponents
;
// array of indices of subdomain nodes in global numbering
int
isngn
[
nnod
];
for
(
int
i
=
0
;
i
<
nnod
;
i
++
)
nnod
[
i
]
=
meshDistributor
->
mapLocalToGlobal
(
feSpace
,
i
);
// array of indices of subdomain variables in global numbering
int
isvgvn
[
ndof
];
/*
bddcml_upload_subdomain_data(
&nelem,
&nnod,
&ndof,
&ndim,
&meshdim,
&isub,
&nelems,
&nnods,
&ndofs,
inet,
&linet,
nnet,
&nelems,
nndf,
&nnods,
isngn,
&nnods,
);
*/
bddcml_finalize
();
}
void
BddcMlSolver
::
destroyMatrixData
()
{
FUNCNAME
(
"BddcMlSolver::destroyMatrixData()"
);
}
#endif
}
This diff is collapsed.
Click to expand it.
AMDiS/src/parallel/BddcMlSolver.h
0 → 100644
+
56
−
0
View file @
cfc99b53
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================
//
// 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.
/** \file BddcMlSolver.h */
#ifndef AMDIS_BDDC_ML_SOLVER_H
#define AMDIS_BDDC_ML_SOLVER_H
#include
"AMDiS_fwd.h"
#include
"parallel/PetscSolver.h"
namespace
AMDiS
{
using
namespace
std
;
#ifdef HAVE_BDDC_ML
class
BddcMlSolver
:
public
PetscSolver
{
public:
BddcMlSolver
()
:
PetscSolver
()
{}
void
fillPetscMatrix
(
Matrix
<
DOFMatrix
*>
*
mat
);
void
fillPetscRhs
(
SystemVector
*
vec
);
void
solvePetscMatrix
(
SystemVector
&
vec
,
AdaptInfo
*
adaptInfo
);
void
destroyMatrixData
();
};
#endif
}
#endif
This diff is collapsed.
Click to expand it.
AMDiS/src/parallel/PetscProblemStat.cc
+
7
−
0
View file @
cfc99b53
...
...
@@ -17,6 +17,7 @@
#include
"parallel/PetscProblemStat.h"
#include
"parallel/PetscSolver.h"
#include
"parallel/MpiHelper.h"
#include
"parallel/BddcMlSolver.h"
namespace
AMDiS
{
...
...
@@ -41,6 +42,12 @@ namespace AMDiS {
petscSolver
=
new
PetscSolverGlobalBlockMatrix
();
}
else
if
(
name
==
"petsc"
||
name
==
""
)
{
petscSolver
=
new
PetscSolverGlobalMatrix
();
}
else
if
(
name
==
"bddcml"
)
{
#ifdef HAVE_BDDC_ML
petscSolver
=
new
BddcMlSolver
();
#else
ERROR_EXIT
(
"AMDiS was compiled without BDDC-ML support!
\n
"
);
#endif
}
else
{
ERROR_EXIT
(
"No parallel solver %s available!
\n
"
,
name
.
c_str
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment