25 #ifndef VTK_TPSA_MODULE_HPP 26 #define VTK_TPSA_MODULE_HPP 28 #include <opm/material/densead/Math.hpp> 32 #include <opm/models/io/vtktpsaparams.hpp> 33 #include <opm/models/tpsa/tpsabaseproperties.hpp> 45 template <
class TypeTag>
54 static constexpr
auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
57 enum { enableMech = getPropValue<TypeTag, Properties::EnableMech>() };
60 using ScalarBuffer =
typename ParentType::ScalarBuffer;
61 using VectorBuffer =
typename ParentType::VectorBuffer;
73 if constexpr(enableMech) {
83 if constexpr(enableMech) {
94 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
99 if constexpr(enableMech) {
101 if (params_.displacementOutput_) {
102 this->resizeVectorBuffer_(displacement_, BufferType::Dof);
106 if (params_.rotationOutput_) {
107 this->resizeVectorBuffer_(rotation_, BufferType::Dof);
111 if (params_.solidPressureOutput_) {
125 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
129 if constexpr(enableMech) {
131 const auto& problem = elemCtx.problem();
132 const auto& geoMechModel = problem.geoMechModel();
133 for (
unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(0); ++dofIdx) {
134 const unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, 0);
135 const auto& materialState = geoMechModel.materialState(globalDofIdx, 0);
138 for (
int dirIdx = 0; dirIdx < 3; ++dirIdx) {
140 if (params_.displacementOutput_) {
141 displacement_[globalDofIdx][dirIdx] = scalarValue(materialState.displacement(dirIdx));
145 if (params_.rotationOutput_) {
146 rotation_[globalDofIdx][dirIdx] = scalarValue(materialState.rotation(dirIdx));
151 if (params_.solidPressureOutput_) {
152 solidPres_[globalDofIdx] = scalarValue(materialState.solidPressure());
166 if (!dynamic_cast<VtkMultiWriter*>(&baseWriter)) {
170 if constexpr(enableMech) {
172 if (params_.displacementOutput_) {
177 if (params_.rotationOutput_) {
182 if (params_.solidPressureOutput_) {
191 VectorBuffer displacement_{};
192 VectorBuffer rotation_{};
193 ScalarBuffer solidPres_{};
VtkTpsaModule(const Simulator &simulator)
Constructor.
Definition: vtktpsamodule.hpp:69
VTK output module for TPSA quantities.
Definition: vtktpsamodule.hpp:46
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
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
This file provides the infrastructure to retrieve run-time parameters.
The base class for writer modules.
Definition: baseoutputmodule.hh:67
The base class for writer modules.
BufferType
Definition: baseoutputmodule.hh:143
static void registerParameters()
Register runtime parameters.
Definition: vtktpsamodule.hpp:81
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:64
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
The base class for all output writers.
Definition: baseoutputwriter.hh:45
void commitBuffers(BaseOutputWriter &baseWriter) override
Add buffers to VTK writer.
Definition: vtktpsamodule.hpp:163
void read()
Read runtime parameters.
Definition: vtktpsaparams.cpp:47
static void registerParameters()
Register runtime parameters.
Definition: vtktpsaparams.cpp:34
void allocBuffers() override
Allocate memory for output.
Definition: vtktpsamodule.hpp:91
void resizeScalarBuffer_(ScalarBuffer &buffer, BufferType bufferType)
Allocate the space for a buffer storing a scalar quantity.
Definition: baseoutputmodule.hh:157
The Opm property system, traits with inheritance.
Simplifies writing multi-file VTK datasets.
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
Parameters for VtkTpsaOutputModule.
Definition: vtktpsaparams.hpp:43
void processElement(const ElementContext &elemCtx) override
Assign quantities to output buffers.
Definition: vtktpsamodule.hpp:122