Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dune-fem
dune-fem-dg
Commits
bc82d485
Commit
bc82d485
authored
9 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
simplify choice of data writer.
parent
c29704f8
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
dune/fem-dg/algorithm/base.hh
+3
-13
3 additions, 13 deletions
dune/fem-dg/algorithm/base.hh
dune/fem-dg/algorithm/handler/datawriter.hh
+11
-16
11 additions, 16 deletions
dune/fem-dg/algorithm/handler/datawriter.hh
with
14 additions
and
29 deletions
dune/fem-dg/algorithm/base.hh
+
3
−
13
View file @
bc82d485
...
...
@@ -33,11 +33,6 @@ namespace Fem
ss
<<
name
<<
loop
;
loop_
=
ss
.
str
();
}
explicit
EocDataOutputParameters
(
const
std
::
string
&
name
)
{
std
::
stringstream
ss
;
ss
<<
name
;
loop_
=
ss
.
str
();
}
EocDataOutputParameters
(
const
EocDataOutputParameters
&
other
)
:
loop_
(
other
.
loop_
)
{}
...
...
@@ -186,13 +181,8 @@ namespace Fem
GridType
&
grid
=
algorithm
.
grid
();
auto
dataTup
=
algorithm
.
dataTuple
()
;
typedef
typename
Algorithm
::
DataWriterHandlerType
DataWriterHandlerType
;
DataWriterHandlerType
dataWriter
(
grid
,
""
);
// initialize data writer with output path and data tuple
{
EocDataOutputParameters
param
(
algorithm
.
problem
().
dataPrefix
()
);
dataWriter
.
init
(
dataTup
,
param
);
}
typedef
typename
Algorithm
::
DataWriterHandlerType
::
template
DataOutput
<
GridType
,
decltype
(
dataTup
)
>
::
Type
DataOutputType
;
DataOutputType
dataOutput
(
grid
,
dataTup
);
// initialize FemEoc if eocSteps > 1
EocParametersType
&
eocParam
(
algorithm
.
eocParams
()
);
...
...
@@ -234,7 +224,7 @@ namespace Fem
}
// write eoc step
data
Writer
.
step
(
eocloop
);
data
Output
.
writeData
(
eocloop
);
// Refine the grid for the next EOC Step. If the scheme uses adaptation,
// the refinement level needs to be set in the algorithms' initialize method.
...
...
This diff is collapsed.
Click to expand it.
dune/fem-dg/algorithm/handler/datawriter.hh
+
11
−
16
View file @
bc82d485
...
...
@@ -23,6 +23,12 @@ namespace Fem
public:
typedef
DataWriter
<
GridImp
,
IOTupleImp
>
DataWriterType
;
template
<
class
Grid
,
class
DataTuple
>
struct
DataOutput
{
typedef
Dune
::
Fem
::
DataWriter
<
Grid
,
DataTuple
>
Type
;
};
DefaultDataWriterHandler
(
const
GridImp
&
grid
,
const
std
::
string
keyPrefix
=
""
)
:
dataTuple_
(),
...
...
@@ -38,13 +44,6 @@ namespace Fem
dataWriter_
.
reset
(
new
DataWriterType
(
grid_
,
dataTuple_
,
tp
,
param
)
);
}
template
<
class
DataTupleImp
,
class
ParameterType
>
void
init
(
DataTupleImp
dataTup
,
ParameterType
&
param
)
{
dataTuple_
=
dataTup
;
dataWriter_
.
reset
(
new
DataWriterType
(
grid_
,
dataTuple_
,
param
)
);
}
//template< class InDiscreteFunction, class OutDiscreteFunction, class ... Args >
//void preWriteData( const InDiscreteFunction& in, OutDiscreteFunction* out, Args& ... args )
...
...
@@ -74,15 +73,6 @@ namespace Fem
}
}
void
step
(
const
int
eocStep
)
{
if
(
dataWriter_
)
{
dataWriter_
->
writeData
(
eocStep
);
}
}
private
:
IOTupleImp
dataTuple_
;
std
::
unique_ptr
<
DataWriterType
>
dataWriter_
;
...
...
@@ -95,6 +85,11 @@ namespace Fem
class
NoDataWriterHandler
{
public:
template
<
class
Grid
,
class
DataTuple
>
struct
DataOutput
{
typedef
Dune
::
Fem
::
DataOutput
<
Grid
,
DataTuple
>
Type
;
};
template
<
class
...
Args
>
NoDataWriterHandler
(
Args
&&
...
)
...
...
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