25#ifndef VTK_TPSA_MODULE_HPP
26#define VTK_TPSA_MODULE_HPP
28#include <dune/common/dynmatrix.hh>
29#include <dune/common/fvector.hh>
31#include <opm/material/densead/Math.hpp>
47template <
class TypeTag>
57 static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
60 enum { enableMech = getPropValue<TypeTag, Properties::EnableMech>() };
67 using SymTensor = Dune::FieldVector<Scalar, 6>;
68 using Tensor = Dune::DynamicMatrix<Scalar>;
80 if constexpr(enableMech) {
90 if constexpr(enableMech) {
101 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
106 if constexpr(enableMech) {
137 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
141 if constexpr(enableMech) {
143 const auto& problem = elemCtx.problem();
144 const auto& geoMechModel = problem.geoMechModel();
145 const auto& faceStressInfo = geoMechModel.linearizer().getStressInfo();
146 for (
unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(0); ++dofIdx) {
147 const unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, 0);
148 const auto& materialState = geoMechModel.materialState(globalDofIdx, 0);
151 for (
int dirIdx = 0; dirIdx < 3; ++dirIdx) {
154 displacement_[globalDofIdx][dirIdx] = scalarValue(materialState.displacement(dirIdx));
159 rotation_[globalDofIdx][dirIdx] = scalarValue(materialState.rotation(dirIdx));
165 solidPres_[globalDofIdx] = scalarValue(materialState.solidPressure());
170 SymTensor stressSymTensor = geoMechModel.stress(globalDofIdx,
false);
171 Tensor& stressTensor = stress_[globalDofIdx];
172 setTensorFromVoigt_(stressTensor, stressSymTensor);
190 if constexpr(enableMech) {
213 static void setTensorFromVoigt_(Tensor& tensor,
const SymTensor& symTensor)
216 for (std::size_t i = 0; i < 3; ++i) {
217 tensor[i][i] = symTensor[i];
221 tensor[0][1] = symTensor[5];
222 tensor[0][2] = symTensor[4];
223 tensor[1][2] = symTensor[3];
224 for (std::size_t i = 0; i < 3; ++i) {
225 for (std::size_t j = 0; j < 3; ++j) {
227 tensor[i][j] = tensor[j][i];
233 VtkTpsaParams params_{};
235 VectorBuffer displacement_{};
236 VectorBuffer rotation_{};
237 ScalarBuffer solidPres_{};
238 TensorBuffer stress_{};
The base class for writer modules.
Definition: baseoutputmodule.hh:68
BaseOutputWriter::ScalarBuffer ScalarBuffer
Definition: baseoutputmodule.hh:86
void resizeScalarBuffer_(ScalarBuffer &buffer, BufferType bufferType)
Allocate the space for a buffer storing a scalar quantity.
Definition: baseoutputmodule.hh:157
void resizeVectorBuffer_(VectorBuffer &buffer, BufferType bufferType)
Definition: baseoutputmodule.hh:173
BaseOutputWriter::TensorBuffer TensorBuffer
Definition: baseoutputmodule.hh:88
void commitVectorBuffer_(BaseOutputWriter &baseWriter, const char *name, VectorBuffer &buffer, BufferType bufferType)
Add a buffer containing vectorial quantities to the result file.
Definition: baseoutputmodule.hh:260
BufferType
Definition: baseoutputmodule.hh:143
void commitTensorBuffer_(BaseOutputWriter &baseWriter, const char *name, TensorBuffer &buffer, BufferType bufferType)
Add a buffer containing tensorial quantities to the result file.
Definition: baseoutputmodule.hh:282
BaseOutputWriter::VectorBuffer VectorBuffer
Definition: baseoutputmodule.hh:87
void resizeTensorBuffer_(TensorBuffer &buffer, BufferType bufferType)
Allocate the space for a buffer storing a tensorial quantity.
Definition: baseoutputmodule.hh:166
void commitScalarBuffer_(BaseOutputWriter &baseWriter, const char *name, ScalarBuffer &buffer, BufferType bufferType)
Add a buffer containing scalar quantities to the result file.
Definition: baseoutputmodule.hh:238
The base class for all output writers.
Definition: baseoutputwriter.hh:46
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:65
VTK output module for TPSA quantities.
Definition: vtktpsamodule.hpp:49
static void registerParameters()
Register runtime parameters.
Definition: vtktpsamodule.hpp:88
void allocBuffers() override
Allocate memory for output.
Definition: vtktpsamodule.hpp:98
VtkTpsaModule(const Simulator &simulator)
Constructor.
Definition: vtktpsamodule.hpp:76
void commitBuffers(BaseOutputWriter &baseWriter) override
Add buffers to VTK writer.
Definition: vtktpsamodule.hpp:183
void processElement(const ElementContext &elemCtx) override
Assign quantities to output buffers.
Definition: vtktpsamodule.hpp:134
Definition: blackoilbioeffectsmodules.hh:45
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:233
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.
bool solidPressureOutput_
Definition: vtktpsaparams.hpp:51
bool stressOutput_
Definition: vtktpsaparams.hpp:52
static void registerParameters()
bool displacementOutput_
Definition: vtktpsaparams.hpp:49
bool rotationOutput_
Definition: vtktpsaparams.hpp:50