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
5b2d4647
Commit
5b2d4647
authored
14 years ago
by
Naumann, Andreas
Browse files
Options
Downloads
Patches
Plain Diff
prepared function hooks and codestyle in ProblemImplicit-files
parent
ac593360
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMDiS/src/ProblemImplicit.cc
+22
-11
22 additions, 11 deletions
AMDiS/src/ProblemImplicit.cc
AMDiS/src/ProblemImplicit.h
+8
-4
8 additions, 4 deletions
AMDiS/src/ProblemImplicit.h
with
30 additions
and
15 deletions
AMDiS/src/ProblemImplicit.cc
+
22
−
11
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
);
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/ProblemImplicit.h
+
8
−
4
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
;
};
...
...
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