Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
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
dumux-repositories
dumux
Commits
b4aa3f06
Commit
b4aa3f06
authored
7 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[staggered][io] Complete faceWriter
* now allows writing out any Scalar valued or GlobalPos-type data on face
parent
ab2b1f23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumux/io/pointcloudvtkwriter.hh
+5
-5
5 additions, 5 deletions
dumux/io/pointcloudvtkwriter.hh
dumux/io/staggeredvtkoutputmodule.hh
+16
-9
16 additions, 9 deletions
dumux/io/staggeredvtkoutputmodule.hh
with
21 additions
and
14 deletions
dumux/io/pointcloudvtkwriter.hh
+
5
−
5
View file @
b4aa3f06
...
@@ -178,10 +178,10 @@ public:
...
@@ -178,10 +178,10 @@ public:
* \param name The name of the data set
* \param name The name of the data set
* \param ncomps The number of components of the data set
* \param ncomps The number of components of the data set
*/
*/
void
addPointData
(
const
std
::
vector
<
Scalar
>&
v
,
const
std
::
string
&
name
,
int
ncomps
=
1
)
void
addPointData
(
const
std
::
vector
<
Scalar
>&
v
,
const
std
::
string
&
name
)
{
{
assert
(
v
.
size
()
==
ncomps
*
coordinates_
.
size
());
assert
(
v
.
size
()
==
coordinates_
.
size
());
scalarPointData_
.
push_back
(
ScalarFunction
(
v
,
name
,
ncomps
));
scalarPointData_
.
push_back
(
ScalarFunction
(
v
,
name
,
1
));
}
}
/*!
/*!
...
@@ -191,10 +191,10 @@ public:
...
@@ -191,10 +191,10 @@ public:
* \param name The name of the data set
* \param name The name of the data set
* \param ncomps The number of components of the data set
* \param ncomps The number of components of the data set
*/
*/
void
addPointData
(
const
std
::
vector
<
GlobalPosition
>&
v
,
const
std
::
string
&
name
,
int
ncomps
=
1
)
void
addPointData
(
const
std
::
vector
<
GlobalPosition
>&
v
,
const
std
::
string
&
name
)
{
{
assert
(
v
.
size
()
==
coordinates_
.
size
());
assert
(
v
.
size
()
==
coordinates_
.
size
());
vectorPointData_
.
push_back
(
VectorFunction
(
v
,
name
,
ncomps
));
vectorPointData_
.
push_back
(
VectorFunction
(
v
,
name
,
3
));
}
}
/*!
/*!
...
...
This diff is collapsed.
Click to expand it.
dumux/io/staggeredvtkoutputmodule.hh
+
16
−
9
View file @
b4aa3f06
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
namespace
Dumux
namespace
Dumux
{
{
/*!
/*!
* \ingroup InputOutput
* \ingroup InputOutput
* \brief A VTK output module to simplify writing dumux simulation data to VTK format
* \brief A VTK output module to simplify writing dumux simulation data to VTK format
...
@@ -62,9 +63,6 @@ class StaggeredVtkOutputModule : public VtkOutputModule<TypeTag>
...
@@ -62,9 +63,6 @@ class StaggeredVtkOutputModule : public VtkOutputModule<TypeTag>
typename
DofTypeIndices
::
CellCenterIdx
cellCenterIdx
;
typename
DofTypeIndices
::
CellCenterIdx
cellCenterIdx
;
typename
DofTypeIndices
::
FaceIdx
faceIdx
;
typename
DofTypeIndices
::
FaceIdx
faceIdx
;
struct
PriVarScalarDataInfo
{
unsigned
int
pvIdx
;
std
::
string
name
;
};
struct
PriVarVectorDataInfo
{
std
::
vector
<
unsigned
int
>
pvIdx
;
std
::
string
name
;
};
struct
FaceVarScalarDataInfo
{
std
::
function
<
Scalar
(
const
FaceVariables
&
)
>
get
;
std
::
string
name
;
};
struct
FaceVarScalarDataInfo
{
std
::
function
<
Scalar
(
const
FaceVariables
&
)
>
get
;
std
::
string
name
;
};
struct
FaceVarVectorDataInfo
{
std
::
function
<
GlobalPosition
(
const
SubControlVolumeFace
&
scvf
,
const
FaceVariables
&
)
>
get
;
std
::
string
name
;
};
struct
FaceVarVectorDataInfo
{
std
::
function
<
GlobalPosition
(
const
SubControlVolumeFace
&
scvf
,
const
FaceVariables
&
)
>
get
;
std
::
string
name
;
};
...
@@ -101,11 +99,19 @@ public:
...
@@ -101,11 +99,19 @@ public:
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
template
<
typename
Vector
>
template
<
typename
Vector
>
void
addFaceField
(
const
Vector
&
v
,
const
std
::
string
&
name
,
int
nComp
=
1
)
void
addFaceField
(
const
Vector
&
v
,
const
std
::
string
&
name
)
{
{
static_assert
(
std
::
is_same
<
Vector
,
std
::
vector
<
Scalar
>>::
value
||
std
::
is_same
<
Vector
,
std
::
vector
<
GlobalPosition
>>::
value
,
"Only vectors of Scalar or GlobalPosition are supported"
);
if
(
v
.
size
()
==
this
->
gridGeom_
.
gridView
().
size
(
1
))
if
(
v
.
size
()
==
this
->
gridGeom_
.
gridView
().
size
(
1
))
int
x
;
{
// fields_.emplace_back(gridGeom_.gridView(), gridGeom_.elementMapper(), v, name, nComp, 0);
if
(
!
coordinatesInitialized_
)
updateCoordinates_
();
faceWriter_
->
addPointData
(
v
,
name
);
}
else
else
DUNE_THROW
(
Dune
::
RangeError
,
"Size mismatch of added field!"
);
DUNE_THROW
(
Dune
::
RangeError
,
"Size mismatch of added field!"
);
}
}
...
@@ -200,11 +206,12 @@ private:
...
@@ -200,11 +206,12 @@ private:
if
(
!
faceVarVectorDataInfo_
.
empty
())
if
(
!
faceVarVectorDataInfo_
.
empty
())
for
(
std
::
size_t
i
=
0
;
i
<
faceVarVectorDataInfo_
.
size
();
++
i
)
for
(
std
::
size_t
i
=
0
;
i
<
faceVarVectorDataInfo_
.
size
();
++
i
)
faceWriter_
->
addPointData
(
faceVarVectorData
[
i
],
faceVarVectorDataInfo_
[
i
].
name
,
3
);
faceWriter_
->
addPointData
(
faceVarVectorData
[
i
],
faceVarVectorDataInfo_
[
i
].
name
);
sequenceWriter_
.
write
(
time
);
sequenceWriter_
.
write
(
time
);
// faceScalarFields_.clear();
coordinates_
.
clear
();
// faceVectorFields_.clear();
coordinates_
.
shrink_to_fit
();
coordinatesInitialized_
=
false
;
}
}
...
...
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