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
Backofen, Rainer
amdis
Commits
47066205
Commit
47066205
authored
Feb 28, 2012
by
Thomas Witkowski
Browse files
Fixed problem with using different stationary problems with periodic boundary conditions.
parent
b921fbdc
Changes
7
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/BoundaryManager.cc
View file @
47066205
...
...
@@ -45,6 +45,22 @@ namespace AMDiS {
}
void
BoundaryManager
::
addBoundaryCondition
(
BoundaryCondition
*
localBC
)
{
FUNCNAME
(
"BoundaryManager::addBoundaryCondition()"
);
MSG
(
"ADD BC
\n
"
);
BoundaryType
type
=
localBC
->
getBoundaryType
();
TEST_EXIT
(
localBCs
[
type
]
==
NULL
)
(
"There is already a condition for this type %d.
\n
"
,
type
);
localBCs
[
type
]
=
localBC
;
std
::
vector
<
BoundaryCondition
*>&
boundMap
=
globalBoundaryMap
[
type
];
boundMap
.
push_back
(
localBC
);
}
double
BoundaryManager
::
boundResidual
(
ElInfo
*
elInfo
,
DOFMatrix
*
matrix
,
const
DOFVectorBase
<
double
>
*
dv
)
...
...
AMDiS/src/BoundaryManager.h
View file @
47066205
...
...
@@ -51,18 +51,7 @@ namespace AMDiS {
~
BoundaryManager
();
/// Adds a local boundary condition to the list of managed conditions.
void
addBoundaryCondition
(
BoundaryCondition
*
localBC
)
{
FUNCNAME
(
"BoundaryManager::addBoundaryCondition()"
);
BoundaryType
type
=
localBC
->
getBoundaryType
();
TEST_EXIT
(
localBCs
[
type
]
==
NULL
)
(
"There is already a condition for this type %d.
\n
"
,
type
);
localBCs
[
type
]
=
localBC
;
std
::
vector
<
BoundaryCondition
*>&
boundMap
=
globalBoundaryMap
[
type
];
boundMap
.
push_back
(
localBC
);
}
void
addBoundaryCondition
(
BoundaryCondition
*
localBC
);
void
initMatrix
(
DOFMatrix
*
matrix
);
...
...
@@ -72,22 +61,16 @@ namespace AMDiS {
void
exitVector
(
DOFVectorBase
<
double
>
*
vector
);
/** \brief
* Calls DOFVectorBase::fillBoundaryCondition() for each local boundary condition
* in \ref localBCs.
*/
/// Calls DOFVectorBase::fillBoundaryCondition() for each local boundary
/// condition in \ref localBCs.
void
fillBoundaryConditions
(
ElInfo
*
elInfo
,
DOFVectorBase
<
double
>
*
vec
);
/** \brief
* Calls DOFMatrix::fillBoundaryCondition() for each local boundary condition
* in \ref localBCs.
*/
/// Calls DOFMatrix::fillBoundaryCondition() for each local boundary condition
/// in \ref localBCs.
void
fillBoundaryConditions
(
ElInfo
*
elInfo
,
DOFMatrix
*
mat
);
/** \brief
* Calls BoundaryCondition::boundResidual() for each boundary condition in
* \ref localBCs.
*/
/// Calls BoundaryCondition::boundResidual() for each boundary condition in
/// \ref localBCs.
double
boundResidual
(
ElInfo
*
elInfo
,
DOFMatrix
*
matrix
,
const
DOFVectorBase
<
double
>
*
dv
);
...
...
@@ -106,10 +89,8 @@ namespace AMDiS {
localBCs
=
bcs
;
}
/** \brief
* Returns true, if there is at least one boundary object with the given boundary
* id, which implements a periodic boundary.
*/
/// Returns true, if there is at least one boundary object with the given
/// boundary id, which implements a periodic boundary.
static
bool
isBoundaryPeriodic
(
BoundaryType
b
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
globalBoundaryMap
[
b
].
size
());
i
++
)
...
...
@@ -129,10 +110,8 @@ namespace AMDiS {
/// Temporary variable for functions fillBoundaryconditions.
std
::
vector
<
DegreeOfFreedom
>
dofVec
;
/** \brief
* Stores the number of byte that were allocated in the constructor for
* each localBounds value. Is used to free the memory in the destructor.
*/
/// Stores the number of byte that were allocated in the constructor for
/// each localBounds value. Is used to free the memory in the destructor.
int
allocatedMemoryLocalBounds
;
/** \brief
...
...
AMDiS/src/ProblemStat.cc
View file @
47066205
...
...
@@ -821,21 +821,8 @@ namespace AMDiS {
continue
;
}
if
(
assembleMatrix
&&
matrix
->
getBoundaryManager
())
{
MSG
(
"TEST MAT FOR PERIODIC BC: %p on problem %s
\n
"
,
matrix
,
name
.
c_str
());
BoundaryIndexMap
&
boundaryMap
=
const_cast
<
BoundaryIndexMap
&>
(
matrix
->
getBoundaryManager
()
->
getBoundaryConditionMap
());
MSG
(
"PTR: %p
\n
"
,
&
boundaryMap
);
BoundaryIndexMap
::
iterator
it
=
boundaryMap
.
begin
();
while
(
it
!=
boundaryMap
.
end
())
{
if
(
it
->
second
->
isPeriodic
())
MSG
(
"HAS PERIODIC!
\n
"
);
++
it
;
}
MSG
(
"TEST A
\n
"
);
if
(
assembleMatrix
&&
matrix
->
getBoundaryManager
())
matrix
->
getBoundaryManager
()
->
initMatrix
(
matrix
);
MSG
(
"TEST B
\n
"
);
}
// The simplest case: either the right hand side has no operaters, no aux
// fe spaces, or all aux fe spaces are equal to the row and col fe space.
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
47066205
...
...
@@ -465,11 +465,8 @@ namespace AMDiS {
// and to remove the periodic boundary conditions on these objects.
if
(
initialized
)
{
MSG
(
"INIT 0
\n
"
);
setRankDofs
(
probStat
);
removePeriodicBoundaryConditions
(
probStat
);
}
else
{
MSG
(
"INIT 1
\n
"
);
}
}
...
...
@@ -744,12 +741,8 @@ namespace AMDiS {
{
FUNCNAME
(
"MeshDistributor::removePeriodicBoundaryConditions()"
);
MSG
(
"REMOVE ON PROB STAT %s
\n
"
,
probStat
->
getName
().
c_str
());
int
nComponents
=
probStat
->
getNumComponents
();
MSG
(
"NUM: %d
\n
"
,
nComponents
);
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
for
(
int
k
=
0
;
k
<
nComponents
;
k
++
)
{
DOFMatrix
*
mat
=
probStat
->
getSystemMatrix
(
j
,
k
);
...
...
@@ -770,26 +763,13 @@ namespace AMDiS {
{
FUNCNAME
(
"MeshDistributor::removePeriodicBoundaryConditions()"
);
MSG
(
"START REMOVE: %p
\n
"
,
&
boundaryMap
);
BoundaryIndexMap
::
iterator
it
=
boundaryMap
.
begin
();
while
(
it
!=
boundaryMap
.
end
())
{
if
(
it
->
second
->
isPeriodic
())
{
MSG
(
"FOUND AND REMOVE!
\n
"
);
if
(
it
->
second
->
isPeriodic
())
boundaryMap
.
erase
(
it
++
);
}
else
else
++
it
;
}
MSG
(
"AND TEST AGAIN!
\n
"
);
it
=
boundaryMap
.
begin
();
while
(
it
!=
boundaryMap
.
end
())
{
if
(
it
->
second
->
isPeriodic
())
MSG
(
"FOUND PER!
\n
"
);
++
it
;
}
}
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
47066205
...
...
@@ -367,6 +367,11 @@ namespace AMDiS {
return
mpiComm
;
}
inline
bool
isInitialized
()
{
return
initialized
;
}
/// Creates a set of all DOFs that are on interior boundaries of rank's
/// domain. Thus, it creates the union of \ref sendDofs and \ref recvDofs.
void
createBoundaryDofs
(
const
FiniteElemSpace
*
feSpace
,
...
...
AMDiS/src/parallel/ParallelProblemStatBase.cc
View file @
47066205
...
...
@@ -58,5 +58,14 @@ namespace AMDiS {
meshDistributor
=
MeshDistributor
::
globalMeshDistributor
;
}
void
ParallelProblemStatBase
::
addPeriodicBC
(
BoundaryType
type
,
int
row
,
int
col
)
{
FUNCNAME
(
"ParallelProblemStatBase::addPeriodicBC()"
);
if
(
MeshDistributor
::
globalMeshDistributor
->
isInitialized
())
return
;
ProblemStatSeq
::
addPeriodicBC
(
type
,
row
,
col
);
}
}
AMDiS/src/parallel/ParallelProblemStatBase.h
View file @
47066205
...
...
@@ -47,6 +47,8 @@ namespace AMDiS {
ProblemStatSeq
*
adoptProblem
=
NULL
,
Flag
adoptFlag
=
INIT_NOTHING
);
void
addPeriodicBC
(
BoundaryType
type
,
int
row
,
int
col
);
protected:
MeshDistributor
*
meshDistributor
;
};
...
...
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