Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-vtk
Commits
28967950
Commit
28967950
authored
Apr 26, 2020
by
Praetorius, Simon
Browse files
replace Dune::Std::optional with std::optional
parent
9d6d4bc5
Changes
13
Hide whitespace changes
Inline
Side-by-side
dune/vtk/filewriter.hh
View file @
28967950
#pragma once
#include <optional>
#include <string>
#include <dune/common/std/optional.hh>
#include <dune/vtk/forward.hh>
namespace
Dune
...
...
@@ -14,7 +14,7 @@ namespace Dune
virtual
~
FileWriter
()
=
default
;
/// Write to file given by `filename` and (optionally) store additional data in `dataDir`
virtual
std
::
string
write
(
std
::
string
const
&
filename
,
S
td
::
optional
<
std
::
string
>
dataDir
=
{})
const
=
0
;
virtual
std
::
string
write
(
std
::
string
const
&
filename
,
s
td
::
optional
<
std
::
string
>
dataDir
=
{})
const
=
0
;
};
}
// end namespace Dune
dune/vtk/gridcreators/lagrangegridcreator.hh
View file @
28967950
...
...
@@ -3,11 +3,11 @@
#include <cassert>
#include <cstdint>
#include <limits>
#include <optional>
#include <vector>
#include <dune/common/exceptions.hh>
#include <dune/common/hybridutilities.hh>
#include <dune/common/std/optional.hh>
#include <dune/geometry/utility/typefromvertexcount.hh>
#include <dune/localfunctions/lagrange.hh>
#include <dune/grid/common/gridfactory.hh>
...
...
@@ -297,7 +297,7 @@ namespace Dune
private:
LocalFE
localFE_
;
std
::
vector
<
GlobalCoordinate
>
localNodes_
;
S
td
::
optional
<
LocalGeometry
>
localGeometry_
;
s
td
::
optional
<
LocalGeometry
>
localGeometry_
;
mutable
std
::
vector
<
typename
LocalBasisTraits
::
RangeType
>
shapeValues_
;
};
...
...
@@ -343,7 +343,7 @@ namespace Dune
LagrangeGridCreator
const
*
gridCreator_
;
LocalContext
localContext_
;
S
td
::
optional
<
LocalParametrization
>
localParametrization_
;
s
td
::
optional
<
LocalParametrization
>
localParametrization_
;
};
}
// end namespace Dune
dune/vtk/pvdwriter.hh
View file @
28967950
#pragma once
#include <iosfwd>
#include <optional>
#include <string>
#include <vector>
#include <tuple>
#include <dune/common/std/optional.hh>
#include <dune/vtk/vtktypes.hh>
#include <dune/vtk/filewriter.hh>
#include <dune/vtk/forward.hh>
...
...
@@ -42,7 +41,7 @@ namespace Dune
* \param dir Specifies where to write the timestep files.
* \param writeCollection Create a collection .pvd file directly
**/
void
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
=
{},
void
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
=
{},
bool
writeCollection
=
true
)
const
;
/// \brief Writes collection of timesteps to .pvd file.
...
...
@@ -52,7 +51,7 @@ namespace Dune
* \param dir (Ignored) Timestep files are already written and their filenames are
* stored in \ref timesteps_.
**/
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
/// Attach point data to the writer, \see VtkFunction for possible arguments
template
<
class
Function
,
class
...
Args
>
...
...
dune/vtk/pvdwriter.impl.hh
View file @
28967950
...
...
@@ -10,7 +10,7 @@ namespace Dune {
template
<
class
W
>
void
PvdWriter
<
W
>
::
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
,
bool
writeCollection
)
const
::
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
,
bool
writeCollection
)
const
{
auto
p
=
filesystem
::
path
(
fn
);
auto
name
=
p
.
stem
();
...
...
@@ -50,7 +50,7 @@ void PvdWriter<W>
template
<
class
W
>
std
::
string
PvdWriter
<
W
>
::
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
/*dir*/
)
const
::
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
/*dir*/
)
const
{
auto
p
=
filesystem
::
path
(
fn
);
auto
name
=
p
.
stem
();
...
...
dune/vtk/vtkfunction.hh
View file @
28967950
#pragma once
#include <optional>
#include <type_traits>
#include <dune/common/std/optional.hh>
#include <dune/common/std/type_traits.hh>
#include "vtklocalfunction.hh"
...
...
@@ -52,7 +52,7 @@ namespace Dune
* \param type The VTK datatype how to write the function values to the output [Vtk::FLOAT64]
**/
VtkFunction
(
std
::
shared_ptr
<
VTKFunction
<
GridView
>
const
>
const
&
fct
,
S
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
s
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
:
localFct_
(
fct
)
,
name_
(
fct
->
name
())
,
ncomps_
(
fct
->
ncomps
())
...
...
@@ -73,8 +73,8 @@ namespace Dune
template
<
class
F
,
class
=
void_t
<
LocalFunction
<
F
>
>
>
VtkFunction
(
F
&&
fct
,
std
::
string
name
,
S
td
::
optional
<
int
>
ncomps
=
{},
S
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
s
td
::
optional
<
int
>
ncomps
=
{},
s
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
:
localFct_
(
localFunction
(
std
::
forward
<
F
>
(
fct
)))
,
name_
(
std
::
move
(
name
))
{
...
...
@@ -88,7 +88,7 @@ namespace Dune
template
<
class
F
,
class
=
void_t
<
LocalFunction
<
F
>
>
>
VtkFunction
(
F
&&
fct
,
Vtk
::
FieldInfo
fieldInfo
,
S
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
s
td
::
optional
<
Vtk
::
DataTypes
>
type
=
{})
:
VtkFunction
(
std
::
forward
<
F
>
(
fct
),
fieldInfo
.
name
(),
fieldInfo
.
ncomps
(),
type
)
{}
...
...
dune/vtk/vtktimeserieswriter.hh
View file @
28967950
#pragma once
#include <cassert>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
#include <dune/common/std/optional.hh>
#include <dune/vtk/filewriter.hh>
#include <dune/vtk/forward.hh>
#include <dune/vtk/vtktypes.hh>
...
...
@@ -66,7 +65,7 @@ namespace Dune
* \param writeCollection Create a timeseries file directly
**/
void
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
tmpDir
=
{},
s
td
::
optional
<
std
::
string
>
tmpDir
=
{},
bool
writeCollection
=
true
)
const
;
/// Writes all timesteps to single timeseries file.
...
...
@@ -79,7 +78,7 @@ namespace Dune
*
* \returns File name of the actual written file
**/
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
/// Attach point data to the writer, \see VtkFunction for possible arguments
template
<
class
Function
,
class
...
Args
>
...
...
dune/vtk/vtktimeserieswriter.impl.hh
View file @
28967950
...
...
@@ -39,7 +39,7 @@ VtkTimeseriesWriter<W>::~VtkTimeseriesWriter ()
template
<
class
W
>
void
VtkTimeseriesWriter
<
W
>
::
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
tmpDir
,
bool
writeCollection
)
const
::
writeTimestep
(
double
time
,
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
tmpDir
,
bool
writeCollection
)
const
{
auto
name
=
filesystem
::
path
(
fn
).
stem
();
auto
tmpBase
=
tmpDir
?
filesystem
::
path
(
*
tmpDir
)
:
tmpDir_
;
...
...
@@ -75,7 +75,7 @@ void VtkTimeseriesWriter<W>
template
<
class
W
>
std
::
string
VtkTimeseriesWriter
<
W
>
::
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
)
const
::
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
)
const
{
assert
(
initialized_
);
...
...
dune/vtk/vtkwriterinterface.hh
View file @
28967950
...
...
@@ -3,11 +3,11 @@
#include <iosfwd>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/std/optional.hh>
#include <dune/vtk/filewriter.hh>
#include <dune/vtk/forward.hh>
#include <dune/vtk/vtkfunction.hh>
...
...
@@ -84,7 +84,7 @@ namespace Dune
*
* \returns File name that is actually written.
**/
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
virtual
std
::
string
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
=
{})
const
override
;
/// \brief Attach point data to the writer
/**
...
...
@@ -158,7 +158,7 @@ namespace Dune
std
::
vector
<
pos_type
>&
offsets
,
VtkFunction
const
&
fct
,
PositionTypes
type
,
S
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
s
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
// Write point-data and cell-data in raw/compressed format to output stream
void
writeDataAppended
(
std
::
ofstream
&
out
,
std
::
vector
<
std
::
uint64_t
>&
blocks
)
const
;
...
...
@@ -168,7 +168,7 @@ namespace Dune
// vector `offsets`.
void
writePoints
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
s
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
// Write Appended section and fillin offset values to XML attributes
void
writeAppended
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>
const
&
offsets
)
const
;
...
...
dune/vtk/vtkwriterinterface.impl.hh
View file @
28967950
...
...
@@ -24,7 +24,7 @@ namespace Dune {
template
<
class
GV
,
class
DC
>
std
::
string
VtkWriterInterface
<
GV
,
DC
>
::
write
(
std
::
string
const
&
fn
,
S
td
::
optional
<
std
::
string
>
dir
)
const
::
write
(
std
::
string
const
&
fn
,
s
td
::
optional
<
std
::
string
>
dir
)
const
{
dataCollector_
->
update
();
...
...
@@ -80,7 +80,7 @@ template <class GV, class DC>
void
VtkWriterInterface
<
GV
,
DC
>
::
writeData
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
VtkFunction
const
&
fct
,
PositionTypes
type
,
S
td
::
optional
<
std
::
size_t
>
timestep
)
const
s
td
::
optional
<
std
::
size_t
>
timestep
)
const
{
out
<<
"<DataArray Name=
\"
"
<<
fct
.
name
()
<<
"
\"
type=
\"
"
<<
to_string
(
fct
.
type
())
<<
"
\"
"
<<
" NumberOfComponents=
\"
"
<<
fct
.
ncomps
()
<<
"
\"
format=
\"
"
<<
(
format_
==
Vtk
::
ASCII
?
"ascii
\"
"
:
"appended
\"
"
);
...
...
@@ -106,7 +106,7 @@ void VtkWriterInterface<GV,DC>
template
<
class
GV
,
class
DC
>
void
VtkWriterInterface
<
GV
,
DC
>
::
writePoints
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
)
const
s
td
::
optional
<
std
::
size_t
>
timestep
)
const
{
out
<<
"<DataArray type=
\"
"
<<
to_string
(
datatype_
)
<<
"
\"
"
<<
" NumberOfComponents=
\"
3
\"
format=
\"
"
<<
(
format_
==
Vtk
::
ASCII
?
"ascii
\"
"
:
"appended
\"
"
);
...
...
dune/vtk/writers/vtkrectilineargridwriter.hh
View file @
28967950
...
...
@@ -42,7 +42,7 @@ namespace Dune
virtual
void
writeParallelFile
(
std
::
ofstream
&
out
,
std
::
string
const
&
pfilename
,
int
size
)
const
override
;
void
writeCoordinates
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
s
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
template
<
class
T
>
std
::
array
<
std
::
uint64_t
,
3
>
writeCoordinatesAppended
(
std
::
ofstream
&
out
)
const
;
...
...
dune/vtk/writers/vtkrectilineargridwriter.impl.hh
View file @
28967950
...
...
@@ -116,7 +116,7 @@ void VtkRectilinearGridWriter<GV,DC>
template
<
class
GV
,
class
DC
>
void
VtkRectilinearGridWriter
<
GV
,
DC
>
::
writeCoordinates
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
)
const
s
td
::
optional
<
std
::
size_t
>
timestep
)
const
{
std
::
string
names
=
"xyz"
;
if
(
format_
==
Vtk
::
ASCII
)
{
...
...
dune/vtk/writers/vtkunstructuredgridwriter.hh
View file @
28967950
...
...
@@ -74,11 +74,11 @@ namespace Dune
// vector `offsets`.
void
writeCells
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
s
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
void
writePointIds
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
s
td
::
optional
<
std
::
size_t
>
timestep
=
{})
const
;
private:
using
Super
::
dataCollector_
;
...
...
dune/vtk/writers/vtkunstructuredgridwriter.impl.hh
View file @
28967950
...
...
@@ -281,7 +281,7 @@ void VtkUnstructuredGridWriter<GV,DC>
template
<
class
GV
,
class
DC
>
void
VtkUnstructuredGridWriter
<
GV
,
DC
>
::
writeCells
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
)
const
s
td
::
optional
<
std
::
size_t
>
timestep
)
const
{
if
(
format_
==
Vtk
::
ASCII
)
{
auto
cells
=
dataCollector_
->
cells
();
...
...
@@ -337,7 +337,7 @@ template <class GV, class DC>
void
VtkUnstructuredGridWriter
<
GV
,
DC
>
::
writePointIds
(
std
::
ofstream
&
out
,
std
::
vector
<
pos_type
>&
offsets
,
S
td
::
optional
<
std
::
size_t
>
timestep
)
const
s
td
::
optional
<
std
::
size_t
>
timestep
)
const
{
auto
ids
=
dataCollector_
->
pointIds
();
if
(
ids
.
empty
())
...
...
Write
Preview
Supports
Markdown
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