Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Tobias Leibner
dune-common
Commits
abb5a674
Commit
abb5a674
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
specialisation for Sgrid.
[[Imported from SVN: r3795]]
parent
5b0da9c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io/file/grapedataio.hh
+67
-14
67 additions, 14 deletions
io/file/grapedataio.hh
with
67 additions
and
14 deletions
io/file/grapedataio.hh
+
67
−
14
View file @
abb5a674
...
...
@@ -8,9 +8,12 @@
//- Dune includes
#include
<dune/common/misc.hh>
#include
<dune/grid/common/grid.hh>
#include
<dune/io/file/asciiparser.hh>
#include
<dune/fem/dofmanager.hh>
#include
<dune/grid/sgrid.hh>
//- Local includes
namespace
Dune
{
...
...
@@ -58,12 +61,56 @@ namespace Dune {
return
tmp
;
};
template
<
int
dim
,
int
dimworld
,
class
GridImp
>
class
GrapeDataIOImp
{
typedef
GridImp
GridType
;
public:
/** Write Grid with GridType file filename and time
*
* This method uses the Grid Interface Method writeGrid
* to actually write the grid, within this method the real file name is
* generated out of filename and timestep
*/
inline
static
bool
writeGrid
(
const
GridType
&
grid
,
const
GrapeIOFileFormatType
ftype
,
const
GrapeIOStringType
&
fnprefix
,
double
time
=
0.0
,
int
timestep
=
0
,
int
precision
=
6
);
//! get Grid from file with time and timestep , return true if ok
inline
static
bool
readGrid
(
GridType
&
grid
,
const
GrapeIOStringType
&
fnprefix
,
double
&
time
,
int
timestep
);
};
template
<
int
dim
,
int
dimworld
>
class
GrapeDataIOImp
<
dim
,
dimworld
,
SGrid
<
dim
,
dimworld
>
>
{
typedef
SGrid
<
dim
,
dimworld
>
GridType
;
public:
/** Write Grid with GridType file filename and time
*
* This method uses the Grid Interface Method writeGrid
* to actually write the grid, within this method the real file name is
* generated out of filename and timestep
*/
inline
static
bool
writeGrid
(
const
GridType
&
grid
,
const
GrapeIOFileFormatType
ftype
,
const
GrapeIOStringType
&
fnprefix
,
double
time
=
0.0
,
int
timestep
=
0
,
int
precision
=
6
)
{
return
false
;
}
//! get Grid from file with time and timestep , return true if ok
inline
static
bool
readGrid
(
GridType
&
grid
,
const
GrapeIOStringType
&
fnprefix
,
double
&
time
,
int
timestep
)
{
return
false
;
}
};
template
<
class
GridType
>
class
GrapeDataIO
{
public:
GrapeDataIO
()
{};
/** Write Grid with GridType file filename and time
...
...
@@ -74,12 +121,20 @@ namespace Dune {
*/
inline
bool
writeGrid
(
const
GridType
&
grid
,
const
GrapeIOFileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
,
double
time
=
0.0
,
int
timestep
=
0
,
int
precision
=
6
);
,
double
time
=
0.0
,
int
timestep
=
0
,
int
precision
=
6
)
const
{
return
GrapeDataIOImp
<
GridType
::
dimension
,
GridType
::
dimensionworld
,
GridType
>::
writeGrid
(
grid
,
ftype
,
fnprefix
,
time
,
timestep
,
precision
);
}
//! get Grid from file with time and timestep , return true if ok
inline
bool
readGrid
(
GridType
&
grid
,
const
GrapeIOStringType
fnprefix
,
double
&
time
,
int
timestep
);
const
GrapeIOStringType
fnprefix
,
double
&
time
,
int
timestep
)
{
return
GrapeDataIOImp
<
GridType
::
dimension
,
GridType
::
dimensionworld
,
GridType
>::
readGrid
(
grid
,
fnprefix
,
time
,
timestep
);
}
/**
Write DiscreteFunctions
...
...
@@ -99,16 +154,15 @@ namespace Dune {
};
template
<
class
Grid
Type
>
inline
bool
GrapeDataIO
<
GridType
>
::
writeGrid
(
const
Grid
Type
&
grid
,
const
GrapeIOFileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
,
template
<
int
dim
,
int
dimworld
,
class
Grid
Imp
>
inline
bool
GrapeDataIO
Imp
<
dim
,
dimworld
,
GridImp
>
::
writeGrid
(
const
Grid
Imp
&
grid
,
const
GrapeIOFileFormatType
ftype
,
const
GrapeIOStringType
&
fnprefix
,
double
time
,
int
timestep
,
int
precision
)
{
// write dof manager, that corresponds to grid
{
typedef
DofManager
<
Grid
Type
>
DofManagerType
;
typedef
DofManager
<
Grid
Imp
>
DofManagerType
;
typedef
DofManagerFactory
<
DofManagerType
>
DMFactoryType
;
std
::
string
dmname
(
fnprefix
);
...
...
@@ -145,10 +199,9 @@ namespace Dune {
}
template
<
class
GridType
>
inline
bool
GrapeDataIO
<
GridType
>
::
readGrid
(
GridType
&
grid
,
const
GrapeIOStringType
fnprefix
,
double
&
time
,
int
timestep
)
template
<
int
dim
,
int
dimworld
,
class
GridImp
>
inline
bool
GrapeDataIOImp
<
dim
,
dimworld
,
GridImp
>
::
readGrid
(
GridImp
&
grid
,
const
GrapeIOStringType
&
fnprefix
,
double
&
time
,
int
timestep
)
{
int
helpType
;
...
...
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