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
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
Backofen, Rainer
amdis
Commits
d5d0ec5a
Commit
d5d0ec5a
authored
15 years ago
by
Thomas Witkowski
Browse files
Options
Downloads
Patches
Plain Diff
Work in progress on parallel domain decomposition.
parent
be06847b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AMDiS/src/DOFAdmin.h
+32
-16
32 additions, 16 deletions
AMDiS/src/DOFAdmin.h
AMDiS/src/DOFIterator.h
+63
-23
63 additions, 23 deletions
AMDiS/src/DOFIterator.h
AMDiS/src/ParallelDomainProblem.cc
+3
-5
3 additions, 5 deletions
AMDiS/src/ParallelDomainProblem.cc
with
98 additions
and
44 deletions
AMDiS/src/DOFAdmin.h
+
32
−
16
View file @
d5d0ec5a
...
...
@@ -75,7 +75,8 @@ namespace AMDiS {
bool
operator
==
(
const
DOFAdmin
&
)
const
;
/// Compares two DOFAdmins by their names.
inline
bool
operator
!=
(
const
DOFAdmin
&
ad
)
const
{
inline
bool
operator
!=
(
const
DOFAdmin
&
ad
)
const
{
return
!
(
ad
==*
this
);
}
...
...
@@ -104,12 +105,14 @@ namespace AMDiS {
void
compress
(
std
::
vector
<
DegreeOfFreedom
>
&
new_dof
);
/// Returns an iterator to the begin of \ref dofIndexedList
std
::
list
<
DOFIndexedBase
*>::
iterator
beginDOFIndexed
()
{
std
::
list
<
DOFIndexedBase
*>::
iterator
beginDOFIndexed
()
{
return
dofIndexedList
.
begin
();
}
/// Returns an iterator to the end of \ref dofIndexedList
std
::
list
<
DOFIndexedBase
*>::
iterator
endDOFIndexed
()
{
std
::
list
<
DOFIndexedBase
*>::
iterator
endDOFIndexed
()
{
return
dofIndexedList
.
end
();
}
...
...
@@ -118,47 +121,56 @@ namespace AMDiS {
*/
/// Returns \ref sizeUsed.
inline
const
int
getUsedSize
()
const
{
inline
const
int
getUsedSize
()
const
{
return
sizeUsed
;
}
/// Returns \ref size
inline
const
int
getSize
()
const
{
inline
const
int
getSize
()
const
{
return
size
;
}
/// Returns \ref usedCount
inline
const
int
getUsedDOFs
()
const
{
inline
const
int
getUsedDOFs
()
const
{
return
usedCount
;
}
/// Returns \ref holeCount
inline
const
int
getHoleCount
()
const
{
inline
const
int
getHoleCount
()
const
{
return
holeCount
;
}
/// Returns \ref name
inline
const
std
::
string
&
getName
()
const
{
inline
const
std
::
string
&
getName
()
const
{
return
name
;
}
/// Returns \ref nrDOF[i], i.e., the number of dofs for the position i.
inline
const
int
getNumberOfDOFs
(
int
i
)
const
{
inline
const
int
getNumberOfDOFs
(
int
i
)
const
{
return
nrDOF
[
i
];
}
/// Returns \ref nrDOF
inline
const
DimVec
<
int
>&
getNumberOfDOFs
()
const
{
inline
const
DimVec
<
int
>&
getNumberOfDOFs
()
const
{
return
nrDOF
;
}
/// Returns \ref nr0DOF[i]
inline
const
int
getNumberOfPreDOFs
(
int
i
)
const
{
inline
const
int
getNumberOfPreDOFs
(
int
i
)
const
{
return
nr0DOF
[
i
];
}
/// Returns \ref nr0DOF
inline
const
DimVec
<
int
>&
getNumberOfPreDOFs
()
const
{
inline
const
DimVec
<
int
>&
getNumberOfPreDOFs
()
const
{
return
nr0DOF
;
}
...
...
@@ -168,12 +180,14 @@ namespace AMDiS {
}
/// Returns \ref dofFree, the array denoting DOFs to be either free or used.
inline
const
std
::
vector
<
bool
>&
getDOFFree
()
const
{
inline
const
std
::
vector
<
bool
>&
getDOFFree
()
const
{
return
dofFree
;
}
/// Returns if the given DOF is free.
inline
const
bool
isDOFFree
(
int
i
)
const
{
inline
const
bool
isDOFFree
(
int
i
)
const
{
return
dofFree
[
i
];
}
...
...
@@ -190,12 +204,14 @@ namespace AMDiS {
void
setNumberOfPreDOFs
(
int
i
,
int
v
);
/// Sets \ref name = n
inline
void
setName
(
const
std
::
string
&
n
)
{
inline
void
setName
(
const
std
::
string
&
n
)
{
name
=
n
;
}
/// Sets \ref mesh = m
inline
void
setMesh
(
Mesh
*
m
)
{
inline
void
setMesh
(
Mesh
*
m
)
{
mesh
=
m
;
}
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/DOFIterator.h
+
63
−
23
View file @
d5d0ec5a
...
...
@@ -69,7 +69,8 @@ namespace AMDiS {
* Sub classes must
* implement goToBeginOfIteratedObject() which resets the iterator.
*/
virtual
void
reset
()
{
virtual
void
reset
()
{
position
=
0
;
dofFreeIterator
=
dofFree
->
begin
();
if
(
dofFreeIterator
==
dofFree
->
end
())
...
...
@@ -86,15 +87,16 @@ namespace AMDiS {
* Sub classes must
* implement goToBeginOfIteratedObject() which resets the iterator.
*/
virtual
void
reset2
()
{
virtual
void
reset2
()
{
position
=
0
;
dofFreeIterator
=
dofFree
->
begin
();
if
(
dofFreeIterator
==
dofFree
->
end
())
{
if
(
dofFreeIterator
==
dofFree
->
end
())
{
return
;
}
goToBeginOfIteratedObject
();
if
(
type
!=
ALL_DOFS
)
{
if
(
*
dofFreeIterator
==
(
type
==
USED_DOFS
))
if
(
type
!=
ALL_DOFS
)
{
if
(
*
dofFreeIterator
==
(
type
==
USED_DOFS
))
operator
++
();
}
}
...
...
@@ -108,7 +110,8 @@ namespace AMDiS {
* must implement incObjectIterator() which increments the object
* iterator.
*/
inline
const
DOFIteratorBase
&
operator
++
()
{
inline
const
DOFIteratorBase
&
operator
++
()
{
if
(
type
==
ALL_DOFS
)
{
incObjectIterator
();
dofFreeIterator
++
;
...
...
@@ -136,13 +139,15 @@ namespace AMDiS {
}
/// Postfix operator++.
inline
DOFIteratorBase
operator
++
(
int
)
{
inline
DOFIteratorBase
operator
++
(
int
)
{
DOFIteratorBase
clone
=
*
this
;
operator
++
();
return
clone
;
}
inline
const
DOFIteratorBase
&
operator
--
()
{
inline
const
DOFIteratorBase
&
operator
--
()
{
if
(
type
==
ALL_DOFS
)
{
decObjectIterator
();
dofFreeIterator
--
;
...
...
@@ -160,14 +165,16 @@ namespace AMDiS {
return
*
this
;
}
inline
DOFIteratorBase
operator
--
(
int
)
{
inline
DOFIteratorBase
operator
--
(
int
)
{
DOFIteratorBase
clone
=
*
this
;
operator
--
();
return
clone
;
}
/// Dereferntiation of the \ref dofFreeIterator
virtual
bool
isDOFFree
()
{
virtual
bool
isDOFFree
()
{
return
*
dofFreeIterator
;
}
...
...
@@ -175,12 +182,21 @@ namespace AMDiS {
* Returns whether \ref dofFreeIterator already has reached the end of
* \ref dofFree
*/
inline
bool
end
()
{
return
(
dofFreeIterator
==
dofFree
->
end
());
}
inline
bool
end
()
{
return
(
dofFreeIterator
==
dofFree
->
end
());
}
inline
bool
begin
()
{
return
(
dofFreeIterator
==
dofFree
->
begin
());
}
inline
bool
begin
()
{
return
(
dofFreeIterator
==
dofFree
->
begin
());
}
/// Returns the current position index of this iterator
inline
int
getDOFIndex
()
{
return
position
;
}
inline
int
getDOFIndex
()
{
return
position
;
}
protected
:
/// Override this to enable iteration through the object
...
...
@@ -237,33 +253,57 @@ namespace AMDiS {
{}
/// Dereference operator
inline
T
&
operator
*
()
{
return
*
it
;
}
inline
T
&
operator
*
()
{
return
*
it
;
}
/// Dereference operator
inline
T
*
operator
->
()
{
return
&
(
*
it
);
}
inline
T
*
operator
->
()
{
return
&
(
*
it
);
}
inline
bool
operator
!=
(
const
DOFIterator
<
T
>&
rhs
)
{
if
(
this
->
iteratedObject
!=
rhs
.
iteratedObject
)
return
true
;
if
(
this
->
it
!=
rhs
.
it
)
return
true
;
inline
bool
operator
!=
(
const
DOFIterator
<
T
>&
rhs
)
{
if
(
this
->
iteratedObject
!=
rhs
.
iteratedObject
)
return
true
;
if
(
this
->
it
!=
rhs
.
it
)
return
true
;
return
false
;
}
inline
bool
operator
==
(
const
DOFIterator
<
T
>&
rhs
)
{
inline
bool
operator
==
(
const
DOFIterator
<
T
>&
rhs
)
{
return
!
(
this
->
operator
==
(
rhs
));
}
protected
:
/// Implementation of DOFIteratorBase::goToBeginOfIteratedObject()
inline
void
goToBeginOfIteratedObject
()
{
it
=
iteratedObject
->
begin
();
}
inline
void
goToBeginOfIteratedObject
()
{
it
=
iteratedObject
->
begin
();
}
/// Implementation of DOFIteratorBase::goToEndOfIteratedObject()
inline
void
goToEndOfIteratedObject
()
{
it
=
iteratedObject
->
end
();
}
inline
void
goToEndOfIteratedObject
()
{
it
=
iteratedObject
->
end
();
}
/// Implementation of DOFIteratorBase::incObjectIterator()
inline
void
incObjectIterator
()
{
++
it
;
}
inline
void
incObjectIterator
()
{
++
it
;
}
/// Implementation of DOFIteratorBase::incObjectIterator()
inline
void
decObjectIterator
()
{
--
it
;
}
inline
void
decObjectIterator
()
{
--
it
;
}
protected
:
/// Object that is iterated
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/ParallelDomainProblem.cc
+
3
−
5
View file @
d5d0ec5a
...
...
@@ -189,9 +189,8 @@ namespace AMDiS {
for
(
std
::
set
<
int
>::
iterator
itRanks
=
partitionDofs
[
it
->
first
].
begin
();
itRanks
!=
partitionDofs
[
it
->
first
].
end
();
++
itRanks
)
{
if
(
*
itRanks
!=
mpiRank
)
{
if
(
*
itRanks
!=
mpiRank
)
sendNewDofs
[
*
itRanks
][
oldDofIndex
]
=
newDofIndex
;
}
}
}
else
{
recvNewDofs
[
it
->
second
].
push_back
((
it
->
first
)[
0
]);
...
...
@@ -261,9 +260,8 @@ namespace AMDiS {
/// === Change dof indices for rank partition. ===
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
rankDofs
.
size
());
i
++
)
{
const_cast
<
DegreeOfFreedom
*>
(
rankDofs
[
i
])[
0
]
=
rstart
+
i
;
}
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
rankDofs
.
size
());
i
++
)
const_cast
<
DegreeOfFreedom
*>
(
rankDofs
[
i
])[
0
]
=
rstart
+
i
;
/// === Create petsc matrix. ===
int
ierr
;
...
...
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