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 23 of file LevelSetVolume.h.

Constructor & Destructor Documentation

LevelSetVolume::LevelSetVolume ( const InputParameters &  parameters)

Definition at line 25 of file LevelSetVolume.C.

26  : ElementVariablePostprocessor(parameters),
27  _threshold(getParam<Real>("threshold")),
28  _inside(getParam<MooseEnum>("location") == "inside")
29 {
30 }
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

virtual void LevelSetVolume::computeQpValue ( )
inlineoverridevirtual

Definition at line 33 of file LevelSetVolume.h.

33 {};
void LevelSetVolume::execute ( )
overridevirtual

Definition at line 39 of file LevelSetVolume.C.

40 {
41  Real cnt = 0;
42  Real n = _u.size();
43 
44  // Perform the check for inside/outside outside the qp loop for speed
45  if (_inside)
46  {
47  for (_qp = 0; _qp < n; ++_qp)
48  if (_u[_qp] <= _threshold)
49  cnt++;
50  }
51  else
52  {
53  for (_qp = 0; _qp < n; ++_qp)
54  if (_u[_qp] > _threshold)
55  cnt++;
56  }
57  _volume += cnt / n * _current_elem_volume;
58 }
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. ...
void LevelSetVolume::finalize ( )
overridevirtual

Definition at line 61 of file LevelSetVolume.C.

62 {
63  gatherSum(_volume);
64 }
Real _volume
The accumulated volume to return as a PostprocessorValue.
Real LevelSetVolume::getValue ( )
overridevirtual

Definition at line 67 of file LevelSetVolume.C.

68 {
69  return _volume;
70 }
Real _volume
The accumulated volume to return as a PostprocessorValue.
void LevelSetVolume::initialize ( )
overridevirtual

Definition at line 33 of file LevelSetVolume.C.

34 {
35  _volume = 0;
36 }
Real _volume
The accumulated volume to return as a PostprocessorValue.
void LevelSetVolume::threadJoin ( const UserObject &  y)
overridevirtual

Definition at line 73 of file LevelSetVolume.C.

74 {
75  const LevelSetVolume & pps = static_cast<const LevelSetVolume &>(y);
76  _volume += pps._volume;
77 }
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

const bool LevelSetVolume::_inside
protected

Flag for triggering the internal volume calculation.

Definition at line 43 of file LevelSetVolume.h.

Referenced by execute().

const Real& LevelSetVolume::_threshold
protected

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

Definition at line 40 of file LevelSetVolume.h.

Referenced by execute().

Real LevelSetVolume::_volume
protected

The accumulated volume to return as a PostprocessorValue.

Definition at line 33 of file LevelSetVolume.h.

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


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