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
23ec2c99
Commit
23ec2c99
authored
May 18, 2010
by
Thomas Witkowski
Browse files
Dirichlet BC with DOFVector instead of a function possible.
parent
b1872344
Changes
4
Show whitespace changes
Inline
Side-by-side
AMDiS/src/DirichletBC.cc
View file @
23ec2c99
...
...
@@ -19,15 +19,16 @@ namespace AMDiS {
worldCoords
.
resize
(
omp_get_overall_max_threads
());
}
DirichletBC
::
DirichletBC
(
BoundaryType
type
,
DOFVectorBase
<
double
>
*
vec
)
:
BoundaryCondition
(
type
,
vec
->
getFESpace
()),
DOFVectorBase
<
double
>
*
vec
,
bool
apply
)
:
BoundaryCondition
(
type
,
vec
->
getFESpace
(),
vec
->
getFESpace
()),
f
(
NULL
),
dofVec
(
vec
),
applyBC
(
true
)
{
worldCoords
.
resize
(
omp_get_overall_max_threads
());
}
applyBC
(
apply
)
{}
void
DirichletBC
::
fillBoundaryCondition
(
DOFMatrix
*
matrix
,
ElInfo
*
elInfo
,
...
...
@@ -39,6 +40,7 @@ namespace AMDiS {
TEST_EXIT_DBG
(
matrix
->
getRowFESpace
()
==
rowFESpace
)(
"invalid row fe space
\n
"
);
}
void
DirichletBC
::
fillBoundaryCondition
(
DOFVectorBase
<
double
>*
vector
,
ElInfo
*
elInfo
,
const
DegreeOfFreedom
*
dofIndices
,
...
...
AMDiS/src/DirichletBC.h
View file @
23ec2c99
...
...
@@ -49,7 +49,8 @@ namespace AMDiS {
/// Constructor.
DirichletBC
(
BoundaryType
type
,
DOFVectorBase
<
double
>
*
vec
);
DOFVectorBase
<
double
>
*
vec
,
bool
apply
=
true
);
/// Implementation of BoundaryCondition::fillBoundaryCondition().
void
fillBoundaryCondition
(
DOFMatrix
*
matrix
,
...
...
AMDiS/src/ProblemVec.cc
View file @
23ec2c99
...
...
@@ -1189,14 +1189,39 @@ namespace AMDiS {
DirichletBC
*
dirichletNotApply
=
new
DirichletBC
(
type
,
b
,
componentSpaces
[
row
],
componentSpaces
[
col
],
false
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
{
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
if
(
i
==
col
)
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
else
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
if
(
rhs
)
rhs
->
getDOFVector
(
row
)
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
if
(
solution
)
solution
->
getDOFVector
(
row
)
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
}
}
void
ProblemVec
::
addDirichletBC
(
BoundaryType
type
,
int
row
,
int
col
,
DOFVector
<
double
>
*
vec
)
{
FUNCNAME
(
"ProblemVec::addDirichletBC()"
);
TEST_EXIT
(
row
>=
0
&&
row
<
nComponents
)(
"Wrong row number: %d
\n
"
,
row
);
TEST_EXIT
(
col
>=
0
&&
col
<
nComponents
)(
"Wrong col number: %d
\n
"
,
col
);
boundaryConditionSet
=
true
;
DirichletBC
*
dirichletApply
=
new
DirichletBC
(
type
,
vec
,
true
);
DirichletBC
*
dirichletNotApply
=
new
DirichletBC
(
type
,
vec
,
false
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
if
(
systemMatrix
&&
(
*
systemMatrix
)[
row
][
i
])
if
(
i
==
col
)
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
else
(
*
systemMatrix
)[
row
][
i
]
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletNotApply
);
if
(
rhs
)
rhs
->
getDOFVector
(
row
)
->
getBoundaryManager
()
->
addBoundaryCondition
(
dirichletApply
);
...
...
AMDiS/src/ProblemVec.h
View file @
23ec2c99
...
...
@@ -244,6 +244,9 @@ namespace AMDiS {
virtual
void
addDirichletBC
(
BoundaryType
type
,
int
row
,
int
col
,
AbstractFunction
<
double
,
WorldVector
<
double
>
>
*
b
);
virtual
void
addDirichletBC
(
BoundaryType
type
,
int
row
,
int
col
,
DOFVector
<
double
>
*
vec
);
/// Adds neumann boundary conditions.
virtual
void
addNeumannBC
(
BoundaryType
type
,
int
row
,
int
col
,
AbstractFunction
<
double
,
WorldVector
<
double
>
>
*
n
);
...
...
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