Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
ag-ohlberger
dune-community
dune-xt
Commits
853e82ce
Commit
853e82ce
authored
9 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[functions] revamp spe10 model2 for variable UR point
parent
3541ea03
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/stuff/functions/spe10model2.hh
+24
-7
24 additions, 7 deletions
dune/stuff/functions/spe10model2.hh
with
24 additions
and
7 deletions
dune/stuff/functions/spe10model2.hh
+
24
−
7
View file @
853e82ce
...
...
@@ -15,6 +15,7 @@
#include
<dune/stuff/common/string.hh>
#include
<dune/stuff/common/fvector.hh>
#include
<dune/stuff/common/type_utils.hh>
#include
<dune/stuff/functions/global.hh>
namespace
Dune
{
namespace
Stuff
{
...
...
@@ -22,7 +23,8 @@ namespace Functions {
namespace
Spe10
{
/**
* Grid is currently mandated to have LL (0,0,0) to UR (365.76, 670.56, 51.816) corners
* Grid originally had LL (0,0,0) to UR (365.76, 670.56, 51.816) corners
*
*/
template
<
class
EntityImp
,
class
DomainFieldImp
,
size_t
dim_domain
,
class
RangeFieldImp
,
size_t
r
,
size_t
rC
>
class
Model2
:
public
Stuff
::
GlobalFunctionInterface
<
EntityImp
,
DomainFieldImp
,
dim_domain
,
RangeFieldImp
,
r
,
rC
>
...
...
@@ -33,8 +35,9 @@ class Model2 : public Stuff::GlobalFunctionInterface<EntityImp, DomainFieldImp,
typedef
Stuff
::
GlobalFunctionInterface
<
EntityImp
,
DomainFieldImp
,
dim_domain
,
RangeFieldImp
,
r
,
rC
>
BaseType
;
public:
Model2
(
std
::
string
data_filename
=
"perm_case2a.dat"
)
:
deltas_
{{
6.096
,
3.048
,
0.6096
}}
Model2
(
std
::
string
data_filename
=
"perm_case2a.dat"
,
DSC
::
FieldVector
<
double
,
dim_domain
>
upper_right
=
default_upper_right
)
:
deltas_
{{
upper_right
[
0
]
/
num_elements
[
0
],
upper_right
[
1
]
/
num_elements
[
1
],
upper_right
[
2
]
/
num_elements
[
2
]}}
,
permeability_
(
nullptr
)
,
permMatrix_
(
0.0
)
,
filename_
(
data_filename
)
...
...
@@ -42,6 +45,10 @@ public:
readPermeability
();
}
static
const
DSC
::
FieldVector
<
double
,
dim_domain
>
default_upper_right
;
// unsigned int mandated by CubeGrid provider
static
const
DSC
::
FieldVector
<
unsigned
int
,
dim_domain
>
num_elements
;
virtual
~
Model2
()
{
delete
permeability_
;
...
...
@@ -62,13 +69,17 @@ public:
<<
"dune-multiscale/dune/multiscale/problems/spe10_permeability.dat!
\n
"
;
DUNE_THROW
(
IOError
,
"Data file for Groundwaterflow permeability could not be opened!"
);
}
// 3 is the maximum space dimension
for
(
size_t
dim
=
0
;
dim
<
dim_domain
;
++
dim
)
permIntervalls_
[
dim
]
=
std
::
floor
(
x
[
dim
]
/
deltas_
[
dim
]);
permIntervalls_
[
dim
]
=
std
::
min
(
unsigned
(
std
::
floor
(
x
[
dim
]
/
deltas_
[
dim
])
),
num_elements
[
dim
]
-
1
)
;
const
int
offset
=
permIntervalls_
[
0
]
+
permIntervalls_
[
1
]
*
60
+
permIntervalls_
[
2
]
*
220
*
60
;
for
(
size_t
dim
=
0
;
dim
<
dim_domain
;
++
dim
)
diffusion
[
dim
][
dim
]
=
permeability_
[
offset
+
dim
*
1122000
];
const
int
offset
=
permIntervalls_
[
0
]
+
permIntervalls_
[
1
]
*
num_elements
[
0
]
+
permIntervalls_
[
2
]
*
num_elements
[
1
]
*
num_elements
[
0
];
for
(
size_t
dim
=
0
;
dim
<
dim_domain
;
++
dim
)
{
const
auto
idx
=
offset
+
dim
*
1122000
;
diffusion
[
dim
][
dim
]
=
permeability_
[
idx
];
}
}
virtual
size_t
order
()
const
...
...
@@ -102,6 +113,12 @@ private:
const
std
::
string
filename_
;
};
template
<
class
EntityImp
,
class
DomainFieldImp
,
size_t
dim_domain
,
class
RangeFieldImp
,
size_t
r
,
size_t
rC
>
const
DSC
::
FieldVector
<
unsigned
int
,
dim_domain
>
Model2
<
EntityImp
,
DomainFieldImp
,
dim_domain
,
RangeFieldImp
,
r
,
rC
>::
num_elements
{{
60
,
220
,
85
}};
template
<
class
EntityImp
,
class
DomainFieldImp
,
size_t
dim_domain
,
class
RangeFieldImp
,
size_t
r
,
size_t
rC
>
const
DSC
::
FieldVector
<
double
,
dim_domain
>
Model2
<
EntityImp
,
DomainFieldImp
,
dim_domain
,
RangeFieldImp
,
r
,
rC
>::
default_upper_right
{{
7.059
,
12.941
,
1
}};
}
// namespace Spe10
}
// namespace Functions
}
// namespace Stuff
...
...
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