Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dorie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dorie
dorie
Commits
39538cda
Commit
39538cda
authored
Oct 26, 2018
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logger as optional constructor argument of H5File and CalcController
The argument will default to retrieving the base logger
parent
e5d57af2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
+23
-10
dune/dorie/common/h5file.hh
dune/dorie/common/h5file.hh
+8
-3
dune/dorie/common/time_controller.hh
dune/dorie/common/time_controller.hh
+9
-3
dune/dorie/common/util.hh
dune/dorie/common/util.hh
+4
-3
dune/dorie/model/richards/richards.cc
dune/dorie/model/richards/richards.cc
+2
-1
No files found.
dune/dorie/common/h5file.hh
View file @
39538cda
...
...
@@ -19,8 +19,10 @@ class H5File
{
private:
//! Type of the logger for brevity
using
Logger
=
std
::
shared_ptr
<
spdlog
::
logger
>
;
//! The logger of this instance
const
std
::
shared_ptr
<
spdlog
::
logger
>
_log
;
const
Logger
_log
;
//! ID of the H5 file
hid_t
_file_id
;
//! ID of the currently opened group
...
...
@@ -30,9 +32,12 @@ public:
/// Open the H5 file and its base group.
/**
* \param file_path Path to the H5 file
* \param log The logger to use for this instance,
* defaults to retrieving the base logger.
*/
explicit
H5File
(
const
std
::
string
&
file_path
)
:
_log
(
get_logger
(
log_base
)),
explicit
H5File
(
const
std
::
string
&
file_path
,
const
Logger
log
=
get_logger
(
log_base
))
:
_log
(
log
),
_file_id
(
-
1
),
_group_id
(
-
1
)
{
...
...
dune/dorie/common/time_controller.hh
View file @
39538cda
...
...
@@ -16,6 +16,8 @@ template<typename R, typename TSC>
class
CalculationController
{
private:
//! Typedef of logger for brevity
using
Logger
=
std
::
shared_ptr
<
spdlog
::
logger
>
;
R
time
;
//!< current time
R
dt
;
//!< current time step
...
...
@@ -23,7 +25,7 @@ private:
bool
use_dt_suggestion
;
//!< flag for suggested dt
int
it
;
//!< current number of allowed iterations for Newton solver
//! logger of this instance
const
std
::
shared_ptr
<
spdlog
::
logger
>
_log
;
const
Logger
_log
;
const
R
dtmax
,
dtmin
;
//!< time step limits
const
R
eps
;
//!< error margin
const
R
dtinc
,
dtdec
;
//!< time step mutliplicators
...
...
@@ -38,13 +40,17 @@ public:
/// Read relevant time values, check for consistency and adapt time step to BC change, if necessary
/** \param tsc_ Class with public function getNextTimeStamp(time)
* \param log The logger to use for this instance,
* defaults to retrieving the base logger.
*/
CalculationController
(
const
ParameterTree
&
config
,
const
TSC
&
tsc_
,
const
Dune
::
MPIHelper
&
helper
)
CalculationController
(
const
ParameterTree
&
config
,
const
TSC
&
tsc_
,
const
Logger
log
=
get_logger
(
log_base
))
:
time
(
config
.
get
<
R
>
(
"time.start"
))
,
dt
(
config
.
get
<
R
>
(
"time.startTimestep"
))
,
suggested_dt
(
dt
)
,
use_dt_suggestion
(
false
)
,
_log
(
Dorie
::
get_logger
(
log_base
)
)
,
_log
(
log
)
,
dtmax
(
config
.
get
<
R
>
(
"time.maxTimestep"
))
,
dtmin
(
config
.
get
<
R
>
(
"time.minTimestep"
))
,
eps
(
dtmin
/
10.0
)
...
...
dune/dorie/common/util.hh
View file @
39538cda
...
...
@@ -48,8 +48,9 @@ constexpr R estimate_mbe_entries (const int dim, const Dune::GeometryType::Basic
else
if
(
geo
==
Dune
::
GeometryType
::
BasicType
::
simplex
){
return
dim
+
2
;
}
std
::
cerr
<<
"Cannot provide MBE entry estimation for given dimension and/or GeometryType!"
<<
std
::
endl
;
return
1
;
throw
std
::
runtime_error
(
"Cannot provide matrix backend entry estimate "
"for given geometry type!"
);
}
/// Provide types and construction of the GFS for the linear solver
...
...
@@ -243,4 +244,4 @@ struct BaseTraits
}
}
#endif // DUNE_DORIE_UTIL_HH
\ No newline at end of file
#endif // DUNE_DORIE_UTIL_HH
dune/dorie/model/richards/richards.cc
View file @
39538cda
...
...
@@ -56,7 +56,8 @@ RichardsSimulation<Traits>::RichardsSimulation (
#endif // EXPERIMENTAL_DG_FEATURES
tlop
=
std
::
make_unique
<
TLOP
>
(
inifile
,
*
fparam
,
gv
);
controller
=
std
::
make_unique
<
CalculationController
>
(
inifile
,
*
fboundary
,
helper
);
controller
=
std
::
make_unique
<
CalculationController
>
(
inifile
,
*
fboundary
,
this
->
_log
);
// --- Solution Vectors and Initial Condition ---
u
=
std
::
make_shared
<
U
>
(
*
gfs
,
.0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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