version 3.10-dev
porousmediumflow/boxdfm/vtkoutputmodule.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef POROUSMEDIUMFLOW_BOXDFM_VTK_OUTPUT_MODULE_HH
14#define POROUSMEDIUMFLOW_BOXDFM_VTK_OUTPUT_MODULE_HH
15
16#include <set>
17
18#include <dune/grid/common/gridfactory.hh>
19#include <dune/grid/common/mcmgmapper.hh>
20
22
23namespace Dumux {
24
42template<class GridVariables, class SolutionVector, class FractureGrid>
43class BoxDfmVtkOutputModule : public VtkOutputModule<GridVariables, SolutionVector>
44{
46 using GridGeometry = typename GridVariables::GridGeometry;
47 using VV = typename GridVariables::VolumeVariables;
48 using FluidSystem = typename VV::FluidSystem;
49 using Scalar = typename GridVariables::Scalar;
50
51 using GridView = typename GridGeometry::GridView;
52 using FractureGridView = typename FractureGrid::LeafGridView;
53 using FractureMapper = Dune::MultipleCodimMultipleGeomTypeMapper<FractureGridView>;
54
55 enum
56 {
57 dim = GridView::dimension,
58 dimWorld = GridView::dimensionworld
59 };
60
61 using GridIndexType = typename GridView::IndexSet::IndexType;
62 using Element = typename GridView::template Codim<0>::Entity;
63 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
64
65 using Field = Vtk::template Field<GridView>;
66 using FractureField = Vtk::template Field<FractureGridView>;
67
68 static_assert(dim > 1, "Box-Dfm output only works for dim > 1");
69 static_assert(FractureGrid::dimension == int(dim-1), "Fracture grid must be of codimension one!");
70 static_assert(FractureGrid::dimensionworld == int(dimWorld), "Fracture grid has to has the same coordinate dimension!");
71 static_assert(GridGeometry::discMethod == DiscretizationMethods::box, "Box-Dfm output module can only be used with the box scheme!");
72public:
73
75 template< class FractureGridAdapter >
77 const SolutionVector& sol,
78 const std::string& name,
79 const FractureGridAdapter& fractureGridAdapter,
80 const std::string& paramGroup = "",
81 Dune::VTK::DataMode dm = Dune::VTK::conforming,
82 bool verbose = true)
84 {
85 // create the fracture grid and all objects needed on it
86 initializeFracture_(fractureGridAdapter);
87 }
88
92
98 void write(double time, Dune::VTK::OutputType type = Dune::VTK::ascii)
99 {
100 Dune::Timer timer;
101
102 // write to file depending on data mode
103 const auto dm = this->dataMode();
104 if (dm == Dune::VTK::conforming)
105 writeConforming_(time, type);
106 else if (dm == Dune::VTK::nonconforming)
107 writeNonConforming_(time, type);
108 else
109 DUNE_THROW(Dune::NotImplemented, "Output for provided vtk data mode");
110
112 timer.stop();
113 if (this->verbose())
114 std::cout << "Writing output for problem \"" << this->name() << "\". Took " << timer.elapsed() << " seconds." << std::endl;
115 }
116
117private:
119 void writeConforming_(double time, Dune::VTK::OutputType type)
120 {
124
125 // instantiate the velocity output
126 std::vector<typename ParentType::VelocityOutput::VelocityVector> velocity;
127
128 // process rank
129 static bool addProcessRank = getParamFromGroup<bool>(this->paramGroup(), "Vtk.AddProcessRank");
130 std::vector<double> rank;
131
132 // volume variable data
133 std::vector<std::vector<Scalar>> volVarScalarData;
134 std::vector<std::vector<Scalar>> volVarScalarDataFracture;
135 std::vector<std::vector<GlobalPosition>> volVarVectorData;
136 std::vector<std::vector<GlobalPosition>> volVarVectorDataFracture;
137
138 // some references for convenience
139 const auto& gridView = this->gridGeometry().gridView();
140 const auto& fractureGridView = fractureGrid_->leafGridView();
141 const auto& volVarScalarDataInfo = this->volVarScalarDataInfo();
142 const auto& volVarVectorDataInfo = this->volVarVectorDataInfo();
143
145 if (!volVarScalarDataInfo.empty()
146 || !volVarVectorDataInfo.empty()
147 || !this->fields().empty()
148 || this->velocityOutput().enableOutput()
149 || addProcessRank)
150 {
151 const auto numCells = gridView.size(0);
152 const auto numDofs = gridView.size(dim);
153 const auto numFractureVert = fractureGridView.size(FractureGridView::dimension);
154
155 // get fields for all volume variables
156 if (!this->volVarScalarDataInfo().empty())
157 {
158 volVarScalarData.resize(volVarScalarDataInfo.size(), std::vector<Scalar>(numDofs));
159 volVarScalarDataFracture.resize(volVarScalarDataInfo.size(), std::vector<Scalar>(numFractureVert));
160 }
161 if (!this->volVarVectorDataInfo().empty())
162 {
163 volVarVectorData.resize(volVarVectorDataInfo.size(), std::vector<GlobalPosition>(numDofs));
164 volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), std::vector<GlobalPosition>(numFractureVert));
165 }
166
167 if (this->velocityOutput().enableOutput())
168 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
169 velocity[phaseIdx].resize(numDofs);
170
171 // maybe allocate space for the process rank
172 if (addProcessRank) rank.resize(numCells);
173
174 auto fvGeometry = localView(this->gridGeometry());
175 auto elemVolVars = localView(this->gridVariables().curGridVolVars());
176 auto elemFluxVarsCache = localView(this->gridVariables().gridFluxVarsCache());
177 for (const auto& element : elements(gridView, Dune::Partitions::interior))
178 {
179 const auto eIdxGlobal = this->gridGeometry().elementMapper().index(element);
180
181 // If velocity output is enabled we need to bind to the whole stencil
182 // otherwise element-local data is sufficient
183 if (this->velocityOutput().enableOutput())
184 {
185 fvGeometry.bind(element);
186 elemVolVars.bind(element, fvGeometry, this->sol());
187 }
188 else
189 {
190 fvGeometry.bindElement(element);
191 elemVolVars.bindElement(element, fvGeometry, this->sol());
192 }
193
194 if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty())
195 {
196 for (auto&& scv : scvs(fvGeometry))
197 {
198 const auto dofIdxGlobal = scv.dofIndex();
199 const auto& volVars = elemVolVars[scv];
200
201 if (!scv.isOnFracture())
202 {
203 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
204 volVarScalarData[i][dofIdxGlobal] = volVarScalarDataInfo[i].get(volVars);
205 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
206 volVarVectorData[i][dofIdxGlobal] = volVarVectorDataInfo[i].get(volVars);
207 }
208 else
209 {
210 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
211 volVarScalarDataFracture[i][vertexToFractureVertexIdx_[dofIdxGlobal]] = volVarScalarDataInfo[i].get(volVars);
212 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
213 volVarVectorDataFracture[i][vertexToFractureVertexIdx_[dofIdxGlobal]] = volVarVectorDataInfo[i].get(volVars);
214 }
215 }
216 }
217
218 // velocity output
219 if (this->velocityOutput().enableOutput())
220 {
221 elemFluxVarsCache.bind(element, fvGeometry, elemVolVars);
222
223 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
224 this->velocityOutput().calculateVelocity(velocity[phaseIdx], element, fvGeometry, elemVolVars, elemFluxVarsCache, phaseIdx);
225 }
226
228 if (addProcessRank)
229 rank[eIdxGlobal] = static_cast<double>(gridView.comm().rank());
230 }
231
235
236 // volume variables if any
237 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
238 {
239 this->sequenceWriter().addVertexData(volVarScalarData[i], volVarScalarDataInfo[i].name);
240 fractureSequenceWriter_->addVertexData(volVarScalarDataFracture[i], volVarScalarDataInfo[i].name);
241 }
242
243 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
244 {
245 this->sequenceWriter().addVertexData( Field(gridView, this->gridGeometry().vertexMapper(), volVarVectorData[i],
246 volVarVectorDataInfo[i].name, /*numComp*/dimWorld, /*codim*/dim).get() );
247 fractureSequenceWriter_->addVertexData( FractureField(fractureGridView, *fractureVertexMapper_, volVarVectorDataFracture[i],
248 volVarVectorDataInfo[i].name, /*numComp*/dimWorld, /*codim*/dim-1).get() );
249 }
250
251 // the velocity field
252 if (this->velocityOutput().enableOutput())
253 {
254 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
255 this->sequenceWriter().addVertexData( Field(gridView, this->gridGeometry().vertexMapper(), velocity[phaseIdx],
256 "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)",
257 /*numComp*/dimWorld, /*codim*/dim).get() );
258 }
259
260 // the process rank
261 if (addProcessRank)
262 this->sequenceWriter().addCellData( Field(gridView, this->gridGeometry().elementMapper(), rank,
263 "process rank", /*numComp*/1, /*codim*/0).get() );
264
265 // also register additional (non-standardized) user fields if any (only on matrix grid)
266 for (auto&& field : this->fields())
267 {
268 if (field.codim() == 0)
269 this->sequenceWriter().addCellData(field.get());
270 else if (field.codim() == dim)
271 this->sequenceWriter().addVertexData(field.get());
272 else
273 DUNE_THROW(Dune::RangeError, "Cannot add wrongly sized vtk scalar field!");
274 }
275 }
276
280 this->sequenceWriter().write(time, type);
281 fractureSequenceWriter_->write(time, type);
282
286 this->writer().clear();
287 fractureWriter_->clear();
288 }
289
291 void writeNonConforming_(double time, Dune::VTK::OutputType type)
292 {
296
297 // instantiate the velocity output
298 std::vector<typename ParentType::VelocityOutput::VelocityVector> velocity;
299
300 // process rank
301 static bool addProcessRank = getParamFromGroup<bool>(this->paramGroup(), "Vtk.AddProcessRank");
302 std::vector<double> rank;
303
304 // volume variable data (indexing: volvardata/element/localcorner)
305 using ScalarDataContainer = std::vector< std::vector<Scalar> >;
306 using VectorDataContainer = std::vector< std::vector<GlobalPosition> >;
307 std::vector< ScalarDataContainer > volVarScalarData;
308 std::vector< ScalarDataContainer > volVarScalarDataFracture;
309 std::vector< VectorDataContainer > volVarVectorData;
310 std::vector< VectorDataContainer > volVarVectorDataFracture;
311
312 // some references for convenience
313 const auto& gridView = this->gridGeometry().gridView();
314 const auto& fractureGridView = fractureGrid_->leafGridView();
315 const auto& volVarScalarDataInfo = this->volVarScalarDataInfo();
316 const auto& volVarVectorDataInfo = this->volVarVectorDataInfo();
317
319 if (!volVarScalarDataInfo.empty()
320 || !volVarVectorDataInfo.empty()
321 || !this->fields().empty()
322 || this->velocityOutput().enableOutput()
323 || addProcessRank)
324 {
325 const auto numCells = gridView.size(0);
326 const auto numDofs = gridView.size(dim);
327 const auto numFractureCells = fractureGridView.size(0);
328
329 // get fields for all volume variables
330 if (!this->volVarScalarDataInfo().empty())
331 {
332 volVarScalarData.resize(volVarScalarDataInfo.size(), ScalarDataContainer(numCells));
333 volVarScalarDataFracture.resize(volVarScalarDataInfo.size(), ScalarDataContainer(numFractureCells));
334 }
335 if (!this->volVarVectorDataInfo().empty())
336 {
337 volVarVectorData.resize(volVarVectorDataInfo.size(), VectorDataContainer(numCells));
338 volVarVectorDataFracture.resize(volVarVectorDataInfo.size(), VectorDataContainer(numFractureCells));
339 }
340
341 if (this->velocityOutput().enableOutput())
342 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
343 velocity[phaseIdx].resize(numDofs);
344
345 // maybe allocate space for the process rank
346 if (addProcessRank) rank.resize(numCells);
347
348 for (const auto& element : elements(gridView, Dune::Partitions::interior))
349 {
350 const auto eIdxGlobal = this->gridGeometry().elementMapper().index(element);
351 const auto numCorners = element.subEntities(dim);
352
353 auto fvGeometry = localView(this->gridGeometry());
354 auto elemVolVars = localView(this->gridVariables().curGridVolVars());
355
356 // resize element-local data containers (for bulk grid)
357 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
358 volVarScalarData[i][eIdxGlobal].resize(numCorners);
359 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
360 volVarVectorData[i][eIdxGlobal].resize(numCorners);
361
362 // If velocity output is enabled we need to bind to the whole stencil
363 // otherwise element-local data is sufficient
364 if (this->velocityOutput().enableOutput())
365 {
366 fvGeometry.bind(element);
367 elemVolVars.bind(element, fvGeometry, this->sol());
368 }
369 else
370 {
371 fvGeometry.bindElement(element);
372 elemVolVars.bindElement(element, fvGeometry, this->sol());
373 }
374
375 if (!volVarScalarDataInfo.empty() || !volVarVectorDataInfo.empty())
376 {
377 for (auto&& scv : scvs(fvGeometry))
378 {
379 const auto& volVars = elemVolVars[scv];
380
381 if (!scv.isOnFracture())
382 {
383 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
384 volVarScalarData[i][eIdxGlobal][scv.localDofIndex()] = volVarScalarDataInfo[i].get(volVars);
385 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
386 volVarVectorData[i][eIdxGlobal][scv.localDofIndex()] = volVarVectorDataInfo[i].get(volVars);
387 }
388 else
389 {
390 const auto fIdx = scv.facetIndexInElement();
391 const auto& localMap = fractureElementMap_[eIdxGlobal];
392 const auto fracEIdx = std::find_if(localMap.begin(), localMap.end(), [fIdx] (const auto& p) { return p.first == fIdx; })->second;
393 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
394 volVarScalarDataFracture[i][fracEIdx].push_back(volVarScalarDataInfo[i].get(volVars));
395 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
396 volVarVectorDataFracture[i][fracEIdx].push_back(volVarVectorDataInfo[i].get(volVars));
397 }
398 }
399 }
400
401 // velocity output
402 if (this->velocityOutput().enableOutput())
403 {
404 const auto elemFluxVarsCache = localView(this->gridVariables().gridFluxVarsCache()).bind(element, fvGeometry, elemVolVars);
405
406 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
407 this->velocityOutput().calculateVelocity(velocity[phaseIdx], element, fvGeometry, elemVolVars, elemFluxVarsCache, phaseIdx);
408 }
409
411 if (addProcessRank)
412 rank[eIdxGlobal] = static_cast<double>(gridView.comm().rank());
413 }
414
418
419 // volume variables if any
420 for (std::size_t i = 0; i < volVarScalarDataInfo.size(); ++i)
421 {
422 this->sequenceWriter().addVertexData( Field(gridView, this->gridGeometry().elementMapper(), volVarScalarData[i],
423 volVarScalarDataInfo[i].name, /*numComp*/1, /*codim*/dim,
424 /*nonconforming*/this->dataMode()).get() );
425 fractureSequenceWriter_->addVertexData( FractureField(fractureGridView, *fractureElementMapper_, volVarScalarDataFracture[i],
426 volVarScalarDataInfo[i].name, /*numComp*/1, /*codim*/dim-1,
427 /*nonconforming*/this->dataMode()).get() );
428 }
429
430 for (std::size_t i = 0; i < volVarVectorDataInfo.size(); ++i)
431 {
432 this->sequenceWriter().addVertexData( Field(gridView, this->gridGeometry().elementMapper(), volVarVectorData[i],
433 volVarVectorDataInfo[i].name, /*numComp*/dimWorld, /*codim*/dim,
434 /*nonconforming*/this->dataMode()).get() );
435 fractureSequenceWriter_->addVertexData( FractureField(fractureGridView, *fractureElementMapper_, volVarVectorDataFracture[i],
436 volVarVectorDataInfo[i].name, /*numComp*/dimWorld, /*codim*/dim-1,
437 /*nonconforming*/this->dataMode()).get() );
438 }
439
440 // the velocity field
441 if (this->velocityOutput().enableOutput())
442 {
443 for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx)
444 this->sequenceWriter().addVertexData( Field(gridView, this->gridGeometry().vertexMapper(), velocity[phaseIdx],
445 "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)",
446 /*numComp*/dimWorld, /*codim*/dim).get() );
447 }
448
449 // the process rank
450 if (addProcessRank)
451 this->sequenceWriter().addCellData( Field(gridView, this->gridGeometry().elementMapper(), rank,
452 "process rank", /*numComp*/1, /*codim*/0).get() );
453
454 // also register additional (non-standardized) user fields if any (only on matrix grid)
455 for (auto&& field : this->fields())
456 {
457 if (field.codim() == 0)
458 this->sequenceWriter().addCellData(field.get());
459 else if (field.codim() == dim)
460 this->sequenceWriter().addVertexData(field.get());
461 else
462 DUNE_THROW(Dune::RangeError, "Cannot add wrongly sized vtk scalar field!");
463 }
464 }
465
469 this->sequenceWriter().write(time, type);
470 fractureSequenceWriter_->write(time, type);
471
475 this->writer().clear();
476 fractureWriter_->clear();
477 }
478
480 template< class FractureGridAdapter >
481 void initializeFracture_(const FractureGridAdapter& fractureGridAdapter)
482 {
483 const auto& gridGeometry = this->gridGeometry();
484 const auto& gridView = gridGeometry.gridView();
485 Dune::GridFactory<FractureGrid> gridFactory;
486
487 // insert fracture vertices
488 std::size_t fracVertexCount = 0;
489 vertexToFractureVertexIdx_.resize(gridView.size(dim));
490 for (const auto& v : vertices(gridView))
491 {
492 if (fractureGridAdapter.isOnFacetGrid(v))
493 {
494 gridFactory.insertVertex(v.geometry().center());
495 vertexToFractureVertexIdx_[gridGeometry.vertexMapper().index(v)] = fracVertexCount++;
496 }
497 }
498
499 // insert fracture elements
500 std::size_t fractureElementCount = 0;
501 fractureElementMap_.resize(gridView.size(0));
502 std::set< std::pair<GridIndexType, unsigned int> > handledFacets;
503 for (const auto& element : elements(gridView))
504 {
505 const auto eIdxGlobal = gridGeometry.elementMapper().index(element);
506 const auto refElement = referenceElement(element);
507
508 for (const auto& is : intersections(gridView, element))
509 {
510 // obtain all vertex indices on this intersection
511 const auto& isGeometry = is.geometry();
512 const auto numCorners = isGeometry.corners();
513 const auto indexInInside = is.indexInInside();
514
515 std::vector<GridIndexType> isVertexIndices(numCorners);
516 for (unsigned int i = 0; i < numCorners; ++i)
517 isVertexIndices[i] = gridGeometry.vertexMapper().subIndex(element,
518 refElement.subEntity(indexInInside, 1, i, dim),
519 dim);
520
521 // determine if this is a fracture facet & if it has to be inserted
522 bool insertFacet = false;
523 if (fractureGridAdapter.composeFacetElement(isVertexIndices))
524 {
525 insertFacet = true;
526 if (!is.boundary())
527 {
528 // only proceed if facet has not been handled yet
529 const auto outsideEIdx = gridGeometry.elementMapper().index(is.outside());
530 const auto idxInOutside = is.indexInOutside();
531 const auto pair = std::make_pair(outsideEIdx, idxInOutside);
532 if (handledFacets.count( pair ) != 0)
533 {
534 insertFacet = false;
535
536 // obtain the fracture grid elem idx from outside map and insert to map
537 const auto& outsideMap = fractureElementMap_[outsideEIdx];
538 auto it = std::find_if(outsideMap.begin(), outsideMap.end(), [idxInOutside] (const auto& p) { return p.first == idxInOutside; });
539 fractureElementMap_[eIdxGlobal].push_back( std::make_pair(indexInInside, it->second) );
540 }
541 }
542 }
543
544 if (insertFacet)
545 {
546 // transform intersection vertex indices to frac grid indices
547 std::for_each( isVertexIndices.begin(),
548 isVertexIndices.end(),
549 [&] (auto& idx) { idx = this->vertexToFractureVertexIdx_[idx]; } );
550
551 // insert the element
552 gridFactory.insertElement(isGeometry.type(), isVertexIndices);
553
554 // insert to set of handled facets
555 handledFacets.insert( std::make_pair(eIdxGlobal, indexInInside) );
556 fractureElementMap_[eIdxGlobal].push_back( std::make_pair(indexInInside, fractureElementCount) );
557 fractureElementCount++;
558 }
559 }
560 }
561
562 // make grid and get grid view
563 fractureGrid_ = std::shared_ptr<FractureGrid>(gridFactory.createGrid());
564
565 // update fracture mappers
566 const auto& fractureGridView = fractureGrid_->leafGridView();
567 fractureVertexMapper_ = std::make_unique<FractureMapper>(fractureGridView, Dune::mcmgVertexLayout());
568 fractureElementMapper_ = std::make_unique<FractureMapper>(fractureGridView, Dune::mcmgElementLayout());
569
570 // obtain map fracture insertion indices -> fracture grid indices
571 std::vector<GridIndexType> insToVertexIdx(fractureGridView.size(FractureGridView::dimension));
572 std::vector<GridIndexType> insToElemIdx(fractureGridView.size(0));
573 for (const auto& v : vertices(fractureGridView)) insToVertexIdx[ gridFactory.insertionIndex(v) ] = fractureVertexMapper_->index(v);
574 for (const auto& e : elements(fractureGridView)) insToElemIdx[ gridFactory.insertionIndex(e) ] = fractureElementMapper_->index(e);
575
576 // update vertex index map
577 for (GridIndexType dofIdx = 0; dofIdx < gridView.size(GridView::dimension); ++dofIdx)
578 if (gridGeometry.dofOnFracture(dofIdx))
579 vertexToFractureVertexIdx_[dofIdx] = insToVertexIdx[ vertexToFractureVertexIdx_[dofIdx] ];
580
581 // update fracture element map
582 for (auto& elemLocalMap : fractureElementMap_)
583 for (auto& dataPair : elemLocalMap)
584 dataPair.second = insToElemIdx[ dataPair.second ];
585
586 // instantiate writers for the fracture
587 fractureWriter_ = std::make_shared< Dune::VTKWriter<FractureGridView> >(fractureGridView, this->dataMode());
588 fractureSequenceWriter_ = std::make_unique< Dune::VTKSequenceWriter<FractureGridView> >(fractureWriter_, this->name() + "_fracture");
589 }
590
591 std::shared_ptr<FractureGrid> fractureGrid_;
592
593 std::unique_ptr<FractureMapper> fractureVertexMapper_;
594 std::unique_ptr<FractureMapper> fractureElementMapper_;
595
596 std::shared_ptr<Dune::VTKWriter<FractureGridView>> fractureWriter_;
597 std::unique_ptr< Dune::VTKSequenceWriter<FractureGridView> > fractureSequenceWriter_;
598
599 // maps to a bulk grid vertex the vertex index within the fracture grid
600 std::vector<GridIndexType> vertexToFractureVertexIdx_;
601
602 // maps to the local facet indices of an element the corresponding fracture element indices
603 std::vector< std::vector<std::pair<GridIndexType, unsigned int>> > fractureElementMap_;
604};
605
606} // end namespace Dumux
607
608#endif
A VTK output module to simplify writing dumux simulation data to VTK format.
Definition: porousmediumflow/boxdfm/vtkoutputmodule.hh:44
void write(double time, Dune::VTK::OutputType type=Dune::VTK::ascii)
Writing data.
Definition: porousmediumflow/boxdfm/vtkoutputmodule.hh:98
BoxDfmVtkOutputModule(const GridVariables &gridVariables, const SolutionVector &sol, const std::string &name, const FractureGridAdapter &fractureGridAdapter, const std::string &paramGroup="", Dune::VTK::DataMode dm=Dune::VTK::conforming, bool verbose=true)
The constructor.
Definition: porousmediumflow/boxdfm/vtkoutputmodule.hh:76
virtual int numFluidPhases() const
returns the number of phases
Definition: io/velocityoutput.hh:66
virtual void calculateVelocity(VelocityVector &velocity, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, int phaseIdx) const
Definition: io/velocityoutput.hh:70
A VTK output module to simplify writing dumux simulation data to VTK format.
Definition: io/vtkoutputmodule.hh:49
const std::string & paramGroup() const
the parameter group for getting parameter from the parameter tree
Definition: io/vtkoutputmodule.hh:79
Dune::VTK::DataMode dataMode() const
Definition: io/vtkoutputmodule.hh:188
Dune::VTKWriter< GridView > & writer()
Definition: io/vtkoutputmodule.hh:191
Dune::VTKSequenceWriter< GridView > & sequenceWriter()
Definition: io/vtkoutputmodule.hh:192
const std::string & name() const
Definition: io/vtkoutputmodule.hh:187
const std::vector< Field > & fields() const
Definition: io/vtkoutputmodule.hh:194
bool verbose() const
Definition: io/vtkoutputmodule.hh:186
A VTK output module to simplify writing dumux simulation data to VTK format.
Definition: io/vtkoutputmodule.hh:300
const GridVariables & gridVariables() const
Definition: io/vtkoutputmodule.hh:384
const VelocityOutput & velocityOutput() const
Definition: io/vtkoutputmodule.hh:392
Vtk::template Field< GridView > Field
the type of Field that can be added to this writer
Definition: io/vtkoutputmodule.hh:328
const SolutionVector & sol() const
Definition: io/vtkoutputmodule.hh:386
const GridGeometry & gridGeometry() const
Definition: io/vtkoutputmodule.hh:385
const std::vector< VolVarScalarDataInfo > & volVarScalarDataInfo() const
Definition: io/vtkoutputmodule.hh:388
const std::vector< VolVarVectorDataInfo > & volVarVectorDataInfo() const
Definition: io/vtkoutputmodule.hh:389
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
A VTK output module to simplify writing dumux simulation data to VTK format.
constexpr Box box
Definition: method.hh:147
std::size_t numCorners(Shape shape)
Returns the number of corners of a given geometry.
Definition: throatproperties.hh:220
Definition: adapt.hh:17