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
3541ea03
Commit
3541ea03
authored
9 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[functions] moves spe10 model2 data fucntion into seperate file
parent
55abc3de
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/stuff/functions/spe10.hh
+0
-81
0 additions, 81 deletions
dune/stuff/functions/spe10.hh
dune/stuff/functions/spe10model2.hh
+110
-0
110 additions, 0 deletions
dune/stuff/functions/spe10model2.hh
with
110 additions
and
81 deletions
dune/stuff/functions/spe10.hh
+
0
−
81
View file @
3541ea03
...
...
@@ -217,87 +217,6 @@ private:
}
};
// class Model1< ..., 2, ..., r, r >
/**
* Grid is currently mandated to have 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
>
{
static_assert
(
r
==
rC
,
""
);
static_assert
(
dim_domain
==
rC
,
""
);
static_assert
(
dim_domain
==
3
,
""
);
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
}}
,
permeability_
(
nullptr
)
,
permMatrix_
(
0.0
)
,
filename_
(
data_filename
)
{
readPermeability
();
}
virtual
~
Model2
()
{
delete
permeability_
;
permeability_
=
nullptr
;
}
//! currently used in gdt assembler
virtual
void
evaluate
(
const
typename
BaseType
::
DomainType
&
x
,
typename
BaseType
::
RangeType
&
diffusion
)
const
final
override
{
if
(
!
permeability_
)
{
DSC_LOG_ERROR_0
<<
"The SPE10-permeability data file could not be opened. This file does
\n
"
<<
"not come with the dune-multiscale repository due to file size. To download it
\n
"
<<
"execute
\n
"
<<
"wget http://www.spe.org/web/csp/datasets/por_perm_case2a.zip
\n
"
<<
"unzip the file and move the file 'spe_perm.dat' to
\n
"
<<
"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
]);
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
];
}
virtual
size_t
order
()
const
{
return
0u
;
}
private
:
void
readPermeability
()
{
std
::
ifstream
file
(
filename_
);
double
val
;
if
(
!
file
)
{
// file couldn't be opened
return
;
}
file
>>
val
;
int
counter
=
0
;
permeability_
=
new
double
[
3366000
];
while
(
!
file
.
eof
())
{
// keep reading until end-of-file
permeability_
[
counter
++
]
=
val
;
file
>>
val
;
// sets EOF flag if no value found
}
file
.
close
();
}
std
::
array
<
double
,
dim_domain
>
deltas_
;
double
*
permeability_
;
//! TODO automatic memory
mutable
typename
BaseType
::
DomainType
permIntervalls_
;
mutable
Dune
::
FieldMatrix
<
double
,
BaseType
::
DomainType
::
dimension
,
BaseType
::
DomainType
::
dimension
>
permMatrix_
;
const
std
::
string
filename_
;
};
}
// namespace Spe10
}
// namespace Functions
...
...
This diff is collapsed.
Click to expand it.
dune/stuff/functions/spe10model2.hh
0 → 100644
+
110
−
0
View file @
3541ea03
// This file is part of the dune-stuff project:
// https://github.com/wwu-numerik/dune-stuff/
// Copyright holders: Rene Milk, Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#ifndef DUNE_STUFF_FUNCTIONS_SPE10MODEL2_HH
#define DUNE_STUFF_FUNCTIONS_SPE10MODEL2_HH
#include
<iostream>
#include
<memory>
#include
<dune/stuff/common/exceptions.hh>
#include
<dune/stuff/common/configuration.hh>
#include
<dune/stuff/common/color.hh>
#include
<dune/stuff/common/string.hh>
#include
<dune/stuff/common/fvector.hh>
#include
<dune/stuff/common/type_utils.hh>
namespace
Dune
{
namespace
Stuff
{
namespace
Functions
{
namespace
Spe10
{
/**
* Grid is currently mandated to have 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
>
{
static_assert
(
r
==
rC
,
""
);
static_assert
(
dim_domain
==
rC
,
""
);
static_assert
(
dim_domain
==
3
,
""
);
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
}}
,
permeability_
(
nullptr
)
,
permMatrix_
(
0.0
)
,
filename_
(
data_filename
)
{
readPermeability
();
}
virtual
~
Model2
()
{
delete
permeability_
;
permeability_
=
nullptr
;
}
//! currently used in gdt assembler
virtual
void
evaluate
(
const
typename
BaseType
::
DomainType
&
x
,
typename
BaseType
::
RangeType
&
diffusion
)
const
final
override
{
if
(
!
permeability_
)
{
DSC_LOG_ERROR_0
<<
"The SPE10-permeability data file could not be opened. This file does
\n
"
<<
"not come with the dune-multiscale repository due to file size. To download it
\n
"
<<
"execute
\n
"
<<
"wget http://www.spe.org/web/csp/datasets/por_perm_case2a.zip
\n
"
<<
"unzip the file and move the file 'spe_perm.dat' to
\n
"
<<
"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
]);
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
];
}
virtual
size_t
order
()
const
{
return
0u
;
}
private
:
void
readPermeability
()
{
std
::
ifstream
file
(
filename_
);
double
val
;
if
(
!
file
)
{
// file couldn't be opened
return
;
}
file
>>
val
;
int
counter
=
0
;
permeability_
=
new
double
[
3366000
];
while
(
!
file
.
eof
())
{
// keep reading until end-of-file
permeability_
[
counter
++
]
=
val
;
file
>>
val
;
// sets EOF flag if no value found
}
file
.
close
();
}
std
::
array
<
double
,
dim_domain
>
deltas_
;
double
*
permeability_
;
//! TODO automatic memory
mutable
typename
BaseType
::
DomainType
permIntervalls_
;
mutable
Dune
::
FieldMatrix
<
double
,
BaseType
::
DomainType
::
dimension
,
BaseType
::
DomainType
::
dimension
>
permMatrix_
;
const
std
::
string
filename_
;
};
}
// namespace Spe10
}
// namespace Functions
}
// namespace Stuff
}
// namespace Dune
#endif // DUNE_STUFF_FUNCTIONS_SPE10MODEL2_HH
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