www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
LevelSetVolume Class Reference

Postprocessor to compute the area/volume inside and outside of a level set contour. More...

#include <LevelSetVolume.h>

Inheritance diagram for LevelSetVolume:
[legend]

Public Member Functions

 LevelSetVolume (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void finalize () override
 
virtual void execute () override
 
virtual Real getValue () override
 
virtual void threadJoin (const UserObject &y) override
 
virtual void computeQpValue () override
 

Protected Attributes

Real _volume
 The accumulated volume to return as a PostprocessorValue. More...
 
const Real & _threshold
 The level set contour to consider for computing inside vs. outside of the volume. More...
 
const bool _inside
 Flag for triggering the internal volume calculation. More...
 

Detailed Description

Postprocessor to compute the area/volume inside and outside of a level set contour.

Definition at line 25 of file LevelSetVolume.h.

Constructor & Destructor Documentation

◆ LevelSetVolume()

LevelSetVolume::LevelSetVolume ( const InputParameters &  parameters)

Definition at line 29 of file LevelSetVolume.C.

30  : ElementVariablePostprocessor(parameters),
31  _threshold(getParam<Real>("threshold")),
32  _inside(getParam<MooseEnum>("location") == "inside")
33 {
34 }
const bool _inside
Flag for triggering the internal volume calculation.
const Real & _threshold
The level set contour to consider for computing inside vs. outside of the volume. ...

Member Function Documentation

◆ computeQpValue()

virtual void LevelSetVolume::computeQpValue ( )
inlineoverridevirtual

Definition at line 35 of file LevelSetVolume.h.

35 {};

◆ execute()

void LevelSetVolume::execute ( )
overridevirtual

Definition at line 43 of file LevelSetVolume.C.

44 {
45  Real cnt = 0;
46  Real n = _u.size();
47 
48  // Perform the check for inside/outside outside the qp loop for speed
49  if (_inside)
50  {
51  for (_qp = 0; _qp < n; ++_qp)
52  if (_u[_qp] <= _threshold)
53  cnt++;
54  }
55  else
56  {
57  for (_qp = 0; _qp < n; ++_qp)
58  if (_u[_qp] > _threshold)
59  cnt++;
60  }
61  _volume += cnt / n * _current_elem_volume;
62 }
Real _volume
The accumulated volume to return as a PostprocessorValue.
const bool _inside
Flag for triggering the internal volume calculation.
const Real & _threshold
The level set contour to consider for computing inside vs. outside of the volume. ...

◆ finalize()

void LevelSetVolume::finalize ( )
overridevirtual

Definition at line 65 of file LevelSetVolume.C.

66 {
67  gatherSum(_volume);
68 }
Real _volume
The accumulated volume to return as a PostprocessorValue.

◆ getValue()

Real LevelSetVolume::getValue ( )
overridevirtual

Definition at line 71 of file LevelSetVolume.C.

72 {
73  return _volume;
74 }
Real _volume
The accumulated volume to return as a PostprocessorValue.

◆ initialize()

void LevelSetVolume::initialize ( )
overridevirtual

Definition at line 37 of file LevelSetVolume.C.

38 {
39  _volume = 0;
40 }
Real _volume
The accumulated volume to return as a PostprocessorValue.

◆ threadJoin()

void LevelSetVolume::threadJoin ( const UserObject &  y)
overridevirtual

Definition at line 77 of file LevelSetVolume.C.

78 {
79  const LevelSetVolume & pps = static_cast<const LevelSetVolume &>(y);
80  _volume += pps._volume;
81 }
Real _volume
The accumulated volume to return as a PostprocessorValue.
Postprocessor to compute the area/volume inside and outside of a level set contour.

Member Data Documentation

◆ _inside

const bool LevelSetVolume::_inside
protected

Flag for triggering the internal volume calculation.

Definition at line 45 of file LevelSetVolume.h.

Referenced by execute().

◆ _threshold

const Real& LevelSetVolume::_threshold
protected

The level set contour to consider for computing inside vs. outside of the volume.

Definition at line 42 of file LevelSetVolume.h.

Referenced by execute().

◆ _volume

Real LevelSetVolume::_volume
protected

The accumulated volume to return as a PostprocessorValue.

Definition at line 35 of file LevelSetVolume.h.

Referenced by execute(), finalize(), getValue(), initialize(), and threadJoin().


The documentation for this class was generated from the following files: