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) {
157 if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
161 if constexpr(enableMech) {
163 const auto& problem = elemCtx.problem();
164 const auto& geoMechModel = problem.geoMechModel();
165 const auto& faceStressInfo = geoMechModel.linearizer().getStressInfo();
166 for (
unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(0); ++dofIdx) {
167 const unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, 0);
168 const auto& materialState = geoMechModel.materialState(globalDofIdx, 0);
171 for (
int dirIdx = 0; dirIdx < 3; ++dirIdx) {
174 displacement_[globalDofIdx][dirIdx] = scalarValue(materialState.displacement(dirIdx));
179 rotation_[globalDofIdx][dirIdx] = scalarValue(materialState.rotation(dirIdx));
185 solidPres_[globalDofIdx] = scalarValue(materialState.solidPressure());
190 potPresForce_[globalDofIdx] =
191 geoMechModel.mechPotentialPressForce(globalDofIdx);
196 SymTensor stressSymTensor = geoMechModel.stress(globalDofIdx,
true);
197 Tensor& stressTensor = stress_[globalDofIdx];
198 setTensorFromVoigt_(stressTensor, stressSymTensor);
203 SymTensor delStressSymTensor = geoMechModel.delstress(globalDofIdx);
204 Tensor& delStressTensor = delStress_[globalDofIdx];
205 setTensorFromVoigt_(delStressTensor, delStressSymTensor);
210 SymTensor linStressSymTensor = geoMechModel.linstress(globalDofIdx);
211 Tensor& linStressTensor = linStress_[globalDofIdx];
212 setTensorFromVoigt_(linStressTensor, linStressSymTensor);
217 SymTensor strainSymTensor = geoMechModel.strain(globalDofIdx,
true);
218 Tensor& strainTensor = strain_[globalDofIdx];
219 setTensorFromVoigt_(strainTensor, strainSymTensor);
237 if constexpr(enableMech) {
255 "potentialPressureForce",
279 static void setTensorFromVoigt_(Tensor& tensor,
const SymTensor& symTensor)
282 for (std::size_t i = 0; i < 3; ++i) {
283 tensor[i][i] = symTensor[i];
287 tensor[0][1] = symTensor[5];
288 tensor[0][2] = symTensor[4];
289 tensor[1][2] = symTensor[3];
290 for (std::size_t i = 0; i < 3; ++i) {
291 for (std::size_t j = 0; j < 3; ++j) {
293 tensor[i][j] = tensor[j][i];
299 VtkTpsaParams params_{};
301 VectorBuffer displacement_{};
302 VectorBuffer rotation_{};
304 ScalarBuffer solidPres_{};
305 ScalarBuffer potPresForce_{};
307 TensorBuffer stress_{};
308 TensorBuffer delStress_{};
309 TensorBuffer linStress_{};
310 TensorBuffer strain_{};
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:230
void processElement(const ElementContext &elemCtx) override
Assign quantities to output buffers.
Definition: vtktpsamodule.hpp:154
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:55
bool stressOutput_
Definition: vtktpsaparams.hpp:56
static void registerParameters()
bool displacementOutput_
Definition: vtktpsaparams.hpp:53
bool linStressOutput_
Definition: vtktpsaparams.hpp:58
bool potPresForceOutput_
Definition: vtktpsaparams.hpp:60
bool rotationOutput_
Definition: vtktpsaparams.hpp:54
bool delStressOutput_
Definition: vtktpsaparams.hpp:57
bool strainOutput_
Definition: vtktpsaparams.hpp:59