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
b606e2c4
Commit
b606e2c4
authored
Mar 19, 2019
by
Santiago Ospina De Los Ríos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Richards] Gather parameterization classes within a namespace
parent
0d14817b
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
83 deletions
+88
-83
dune/dorie/model/richards/flow_parameters.hh
dune/dorie/model/richards/flow_parameters.hh
+19
-19
dune/dorie/model/richards/parameterization/interface.hh
dune/dorie/model/richards/parameterization/interface.hh
+26
-24
dune/dorie/model/richards/parameterization/mualem_van_genuchten.hh
...e/model/richards/parameterization/mualem_van_genuchten.hh
+32
-30
dune/dorie/model/richards/parameterization/scaling.hh
dune/dorie/model/richards/parameterization/scaling.hh
+2
-1
dune/dorie/test/test-param-richards-scaled.cc
dune/dorie/test/test-param-richards-scaled.cc
+1
-1
dune/dorie/test/test-param-richards.cc
dune/dorie/test/test-param-richards.cc
+4
-4
dune/dorie/test/test-scaling-adapters.cc
dune/dorie/test/test-scaling-adapters.cc
+4
-4
No files found.
dune/dorie/model/richards/flow_parameters.hh
View file @
b606e2c4
...
...
@@ -24,21 +24,21 @@ namespace Dorie {
template
<
class
Traits
>
struct
RichardsParameterizationFactory
:
public
ParameterizationFactory
<
Dorie
::
RichardsParameterization
<
Traits
>>
:
public
ParameterizationFactory
<
Dorie
::
Parameterization
::
Richards
<
Traits
>>
{
/// Return a default-initialized parameterization object
/** \param type The type indicating the parameterization implementation
* \param name The name of the parameterization object (layer type)
*/
std
::
shared_ptr
<
Dorie
::
RichardsParameterization
<
Traits
>>
std
::
shared_ptr
<
Dorie
::
Parameterization
::
Richards
<
Traits
>>
selector
(
const
YAML
::
Node
&
type_node
,
const
std
::
string
name
)
const
override
{
auto
log
=
Dorie
::
get_logger
(
log_richards
);
const
auto
type
=
type_node
[
"type"
].
as
<
std
::
string
>
();
if
(
type
==
MualemVanGenuchtenParameterizatio
n
<
Traits
>::
type
)
{
return
std
::
make_shared
<
MualemVanGenuchtenParameterizatio
n
<
Traits
>>
(
name
);
if
(
type
==
Parameterization
::
MualemVanGenuchte
n
<
Traits
>::
type
)
{
return
std
::
make_shared
<
Parameterization
::
MualemVanGenuchte
n
<
Traits
>>
(
name
);
}
else
{
log
->
error
(
"Parameterization '{}' has unknown type '{}'"
,
...
...
@@ -91,23 +91,23 @@ private:
/// Index type used by the element mapper
using
Index
=
typename
Mapper
::
Index
;
/// Base class of the parameterization
using
Parameterization
=
Dorie
::
RichardsParameterization
<
Traits
>
;
using
Parameterization
Type
=
Dorie
::
Parameterization
::
Richards
<
Traits
>
;
/// Parameterization factory
using
ParameterizationFactory
=
Dorie
::
RichardsParameterizationFactory
<
Traits
>
;
/// Struct for storing scaling factors
using
Scaling
=
Dorie
::
ScalingFactors
<
RF
>
;
using
Scaling
=
Dorie
::
Parameterization
::
ScalingFactors
<
RF
>
;
/// Base class for scaling adapters
using
ScaleAdapter
=
Dorie
::
ScalingAdapter
<
Traits
>
;
using
ScaleAdapter
=
Dorie
::
Parameterization
::
ScalingAdapter
<
Traits
>
;
/// Storage for parameters and skaling factors
using
ParameterStorage
=
std
::
unordered_map
<
Index
,
std
::
tuple
<
std
::
shared_ptr
<
Parameterization
>
,
Scaling
>
std
::
tuple
<
std
::
shared_ptr
<
Parameterization
Type
>
,
Scaling
>
>
;
/// Need this gruesome typedef because 'map::value_type' has const key
using
Cache
=
std
::
tuple
<
std
::
shared_ptr
<
Parameterization
>
,
Scaling
>
;
using
Cache
=
std
::
tuple
<
std
::
shared_ptr
<
Parameterization
Type
>
,
Scaling
>
;
using
ConstCache
=
std
::
tuple
<
std
::
shared_ptr
<
const
Parameterization
>
,
Scaling
>
;
using
ConstCache
=
std
::
tuple
<
std
::
shared_ptr
<
const
Parameterization
Type
>
,
Scaling
>
;
/// Configuration file tree
const
Dune
::
ParameterTree
&
_config
;
/// Grid view of the coarsest grid configuration (level 0)
...
...
@@ -128,7 +128,7 @@ private:
/// Check if an entity has been cached
void
verify_cache
()
const
{
if
(
not
std
::
get
<
std
::
shared_ptr
<
Parameterization
>>
(
_cache
))
{
if
(
not
std
::
get
<
std
::
shared_ptr
<
Parameterization
Type
>>
(
_cache
))
{
_log
->
error
(
"Parameterization cache is empty. Call 'bind' before "
"accessing the cache or the parameterization"
);
DUNE_THROW
(
Dune
::
InvalidStateException
,
...
...
@@ -155,7 +155,7 @@ public:
for
(
const
auto
&
[
index
,
tuple
]
:
flow_param
.
_param
)
{
const
auto
&
[
p
,
sk
]
=
tuple
;
// make a hard copy of parameterization
std
::
shared_ptr
<
RichardsParameterization
<
Traits
>>
_p
=
p
->
clone
();
std
::
shared_ptr
<
Parameterization
::
Richards
<
Traits
>>
_p
=
p
->
clone
();
this
->
_param
.
emplace
(
index
,
std
::
make_tuple
(
_p
,
sk
));
}
}
...
...
@@ -226,9 +226,9 @@ public:
{
verify_cache
();
const
auto
&
par
=
std
::
get
<
std
::
shared_ptr
<
Parameterization
>>
(
_cache
);
std
::
get
<
std
::
shared_ptr
<
Parameterization
Type
>>
(
_cache
);
const
auto
cond_f
=
par
->
conductivity_f
();
using
Saturation
=
typename
Parameterization
::
Saturation
;
using
Saturation
=
typename
Parameterization
Type
::
SaturationType
;
const
auto
&
xi_cond
=
std
::
get
<
Scaling
>
(
_cache
).
scale_cond
;
...
...
@@ -246,9 +246,9 @@ public:
{
verify_cache
();
const
auto
&
par
=
std
::
get
<
std
::
shared_ptr
<
Parameterization
>>
(
_cache
);
std
::
get
<
std
::
shared_ptr
<
Parameterization
Type
>>
(
_cache
);
const
auto
sat_f
=
par
->
saturation_f
();
using
MatricHead
=
typename
Parameterization
::
MatricHead
;
using
MatricHead
=
typename
Parameterization
Type
::
MatricHeadType
;
const
auto
&
scale_head
=
std
::
get
<
Scaling
>
(
_cache
).
scale_head
;
...
...
@@ -266,13 +266,13 @@ public:
{
verify_cache
();
const
auto
&
par
=
std
::
get
<
std
::
shared_ptr
<
Parameterization
>>
(
_cache
);
std
::
get
<
std
::
shared_ptr
<
Parameterization
Type
>>
(
_cache
);
// get water content function and apply the scaling
const
auto
&
scale_por
=
std
::
get
<
Scaling
>
(
_cache
).
scale_por
;
const
auto
wc_f
=
par
->
water_content_f
(
scale_por
);
using
Saturation
=
typename
Parameterization
::
Saturation
;
using
Saturation
=
typename
Parameterization
Type
::
SaturationType
;
return
[
wc_f
](
const
RF
saturation
)
{
return
wc_f
(
Saturation
{
saturation
}).
value
;
};
...
...
@@ -292,7 +292,7 @@ private:
const
auto
parameterization_map
=
factory
.
reader
(
param_file
,
"richards"
,
_log
);
// build global scaling
using
SAF
=
Dorie
::
ScalingAdapterFactory
<
Traits
>
;
using
SAF
=
Dorie
::
Parameterization
::
ScalingAdapterFactory
<
Traits
>
;
auto
scale_cfg
=
param_file
[
"scaling"
];
auto
scaling_adapter
=
SAF
::
create
(
scale_cfg
[
"type"
].
as
<
std
::
string
>
(),
scale_cfg
[
"data"
],
...
...
dune/dorie/model/richards/parameterization/interface.hh
View file @
b606e2c4
...
...
@@ -7,6 +7,7 @@
namespace
Dune
{
namespace
Dorie
{
namespace
Parameterization
{
/// Interface for parameterizations of Richards equation.
/** Defines the basic parameters and the relation between water content
...
...
@@ -23,7 +24,7 @@ namespace Dorie {
* \ingroup RichardsParam
*/
template
<
typename
Traits
>
class
Richards
Parameterization
class
Richards
{
private:
using
RF
=
typename
Traits
::
RF
;
...
...
@@ -32,56 +33,56 @@ public:
// These are standard types for all parameterizations of Richards Equation
/// Type of water saturation
struct
Saturation
struct
Saturation
Type
{
RF
value
;
};
/// Type of volumetric water content
struct
WaterContent
struct
WaterContent
Type
{
RF
value
;
};
/// Type of hydraulic conductivity
struct
Conductivity
struct
Conductivity
Type
{
RF
value
;
};
/// Type of matric head
struct
MatricHead
struct
MatricHead
Type
{
RF
value
;
};
/// Parameter defining the saturated hydraulic conductivity
struct
SaturatedConductivity
struct
SaturatedConductivity
Type
{
RF
value
;
inline
static
const
std
::
string
name
=
"k0"
;
};
/// Parameter defining the residual water content
struct
ResidualWaterContent
struct
ResidualWaterContent
Type
{
RF
value
;
inline
static
const
std
::
string
name
=
"theta_r"
;
};
/// Parameter defining the saturated water content
struct
SaturatedWaterContent
struct
SaturatedWaterContent
Type
{
RF
value
;
inline
static
const
std
::
string
name
=
"theta_s"
;
};
//! Value of the residual water content.
ResidualWaterContent
_theta_r
;
ResidualWaterContent
Type
_theta_r
;
//! Value of the saturated water content.
SaturatedWaterContent
_theta_s
;
SaturatedWaterContent
Type
_theta_s
;
//! Value of the saturated hydraulic conductivity.
SaturatedConductivity
_k0
;
SaturatedConductivity
Type
_k0
;
//! The name of this parameterization instance, associated with the layer.
const
std
::
string
_name
;
...
...
@@ -91,7 +92,7 @@ public:
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
Richards
Parameterization
(
const
std
::
string
name
)
:
Richards
(
const
std
::
string
name
)
:
_name
(
name
)
{
}
...
...
@@ -100,16 +101,16 @@ public:
* \param parameters Tuple of parameters to use in this parameterization
*/
template
<
typename
...
Args
>
Richards
Parameterization
(
const
std
::
string
name
,
Richards
(
const
std
::
string
name
,
const
std
::
tuple
<
Args
...
>
parameters
)
:
_theta_r
(
std
::
get
<
ResidualWaterContent
>
(
parameters
)),
_theta_s
(
std
::
get
<
SaturatedWaterContent
>
(
parameters
)),
_k0
(
std
::
get
<
SaturatedConductivity
>
(
parameters
)),
_theta_r
(
std
::
get
<
ResidualWaterContent
Type
>
(
parameters
)),
_theta_s
(
std
::
get
<
SaturatedWaterContent
Type
>
(
parameters
)),
_k0
(
std
::
get
<
SaturatedConductivity
Type
>
(
parameters
)),
_name
(
name
)
{
}
/// Default constructor (virtual).
virtual
~
Richards
Parameterization
()
=
default
;
virtual
~
Richards
()
=
default
;
/// Return the name of this parameterization instance.
const
std
::
string
&
get_name
()
const
{
return
_name
;
}
...
...
@@ -118,12 +119,12 @@ public:
/** \param scale_por Porosity scaling factor
* \return Function: Saturation -> Water content
*/
std
::
function
<
WaterContent
(
const
Saturation
)
>
water_content_f
(
std
::
function
<
WaterContent
Type
(
const
SaturationType
)
>
water_content_f
(
const
RF
&
scale_por
)
const
{
return
[
this
,
&
scale_por
](
const
Saturation
sat
)
{
return
WaterContent
{
return
[
this
,
&
scale_por
](
const
Saturation
Type
sat
)
{
return
WaterContent
Type
{
sat
.
value
*
(
_theta_s
.
value
-
_theta_r
.
value
+
scale_por
)
+
_theta_r
.
value
};
...
...
@@ -133,13 +134,13 @@ public:
/// Return a bound version of the saturation function
/** \return Function: Matric Head -> Water content
*/
virtual
std
::
function
<
Saturation
(
const
MatricHead
)
>
saturation_f
()
const
virtual
std
::
function
<
Saturation
Type
(
const
MatricHeadType
)
>
saturation_f
()
const
=
0
;
/// Return a bound version of the conductivity function
/** \return Function: Saturation -> Hydraulic conductivity
*/
virtual
std
::
function
<
Conductivity
(
const
Saturation
)
>
conductivity_f
()
virtual
std
::
function
<
Conductivity
Type
(
const
SaturationType
)
>
conductivity_f
()
const
=
0
;
/// Return a multimap referecing all parameters by their names.
...
...
@@ -157,12 +158,13 @@ public:
/// Return a clone of this object
/** \return a unique pointer with a copy of this object.
*/
virtual
std
::
unique_ptr
<
Richards
Parameterization
<
Traits
>>
clone
()
const
=
0
;
virtual
std
::
unique_ptr
<
Richards
<
Traits
>>
clone
()
const
=
0
;
};
}
// namespace
Dune
}
// namespace
Parameterization
}
// namespace Dorie
}
// namespace Dune
#endif // DUNE_DORIE_PARAM_RICHARDS_INTERFACE_HH
\ No newline at end of file
dune/dorie/model/richards/parameterization/mualem_van_genuchten.hh
View file @
b606e2c4
...
...
@@ -9,6 +9,7 @@
namespace
Dune
{
namespace
Dorie
{
namespace
Parameterization
{
/// Representation of the Mualem–van Genuchten parameterization
/** Implements the following relations:
...
...
@@ -23,22 +24,22 @@ namespace Dorie {
* \date 2018
*/
template
<
typename
Traits
>
class
MualemVanGenuchten
Parameterization
:
public
Richards
Parameterization
<
Traits
>
class
MualemVanGenuchten
:
public
Richards
<
Traits
>
{
private:
using
RF
=
typename
Traits
::
RF
;
using
Base
=
Richards
Parameterization
<
Traits
>
;
using
Base
=
Richards
<
Traits
>
;
public:
using
Saturation
=
typename
Base
::
Saturation
;
using
Conductivity
=
typename
Base
::
Conductivity
;
using
MatricHead
=
typename
Base
::
MatricHead
;
using
SaturatedConductivity
=
typename
Base
::
SaturatedConductivity
;
using
Saturation
Type
=
typename
Base
::
SaturationType
;
using
Conductivity
Type
=
typename
Base
::
ConductivityType
;
using
MatricHead
Type
=
typename
Base
::
MatricHeadType
;
using
SaturatedConductivity
Type
=
typename
Base
::
SaturatedConductivityType
;
using
ResidualWaterContent
=
typename
Base
::
ResidualWaterContent
;
using
SaturatedWaterContent
=
typename
Base
::
SaturatedWaterContent
;
using
ResidualWaterContent
Type
=
typename
Base
::
ResidualWaterContentType
;
using
SaturatedWaterContent
Type
=
typename
Base
::
SaturatedWaterContentType
;
/// Parameter defining the value of alpha (air-entry value)
struct
Alpha
...
...
@@ -73,8 +74,8 @@ public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
MualemVanGenuchten
Parameterization
(
const
std
::
string
name
)
:
Richards
Parameterization
<
Traits
>
(
name
)
MualemVanGenuchten
(
const
std
::
string
name
)
:
Richards
<
Traits
>
(
name
)
{
}
/// Construct from a tuple of parameters
...
...
@@ -82,27 +83,27 @@ public:
* \param parameters Tuple of parameters to use in this parameterization
*/
template
<
typename
...
Args
>
MualemVanGenuchten
Parameterization
(
MualemVanGenuchten
(
const
std
::
string
name
,
const
std
::
tuple
<
Args
...
>
parameters
)
:
Richards
Parameterization
<
Traits
>
(
name
,
parameters
),
Richards
<
Traits
>
(
name
,
parameters
),
_alpha
(
std
::
get
<
Alpha
>
(
parameters
)),
_tau
(
std
::
get
<
Tau
>
(
parameters
)),
_n
(
std
::
get
<
N
>
(
parameters
))
{
}
/// Add default destructor to clarify override
~
MualemVanGenuchten
Parameterization
()
override
=
default
;
~
MualemVanGenuchten
()
override
=
default
;
/// Return a scaled conductivity function
/** Saturation -> Conductivity
*/
std
::
function
<
Conductivity
(
const
Saturation
)
>
conductivity_f
()
const
std
::
function
<
Conductivity
Type
(
const
SaturationType
)
>
conductivity_f
()
const
override
{
const
auto
m
=
1.0
-
1.0
/
_n
.
value
;
return
[
this
,
m
](
const
Saturation
sat
)
{
return
Conductivity
{
return
[
this
,
m
](
const
Saturation
Type
sat
)
{
return
Conductivity
Type
{
this
->
_k0
.
value
*
std
::
pow
(
sat
.
value
,
_tau
.
value
)
*
std
::
pow
(
1
-
std
::
pow
(
1
-
std
::
pow
(
sat
.
value
,
1.0
/
m
),
m
),
2
)
...
...
@@ -113,15 +114,15 @@ public:
/// Return a scaled saturation function
/** Matric head -> Saturation
*/
std
::
function
<
Saturation
(
const
MatricHead
)
>
saturation_f
()
const
std
::
function
<
Saturation
Type
(
const
MatricHeadType
)
>
saturation_f
()
const
override
{
const
auto
m
=
1.0
-
1.0
/
_n
.
value
;
return
[
this
,
m
](
const
MatricHead
head
)
{
return
[
this
,
m
](
const
MatricHead
Type
head
)
{
if
(
head
.
value
>=
0.0
)
{
return
Saturation
{
1.0
};
return
Saturation
Type
{
1.0
};
}
return
Saturation
{
return
Saturation
Type
{
std
::
pow
(
1
+
std
::
pow
(
_alpha
.
value
*
head
.
value
,
_n
.
value
),
-
m
)
};
};
...
...
@@ -133,9 +134,9 @@ public:
std
::
multimap
<
std
::
string
,
double
&>
parameters
()
override
{
return
{
{
ResidualWaterContent
::
name
,
this
->
_theta_r
.
value
},
{
SaturatedWaterContent
::
name
,
this
->
_theta_s
.
value
},
{
SaturatedConductivity
::
name
,
this
->
_k0
.
value
},
{
ResidualWaterContent
Type
::
name
,
this
->
_theta_r
.
value
},
{
SaturatedWaterContent
Type
::
name
,
this
->
_theta_s
.
value
},
{
SaturatedConductivity
Type
::
name
,
this
->
_k0
.
value
},
{
Alpha
::
name
,
_alpha
.
value
},
{
Tau
::
name
,
_tau
.
value
},
{
N
::
name
,
_n
.
value
}
...
...
@@ -148,23 +149,24 @@ public:
std
::
multimap
<
std
::
string
,
const
double
&>
parameters
()
const
override
{
return
{
{
ResidualWaterContent
::
name
,
this
->
_theta_r
.
value
},
{
SaturatedWaterContent
::
name
,
this
->
_theta_s
.
value
},
{
SaturatedConductivity
::
name
,
this
->
_k0
.
value
},
{
ResidualWaterContent
Type
::
name
,
this
->
_theta_r
.
value
},
{
SaturatedWaterContent
Type
::
name
,
this
->
_theta_s
.
value
},
{
SaturatedConductivity
Type
::
name
,
this
->
_k0
.
value
},
{
Alpha
::
name
,
_alpha
.
value
},
{
Tau
::
name
,
_tau
.
value
},
{
N
::
name
,
_n
.
value
}
};
}
std
::
unique_ptr
<
Richards
Parameterization
<
Traits
>>
clone
()
const
override
std
::
unique_ptr
<
Richards
<
Traits
>>
clone
()
const
override
{
using
ThisType
=
MualemVanGenuchten
Parameterization
<
Traits
>
;
using
ThisType
=
MualemVanGenuchten
<
Traits
>
;
return
std
::
make_unique
<
ThisType
>
(
*
this
);
}
};
}
// namespace
Dune
}
// namespace
Parameterization
}
// namespace Dorie
}
// namespace Dune
#endif // DUNE_DORIE_PARAM_MVG_HH
dune/dorie/model/richards/parameterization/scaling.hh
View file @
b606e2c4
...
...
@@ -16,6 +16,7 @@
namespace
Dune
{
namespace
Dorie
{
namespace
Parameterization
{
/// Define scaling factors used for any scaling type.
/** The variables are initialized to their default values
...
...
@@ -252,7 +253,7 @@ public:
}
};
}
// namespace Parameterization
}
// namespace Dorie
}
// namespace Dune
...
...
dune/dorie/test/test-param-richards-scaled.cc
View file @
b606e2c4
...
...
@@ -44,7 +44,7 @@ void test_scaled_parameterization (FlowParameters& param_scaled,
param_unscaled
.
bind
(
cell
);
// retrieve actual scaling
using
Scale
=
Dune
::
Dorie
::
ScalingFactors
<
Traits
<
2
>::
RF
>
;
using
Scale
=
Dune
::
Dorie
::
Parameterization
::
ScalingFactors
<
Traits
<
2
>::
RF
>
;
auto
scale
=
std
::
get
<
Scale
>
(
param_scaled
.
cache
());
// check results of scaled functions
...
...
dune/dorie/test/test-param-richards.cc
View file @
b606e2c4
...
...
@@ -74,7 +74,7 @@ void test_new_parameters (const FlowParameters& fparam,
{
// bind parameterization to cell and fetch parameters
fparam
.
bind
(
cell
);
using
RP
=
Dune
::
Dorie
::
RichardsParameterization
<
Traits
<
2
>>
;
using
RP
=
Dune
::
Dorie
::
Parameterization
::
Richards
<
Traits
<
2
>>
;
auto
par
=
std
::
get
<
std
::
shared_ptr
<
const
RP
>>
(
fparam
.
cache
());
auto
parameters
=
par
->
parameters
();
...
...
@@ -116,14 +116,14 @@ void test_parameter_manipulation (FlowParameters& fparam,
fparam
.
bind
(
cell
);
// manipulate via returned map (this is the preferred way)
using
RP
=
Dune
::
Dorie
::
RichardsParameterization
<
Traits
<
2
>>
;
using
RP
=
Dune
::
Dorie
::
Parameterization
::
Richards
<
Traits
<
2
>>
;
auto
par
=
std
::
get
<
std
::
shared_ptr
<
RP
>>
(
fparam
.
cache
());
auto
parameters
=
par
->
parameters
();
parameters
.
find
(
"theta_r"
)
->
second
=
0.0
;
assert
(
par
->
_theta_r
.
value
==
0.0
);
// manipulate directly via casting (this is not recommended)
using
MvG
=
Dune
::
Dorie
::
MualemVanGenuchtenParameterizatio
n
<
Traits
<
2
>>
;
using
MvG
=
Dune
::
Dorie
::
Parameterization
::
MualemVanGenuchte
n
<
Traits
<
2
>>
;
auto
&
par_mvg
=
dynamic_cast
<
MvG
&>
(
*
par
);
parameters
.
find
(
"alpha"
)
->
second
=
-
10.0
;
assert
(
par_mvg
.
_alpha
.
value
=
-
10.0
);
...
...
@@ -141,7 +141,7 @@ bool compare_parameters (const FlowParameters& fparam1,
// bind parameterization to cell and fetch parameters
fparam1
.
bind
(
cell
);
fparam2
.
bind
(
cell
);
using
RP
=
Dune
::
Dorie
::
RichardsParameterization
<
Traits
<
2
>>
;
using
RP
=
Dune
::
Dorie
::
Parameterization
::
Richards
<
Traits
<
2
>>
;
auto
par1
=
std
::
get
<
std
::
shared_ptr
<
const
RP
>>
(
fparam1
.
cache
());
auto
par2
=
std
::
get
<
std
::
shared_ptr
<
const
RP
>>
(
fparam2
.
cache
());
auto
parameters1
=
par1
->
parameters
();
...
...
dune/dorie/test/test-scaling-adapters.cc
View file @
b606e2c4
...
...
@@ -23,8 +23,8 @@
/// Compare two scaling factor structs
template
<
typename
T
>
std
::
enable_if_t
<
std
::
is_arithmetic_v
<
T
>
,
bool
>
operator
==
(
const
Dune
::
Dorie
::
ScalingFactors
<
T
>&
a
,
const
Dune
::
Dorie
::
ScalingFactors
<
T
>&
b
)
(
const
Dune
::
Dorie
::
Parameterization
::
ScalingFactors
<
T
>&
a
,
const
Dune
::
Dorie
::
Parameterization
::
ScalingFactors
<
T
>&
b
)
{
if
(
a
.
scale_cond
==
b
.
scale_cond
and
a
.
scale_head
==
b
.
scale_head
...
...
@@ -56,7 +56,7 @@ void test_scaling_setting (const YAML::Node& cfg,
{
// create the scaling
const
auto
type
=
cfg
[
"type"
].
as
<
std
::
string
>
();
using
SAF
=
Dune
::
Dorie
::
ScalingAdapterFactory
<
Traits
<
dim
>>
;
using
SAF
=
Dune
::
Dorie
::
Parameterization
::
ScalingAdapterFactory
<
Traits
<
dim
>>
;
const
auto
log
=
Dune
::
Dorie
::
get_logger
(
Dune
::
Dorie
::
log_base
);
auto
scaling
=
SAF
::
create
(
type
,
cfg
[
"data"
],
grid_view
,
log
);
...
...
@@ -77,7 +77,7 @@ void evaluate_scaling (const std::string& type,
const
std
::
vector
<
Domain
>&
positions
)
{
// create reference scaling
using
Scaling
=
Dune
::
Dorie
::
ScalingFactors
<
double
>
;
using
Scaling
=
Dune
::
Dorie
::
Parameterization
::
ScalingFactors
<
double
>
;
Scaling
reference
;
if
(
type
==
"none"
)
{
reference
=
Scaling
{
1.0
,
1.0
,
0.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