Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Karsten Rink
ogs
Commits
d143182f
Commit
d143182f
authored
9 years ago
by
Christoph Lehmann
Committed by
Dmitri Naumov
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added parser for timestepping configuration
parent
e5e357a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/ApplicationsLib/ProjectData.cpp
+42
-0
42 additions, 0 deletions
Applications/ApplicationsLib/ProjectData.cpp
Applications/ApplicationsLib/ProjectData.h
+7
-0
7 additions, 0 deletions
Applications/ApplicationsLib/ProjectData.h
with
49 additions
and
0 deletions
Applications/ApplicationsLib/ProjectData.cpp
+
42
−
0
View file @
d143182f
...
...
@@ -22,6 +22,8 @@
#include
"MeshLib/Mesh.h"
#include
"NumLib/TimeStepping/Algorithms/FixedTimeStepping.h"
// FileIO
#include
"FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
#include
"FileIO/readMeshFromFile.h"
...
...
@@ -69,6 +71,9 @@ ProjectData::ProjectData(ConfigTree const& project_config,
// output
parseOutput
(
project_config
.
get_child
(
"output"
),
path
);
// timestepping
parseTimeStepping
(
project_config
.
get_child
(
"time_stepping"
));
}
ProjectData
::~
ProjectData
()
...
...
@@ -274,3 +279,40 @@ void ProjectData::parseOutput(ConfigTree const& output_config,
_output_file_prefix
=
path
+
*
file
;
}
void
ProjectData
::
parseTimeStepping
(
ConfigTree
const
&
timestepping_config
)
{
using
namespace
ProcessLib
;
DBUG
(
"Reading timestepping configuration."
);
auto
const
type
=
timestepping_config
.
get_optional
<
std
::
string
>
(
"type"
);
if
(
!
type
)
{
ERR
(
"Could not find required timestepper type."
);
std
::
abort
();
}
if
(
*
type
==
"FixedTimeStepping"
)
{
_time_stepper
.
reset
(
NumLib
::
FixedTimeStepping
::
newInstance
(
timestepping_config
));
}
else
if
(
*
type
==
"SingleStep"
)
{
_time_stepper
.
reset
(
new
NumLib
::
FixedTimeStepping
(
0.0
,
1.0
,
1.0
));
}
else
{
ERR
(
"Unknown timestepper type: `%s'."
,
type
->
c_str
());
std
::
abort
();
}
if
(
!
_time_stepper
)
{
ERR
(
"Initialization of timestepper failed."
);
std
::
abort
();
}
}
This diff is collapsed.
Click to expand it.
Applications/ApplicationsLib/ProjectData.h
+
7
−
0
View file @
d143182f
...
...
@@ -22,6 +22,8 @@
#include
"GeoLib/GEOObjects.h"
#endif
#include
"NumLib/TimeStepping/Algorithms/ITimeStepAlgorithm.h"
#include
"ProcessLib/ProcessVariable.h"
#include
"ProcessLib/Process.h"
#include
"ProcessLib/Parameter.h"
...
...
@@ -164,6 +166,8 @@ private:
/// Parses the file tag and sets output file prefix.
void
parseOutput
(
ConfigTree
const
&
output_config
,
std
::
string
const
&
path
);
void
parseTimeStepping
(
ConfigTree
const
&
timestepping_config
);
private
:
#ifdef OGS_BUILD_GUI
GEOModels
*
_geoObjects
=
new
GEOModels
();
...
...
@@ -182,6 +186,9 @@ private:
/// Output file path with project prefix.
std
::
string
_output_file_prefix
;
/// Timestepper
std
::
unique_ptr
<
NumLib
::
ITimeStepAlgorithm
>
_time_stepper
;
};
#endif //PROJECTDATA_H_
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