mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added resizing for vector vtk output
This commit is contained in:
parent
c1bb0b0e09
commit
e4b1a2eda7
@ -83,7 +83,7 @@ class BaseOutputModule
|
||||
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
||||
enum { dim = GridView::dimension };
|
||||
enum { dimWorld = GridView::dimensionworld };
|
||||
|
||||
using Vector = BaseOutputWriter::Vector;
|
||||
using Tensor = BaseOutputWriter::Tensor;
|
||||
|
||||
public:
|
||||
@ -196,6 +196,25 @@ protected:
|
||||
std::fill(buffer.begin(), buffer.end(), nullMatrix);
|
||||
}
|
||||
|
||||
void resizeVectorBuffer_(VectorBuffer& buffer,
|
||||
BufferType bufferType = DofBuffer)
|
||||
{
|
||||
size_t n;
|
||||
if (bufferType == VertexBuffer)
|
||||
n = static_cast<size_t>(simulator_.gridView().size(dim));
|
||||
else if (bufferType == ElementBuffer)
|
||||
n = static_cast<size_t>(simulator_.gridView().size(0));
|
||||
else if (bufferType == DofBuffer)
|
||||
n = simulator_.model().numGridDof();
|
||||
else
|
||||
throw std::logic_error("bufferType must be one of Dof, Vertex or Element");
|
||||
|
||||
buffer.resize(n);
|
||||
Vector zerovector(dimWorld,0.0);
|
||||
zerovector = 0.0;
|
||||
std::fill(buffer.begin(), buffer.end(), zerovector);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Allocate the space for a buffer storing a equation specific
|
||||
* quantity
|
||||
|
Loading…
Reference in New Issue
Block a user