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
iwr
amdis
Commits
5b2d4647
Commit
5b2d4647
authored
May 28, 2010
by
Naumann, Andreas
Browse files
prepared function hooks and codestyle in ProblemImplicit-files
parent
ac593360
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/ProblemImplicit.cc
View file @
5b2d4647
...
...
@@ -25,8 +25,9 @@ namespace AMDiS {
std
::
vector
<
double
>&
vecPhi1
=
phi1
->
getVector
();
std
::
vector
<
double
>&
vecPhi2
=
phi2
->
getVector
();
std
::
vector
<
double
>&
vecLevelSet
=
levelSet
->
getVector
();
TEST_EXIT
(
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
())(
"something went wrong
\n
"
);
bool
checkSize
=
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
();
TEST_EXIT
(
checkSize
)(
"something went wrong
\n
"
);
for
(
int
i
=
vecR
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
vecPhi1
[
i
]
=
Phi1
(
vecR
[
i
],
eps
);
...
...
@@ -45,8 +46,10 @@ namespace AMDiS {
std
::
vector
<
double
>&
vecPhi1
=
phi1
->
getVector
();
std
::
vector
<
double
>&
vecPhi2
=
phi2
->
getVector
();
std
::
vector
<
double
>&
vecLevelSet
=
levelSet
->
getVector
();
TEST_EXIT
(
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
())(
"something went wrong
\n
"
);
bool
checkSize
=
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
();
TEST_EXIT
(
checkSize
)(
"something went wrong
\n
"
);
for
(
int
i
=
vecR
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
vecR
[
i
]
=
Phi1ToR
(
vecPhi1
[
i
],
eps
);
...
...
@@ -67,7 +70,9 @@ namespace AMDiS {
std
::
vector
<
double
>&
vecPhi2
=
phi2
->
getVector
();
std
::
vector
<
double
>&
vecLevelSet
=
levelSet
->
getVector
();
TEST_EXIT
(
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
())(
"something went wrong
\n
"
);
bool
checkSize
=
vecR
.
size
()
!=
vecPhi1
.
size
()
&&
vecPhi2
.
size
()
!=
vecR
.
size
();
TEST_EXIT
(
checkSize
)(
"something went wrong
\n
"
);
for
(
int
i
=
vecR
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
vecR
[
i
]
=
Phi2ToR
(
vecPhi2
[
i
],
eps
);
...
...
@@ -134,7 +139,8 @@ namespace AMDiS {
return
true
;
}
void
ProblemImplicitScal
::
initialize
(
Flag
initFlag
,
ProblemScal
*
adaptProblem
,
Flag
adoptFlag
)
void
ProblemImplicitScal
::
initialize
(
Flag
initFlag
,
ProblemScal
*
adaptProblem
,
Flag
adoptFlag
)
{
FUNCNAME
(
"ImplicitScal::initialize()"
);
ProblemScal
::
initialize
(
CREATE_MESH
);
...
...
@@ -157,7 +163,8 @@ namespace AMDiS {
bool
ProblemImplicitVec
::
createImplicitMesh
(
int
p
)
{
std
::
string
path
=
name
+
"->implicit mesh["
+
boost
::
lexical_cast
<
std
::
string
>
(
p
)
+
"]->"
;
std
::
string
path
=
name
+
"->implicit mesh["
+
boost
::
lexical_cast
<
std
::
string
>
(
p
)
+
"]->"
;
std
::
string
meshFilename
(
""
);
GET_PARAMETER
(
0
,
path
+
"mesh file"
,
&
meshFilename
);
//if no file name is given, there's no implicit mesh
...
...
@@ -190,13 +197,16 @@ namespace AMDiS {
switch
(
serType
)
{
case
0
:
calcspace
::
readR
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
calcspace
::
readR
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
break
;
case
1
:
calcspace
::
readPhi1
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
calcspace
::
readPhi1
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
break
;
case
2
:
calcspace
::
readPhi2
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
calcspace
::
readPhi2
(
inStream
,
eps
,
r
[
p
],
phi1
[
p
],
phi2
[
p
],
levelSet
[
p
],
meshes
[
p
]);
break
;
default:
WARNING
(
"unknown implicit mesh type
\n
"
);
...
...
@@ -205,7 +215,8 @@ namespace AMDiS {
return
true
;
}
void
ProblemImplicitVec
::
initialize
(
Flag
initFlag
,
ProblemScal
*
adaptProblem
,
Flag
adoptFlag
)
void
ProblemImplicitVec
::
initialize
(
Flag
initFlag
,
ProblemScal
*
adaptProblem
,
Flag
adoptFlag
)
{
FUNCNAME
(
"ImplicitScal::initialize()"
);
ProblemVec
::
initialize
(
CREATE_MESH
);
...
...
AMDiS/src/ProblemImplicit.h
View file @
5b2d4647
...
...
@@ -18,7 +18,8 @@ namespace AMDiS {
levelSet
(
NULL
)
{}
/// @return: true if implicit mesh type is ok (see below) and false in all other cases
/// @return: true if implicit mesh type is ok (see below) and false in
/// all other cases
/// initfile entries:
/// name+"->implicit mesh->mesh file": name of serialized mesh
/// name+"->implicit mesh->dof file": name of serialized dofvector
...
...
@@ -44,7 +45,8 @@ namespace AMDiS {
/// DOFVector for the phasefield function 0.5*(1+tanh(3*r/eps))
DOFVector
<
double
>
*
phi2
;
/// DOFVector for the levelset function (levelSet(x): x \in \Omega: 1, x \not \in Omega: -1, x \in \Gamma: 0)
/// DOFVector for the levelset function
/// (levelSet(x): x \in \Omega: 1, x \not \in Omega: -1, x \in \Gamma: 0)
DOFVector
<
double
>
*
levelSet
;
};
...
...
@@ -52,7 +54,8 @@ namespace AMDiS {
class
ProblemImplicitVec
:
public
ProblemVec
{
public:
ProblemImplicitVec
(
std
::
string
name
,
ProblemIterationInterface
*
problem
=
NULL
)
ProblemImplicitVec
(
std
::
string
name
,
ProblemIterationInterface
*
problem
=
NULL
)
:
ProblemVec
(
name
,
problem
),
r
(
0
),
phi1
(
0
),
...
...
@@ -76,7 +79,8 @@ namespace AMDiS {
/// DOFVector for the phasefield function 0.5*(1+tanh(3*r/eps))
std
::
vector
<
DOFVector
<
double
>*
>
phi2
;
/// DOFVector for the levelset function (levelSet(x): x \in \Omega: 1, x \not \in Omega: -1, x \in \Gamma: 0)
/// DOFVector for the levelset function
/// (levelSet(x): x \in \Omega: 1, x \not \in Omega: -1, x \in \Gamma: 0)
std
::
vector
<
DOFVector
<
double
>*
>
levelSet
;
};
...
...
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