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
b782f6d3
Commit
b782f6d3
authored
16 years ago
by
Thomas Witkowski
Browse files
Options
Downloads
Patches
Plain Diff
* isDeserialized_ moved from AdaptInstationary to AdaptInfo
parent
3e4a0cc6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AMDiS/src/AdaptInfo.h
+18
-1
18 additions, 1 deletion
AMDiS/src/AdaptInfo.h
AMDiS/src/AdaptInstationary.cc
+3
-3
3 additions, 3 deletions
AMDiS/src/AdaptInstationary.cc
AMDiS/src/SystemVector.h
+21
-22
21 additions, 22 deletions
AMDiS/src/SystemVector.h
with
42 additions
and
26 deletions
AMDiS/src/AdaptInfo.h
+
18
−
1
View file @
b782f6d3
...
@@ -169,7 +169,8 @@ namespace AMDiS {
...
@@ -169,7 +169,8 @@ namespace AMDiS {
maxSolverIterations
(
0
),
maxSolverIterations
(
0
),
solverTolerance
(
1e-8
),
solverTolerance
(
1e-8
),
solverResidual
(
0.0
),
solverResidual
(
0.0
),
scalContents
(
size
)
scalContents
(
size
),
isDeserialized_
(
false
)
{
{
GET_PARAMETER
(
0
,
name_
+
"->start time"
,
"%f"
,
&
startTime
);
GET_PARAMETER
(
0
,
name_
+
"->start time"
,
"%f"
,
&
startTime
);
time
=
startTime
;
time
=
startTime
;
...
@@ -675,6 +676,17 @@ namespace AMDiS {
...
@@ -675,6 +676,17 @@ namespace AMDiS {
return
solverResidual
;
return
solverResidual
;
};
};
/** \brief
* Returns true, if the adaptive procedure was deserialized from a file.
*/
const
bool
isDeserialized
()
const
{
return
isDeserialized_
;
}
inline
void
setIsDeserialized
(
bool
b
)
{
isDeserialized_
=
b
;
}
/** \brief
/** \brief
* Creates new scalContents with the given size.
* Creates new scalContents with the given size.
*/
*/
...
@@ -782,6 +794,11 @@ namespace AMDiS {
...
@@ -782,6 +794,11 @@ namespace AMDiS {
* Scalar adapt infos.
* Scalar adapt infos.
*/
*/
Vector
<
ScalContent
*>
scalContents
;
Vector
<
ScalContent
*>
scalContents
;
/** \brief
* Is true, if the adaptive procedure was deserialized from a file.
*/
bool
isDeserialized_
;
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/AdaptInstationary.cc
+
3
−
3
View file @
b782f6d3
...
@@ -15,8 +15,7 @@ namespace AMDiS {
...
@@ -15,8 +15,7 @@ namespace AMDiS {
AdaptInfo
*
initialInfo
,
AdaptInfo
*
initialInfo
,
time_t
initialTimestamp
)
time_t
initialTimestamp
)
:
AdaptBase
(
name
,
problemStat
,
info
,
problemInstat
,
initialInfo
),
:
AdaptBase
(
name
,
problemStat
,
info
,
problemInstat
,
initialInfo
),
breakWhenStable
(
0
),
breakWhenStable
(
0
)
isDeserialized_
(
false
)
{
{
FUNCNAME
(
"AdaptInstationary::AdaptInstationary()"
);
FUNCNAME
(
"AdaptInstationary::AdaptInstationary()"
);
...
@@ -43,7 +42,8 @@ namespace AMDiS {
...
@@ -43,7 +42,8 @@ namespace AMDiS {
deserialize
(
in
);
deserialize
(
in
);
in
.
close
();
in
.
close
();
isDeserialized_
=
true
;
info
->
setIsDeserialized
(
true
);
initialInfo
->
setIsDeserialized
(
true
);
}
else
{
}
else
{
int
readSerialization
=
0
;
int
readSerialization
=
0
;
int
readSerializationWithAdaptInfo
=
0
;
int
readSerializationWithAdaptInfo
=
0
;
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/SystemVector.h
+
21
−
22
View file @
b782f6d3
...
@@ -70,11 +70,10 @@ namespace AMDiS {
...
@@ -70,11 +70,10 @@ namespace AMDiS {
* Implementation of CreatorInterface::create().
* Implementation of CreatorInterface::create().
*/
*/
SystemVector
*
create
()
{
SystemVector
*
create
()
{
int
i
;
char
number
[
10
];
char
number
[
10
];
::
std
::
string
numberedName
;
::
std
::
string
numberedName
;
SystemVector
*
result
=
NEW
SystemVector
(
name
,
feSpace
,
size
);
SystemVector
*
result
=
NEW
SystemVector
(
name
,
feSpace
,
size
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
size
;
i
++
)
{
sprintf
(
number
,
"[%d]"
,
i
);
sprintf
(
number
,
"[%d]"
,
i
);
numberedName
=
name
+
::
std
::
string
(
number
);
numberedName
=
name
+
::
std
::
string
(
number
);
result
->
setDOFVector
(
i
,
NEW
DOFVector
<
double
>
(
feSpace
[
i
],
numberedName
));
result
->
setDOFVector
(
i
,
NEW
DOFVector
<
double
>
(
feSpace
[
i
],
numberedName
));
...
@@ -323,8 +322,8 @@ namespace AMDiS {
...
@@ -323,8 +322,8 @@ namespace AMDiS {
* multiplication with scalar
* multiplication with scalar
*/
*/
inline
const
SystemVector
&
operator
*=
(
SystemVector
&
x
,
double
d
)
{
inline
const
SystemVector
&
operator
*=
(
SystemVector
&
x
,
double
d
)
{
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
*
(
x
.
getDOFVector
(
i
))
*=
d
;
*
(
x
.
getDOFVector
(
i
))
*=
d
;
}
}
return
x
;
return
x
;
...
@@ -337,8 +336,8 @@ namespace AMDiS {
...
@@ -337,8 +336,8 @@ namespace AMDiS {
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
(
"invalid size
\n
"
);
(
"invalid size
\n
"
);
double
result
=
0.0
;
double
result
=
0.0
;
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
result
+=
(
*
x
.
getDOFVector
(
i
))
*
(
*
y
.
getDOFVector
(
i
));
result
+=
(
*
x
.
getDOFVector
(
i
))
*
(
*
y
.
getDOFVector
(
i
));
};
};
return
result
;
return
result
;
...
@@ -352,8 +351,8 @@ namespace AMDiS {
...
@@ -352,8 +351,8 @@ namespace AMDiS {
{
{
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
(
"invalid size
\n
"
);
(
"invalid size
\n
"
);
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
(
x
.
getDOFVector
(
i
)))
+=
(
*
(
y
.
getDOFVector
(
i
)));
(
*
(
x
.
getDOFVector
(
i
)))
+=
(
*
(
y
.
getDOFVector
(
i
)));
}
}
return
x
;
return
x
;
...
@@ -367,8 +366,8 @@ namespace AMDiS {
...
@@ -367,8 +366,8 @@ namespace AMDiS {
{
{
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
(
"invalid size
\n
"
);
(
"invalid size
\n
"
);
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
(
x
.
getDOFVector
(
i
)))
-=
(
*
(
y
.
getDOFVector
(
i
)));
(
*
(
x
.
getDOFVector
(
i
)))
-=
(
*
(
y
.
getDOFVector
(
i
)));
}
}
return
x
;
return
x
;
...
@@ -379,8 +378,8 @@ namespace AMDiS {
...
@@ -379,8 +378,8 @@ namespace AMDiS {
*/
*/
inline
SystemVector
operator
*
(
SystemVector
&
x
,
double
d
)
{
inline
SystemVector
operator
*
(
SystemVector
&
x
,
double
d
)
{
SystemVector
result
=
x
;
SystemVector
result
=
x
;
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
(
result
.
getDOFVector
(
i
)))
*=
d
;
(
*
(
result
.
getDOFVector
(
i
)))
*=
d
;
}
}
return
result
;
return
result
;
...
@@ -391,8 +390,8 @@ namespace AMDiS {
...
@@ -391,8 +390,8 @@ namespace AMDiS {
*/
*/
inline
SystemVector
operator
*
(
double
d
,
SystemVector
&
x
)
{
inline
SystemVector
operator
*
(
double
d
,
SystemVector
&
x
)
{
SystemVector
result
=
x
;
SystemVector
result
=
x
;
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
(
result
.
getDOFVector
(
i
)))
*=
d
;
(
*
(
result
.
getDOFVector
(
i
)))
*=
d
;
}
}
return
result
;
return
result
;
...
@@ -407,8 +406,8 @@ namespace AMDiS {
...
@@ -407,8 +406,8 @@ namespace AMDiS {
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
TEST_EXIT_DBG
(
x
.
getNumVectors
()
==
y
.
getNumVectors
())
(
"invalid size
\n
"
);
(
"invalid size
\n
"
);
SystemVector
result
=
x
;
SystemVector
result
=
x
;
int
i
,
size
=
x
.
getNumVectors
();
int
size
=
x
.
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
(
result
.
getDOFVector
(
i
)))
+=
(
*
(
y
.
getDOFVector
(
i
)));
(
*
(
result
.
getDOFVector
(
i
)))
+=
(
*
(
y
.
getDOFVector
(
i
)));
}
}
return
result
;
return
result
;
...
@@ -433,8 +432,8 @@ namespace AMDiS {
...
@@ -433,8 +432,8 @@ namespace AMDiS {
*/
*/
inline
double
norm
(
SystemVector
*
x
)
{
inline
double
norm
(
SystemVector
*
x
)
{
double
result
=
0.0
;
double
result
=
0.0
;
int
i
,
size
=
x
->
getNumVectors
();
int
size
=
x
->
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
result
+=
x
->
getDOFVector
(
i
)
->
squareNrm2
();
result
+=
x
->
getDOFVector
(
i
)
->
squareNrm2
();
}
}
return
sqrt
(
result
);
return
sqrt
(
result
);
...
@@ -445,8 +444,8 @@ namespace AMDiS {
...
@@ -445,8 +444,8 @@ namespace AMDiS {
*/
*/
inline
double
L2Norm
(
SystemVector
*
x
)
{
inline
double
L2Norm
(
SystemVector
*
x
)
{
double
result
=
0.0
;
double
result
=
0.0
;
int
i
,
size
=
x
->
getNumVectors
();
int
size
=
x
->
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
result
+=
x
->
getDOFVector
(
i
)
->
L2NormSquare
();
result
+=
x
->
getDOFVector
(
i
)
->
L2NormSquare
();
}
}
return
sqrt
(
result
);
return
sqrt
(
result
);
...
@@ -457,8 +456,8 @@ namespace AMDiS {
...
@@ -457,8 +456,8 @@ namespace AMDiS {
*/
*/
inline
double
H1Norm
(
SystemVector
*
x
)
{
inline
double
H1Norm
(
SystemVector
*
x
)
{
double
result
=
0.0
;
double
result
=
0.0
;
int
i
,
size
=
x
->
getNumVectors
();
int
size
=
x
->
getNumVectors
();
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
result
+=
x
->
getDOFVector
(
i
)
->
H1NormSquare
();
result
+=
x
->
getDOFVector
(
i
)
->
H1NormSquare
();
}
}
return
sqrt
(
result
);
return
sqrt
(
result
);
...
...
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