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
49c95864
Commit
49c95864
authored
8 years ago
by
Kilian Weishaupt
Committed by
Timo Koch
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[staggeredGrid][model] Add tentative velocity output
parent
1b6083dc
No related branches found
No related tags found
2 merge requests
!617
[WIP] Next
,
!370
Feature/staggered grid
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/freeflow/staggered/model.hh
+60
-51
60 additions, 51 deletions
dumux/freeflow/staggered/model.hh
with
60 additions
and
51 deletions
dumux/freeflow/staggered/model.hh
+
60
−
51
View file @
49c95864
...
@@ -89,57 +89,66 @@ public:
...
@@ -89,57 +89,66 @@ public:
void
addOutputVtkFields
(
const
SolutionVector
&
sol
,
void
addOutputVtkFields
(
const
SolutionVector
&
sol
,
MultiWriter
&
writer
)
MultiWriter
&
writer
)
{
{
// TODO: implement vtk output
// TODO: implement vtk output properly, account for 3d
// // typedef Dune::BlockVector<Dune::FieldVector<double, dimWorld> > VectorField;
//
// create the required scalar fields
// // create the required scalar fields
const
auto
numElements
=
this
->
gridView_
().
size
(
0
);
// unsigned numDofs = this->numDofs();
auto
*
p
=
writer
.
allocateManagedBuffer
(
numElements
);
// auto *p = writer.allocateManagedBuffer(numDofs);
// // VectorField *velocity = writer.template allocateManagedBuffer<double, dimWorld>(numDofs);
auto
*
v_x_pos
=
writer
.
allocateManagedBuffer
(
numElements
);
// // ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_());
auto
*
v_x_neg
=
writer
.
allocateManagedBuffer
(
numElements
);
//
auto
*
v_y_pos
=
writer
.
allocateManagedBuffer
(
numElements
);
// // if (velocityOutput.enableOutput())
auto
*
v_y_neg
=
writer
.
allocateManagedBuffer
(
numElements
);
// // {
// // // initialize velocity field
auto
*
rank
=
writer
.
allocateManagedBuffer
(
numElements
);
// // for (unsigned int i = 0; i < numDofs; ++i)
// // {
for
(
const
auto
&
element
:
elements
(
this
->
gridView_
(),
Dune
::
Partitions
::
interior
))
// // (*velocity)[i] = double(0);
{
// // }
auto
eIdx
=
this
->
elementMapper
().
index
(
element
);
// // }
(
*
rank
)[
eIdx
]
=
this
->
gridView_
().
comm
().
rank
();
//
// unsigned numElements = this->gridView_().size(0);
// get the local fv geometry
// auto *rank = writer.allocateManagedBuffer(numElements);
auto
fvGeometry
=
localView
(
this
->
globalFvGeometry
());
//
fvGeometry
.
bindElement
(
element
);
// for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior))
// {
auto
elemVolVars
=
localView
(
this
->
curGlobalVolVars
());
// auto eIdx = this->elementMapper().index(element);
elemVolVars
.
bindElement
(
element
,
fvGeometry
,
this
->
curSol
());
// (*rank)[eIdx] = this->gridView_().comm().rank();
//
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
// // get the local fv geometry
{
// auto fvGeometry = localView(this->globalFvGeometry());
const
auto
&
volVars
=
elemVolVars
[
scv
];
// fvGeometry.bindElement(element);
auto
dofIdxGlobal
=
scv
.
dofIndex
();
//
// auto elemVolVars = localView(this->curGlobalVolVars());
(
*
p
)[
dofIdxGlobal
]
=
volVars
.
pressure
();
// elemVolVars.bindElement(element, fvGeometry, this->curSol());
//
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
// for (auto&& scv : scvs(fvGeometry))
{
// {
auto
&
origFaceVars
=
this
->
curGlobalFaceVars
().
faceVars
(
scvf
.
dofIndexSelf
());
// const auto& volVars = elemVolVars[scv];
auto
dirIdx
=
scvf
.
directionIndex
();
// auto dofIdxGlobal = scv.dofIndex();
//
if
(
scvf
.
unitOuterNormal
()[
dirIdx
]
>
0.0
)
// (*p)[dofIdxGlobal] = volVars.pressure();
{
// }
if
(
dirIdx
==
0
)
//
(
*
v_x_pos
)
=
origFaceVars
.
velocity
();
// // velocity output
if
(
dirIdx
==
1
)
// //velocityOutput.calculateVelocity(*velocity, elemVolVars, fvGeometry, element, /*phaseIdx=*/0);
(
*
v_y_pos
)
=
origFaceVars
.
velocity
();
// }
}
//
else
// writer.attachDofData(*p, "p", isBox);
{
// // if (velocityOutput.enableOutput())
if
(
dirIdx
==
0
)
// // {
(
*
v_x_neg
)
=
origFaceVars
.
velocity
();
// // writer.attachDofData(*velocity, "velocity", isBox, dim);
if
(
dirIdx
==
1
)
// // }
(
*
v_y_neg
)
=
origFaceVars
.
velocity
();
// writer.attachCellData(*rank, "process rank");
}
}
}
}
writer
.
attachDofData
(
*
p
,
"p"
,
isBox
);
writer
.
attachDofData
(
*
v_x_pos
,
"v_x_pos"
,
isBox
);
writer
.
attachDofData
(
*
v_x_neg
,
"v_x_neg"
,
isBox
);
writer
.
attachDofData
(
*
v_y_pos
,
"v_y_pos"
,
isBox
);
writer
.
attachDofData
(
*
v_y_neg
,
"v_y_neg"
,
isBox
);
writer
.
attachCellData
(
*
rank
,
"process rank"
);
}
}
...
...
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