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

Defines the position of a moving front. More...

#include <MovingPlanarFront.h>

Inheritance diagram for MovingPlanarFront:
[legend]

Public Member Functions

 MovingPlanarFront (const InputParameters &parameters)
 
virtual Real value (Real t, const Point &p) const override
 

Protected Attributes

const RealVectorValue _start_posn
 Initial position of front. More...
 
const RealVectorValue _end_posn
 Final position of the front: together with start_posn this defines the front's normal. More...
 
const Function & _distance
 The front's distance from start_posn (along the normal direction) More...
 
const Real _active_length
 Active length. More...
 
const Real _true_value
 True value to return. More...
 
const Real _false_value
 False value to return. More...
 
const Real _activation_time
 Activation time. More...
 
const Real _deactivation_time
 Deactivation time. More...
 
RealVectorValue _front_normal
 Front unit normal. More...
 

Detailed Description

Defines the position of a moving front.

The front is an infinite plane with normal pointing from start_posn to end_posn. The front's distance from start_posn is defined by the 'distance' function

This Function may be used to define the geometry of an underground excavation, probably in conjunction with a predefined sideset.

Definition at line 28 of file MovingPlanarFront.h.

Constructor & Destructor Documentation

◆ MovingPlanarFront()

MovingPlanarFront::MovingPlanarFront ( const InputParameters &  parameters)

Definition at line 57 of file MovingPlanarFront.C.

58  : Function(parameters),
59  FunctionInterface(this),
60  _start_posn(getParam<RealVectorValue>("start_posn")),
61  _end_posn(getParam<RealVectorValue>("end_posn")),
62  _distance(getFunction("distance")),
63  _active_length(getParam<Real>("active_length")),
64  _true_value(getParam<Real>("true_value")),
65  _false_value(getParam<Real>("false_value")),
66  _activation_time(getParam<Real>("activation_time")),
67  _deactivation_time(getParam<Real>("deactivation_time")),
69 {
70  if (_front_normal.norm() == 0)
71  mooseError("MovingPlanarFront: start_posn and end_posn must be different points");
72  _front_normal /= _front_normal.norm();
73 }

Member Function Documentation

◆ value()

Real MovingPlanarFront::value ( Real  t,
const Point &  p 
) const
overridevirtual

Definition at line 76 of file MovingPlanarFront.C.

77 {
78  if (t < _activation_time)
79  return _false_value;
80 
81  if (t >= _deactivation_time)
82  return _false_value;
83 
84  if ((p - _start_posn) * _front_normal < 0)
85  // point is behind start posn - it'll never be active
86  return _false_value;
87 
88  const RealVectorValue current_posn = _start_posn + _distance.value(t, p) * _front_normal;
89 
90  const Real distance_ahead_of_front = (p - current_posn) * _front_normal;
91 
92  if (distance_ahead_of_front > 0)
93  return _false_value;
94 
95  if (distance_ahead_of_front < -_active_length)
96  // point is too far behind front
97  return _false_value;
98 
99  return _true_value;
100 }

Member Data Documentation

◆ _activation_time

const Real MovingPlanarFront::_activation_time
protected

Activation time.

Definition at line 55 of file MovingPlanarFront.h.

Referenced by value().

◆ _active_length

const Real MovingPlanarFront::_active_length
protected

Active length.

Definition at line 46 of file MovingPlanarFront.h.

Referenced by value().

◆ _deactivation_time

const Real MovingPlanarFront::_deactivation_time
protected

Deactivation time.

Definition at line 58 of file MovingPlanarFront.h.

Referenced by value().

◆ _distance

const Function& MovingPlanarFront::_distance
protected

The front's distance from start_posn (along the normal direction)

Definition at line 43 of file MovingPlanarFront.h.

Referenced by value().

◆ _end_posn

const RealVectorValue MovingPlanarFront::_end_posn
protected

Final position of the front: together with start_posn this defines the front's normal.

Definition at line 40 of file MovingPlanarFront.h.

◆ _false_value

const Real MovingPlanarFront::_false_value
protected

False value to return.

Definition at line 52 of file MovingPlanarFront.h.

Referenced by value().

◆ _front_normal

RealVectorValue MovingPlanarFront::_front_normal
protected

Front unit normal.

Definition at line 61 of file MovingPlanarFront.h.

Referenced by MovingPlanarFront(), and value().

◆ _start_posn

const RealVectorValue MovingPlanarFront::_start_posn
protected

Initial position of front.

Definition at line 37 of file MovingPlanarFront.h.

Referenced by value().

◆ _true_value

const Real MovingPlanarFront::_true_value
protected

True value to return.

Definition at line 49 of file MovingPlanarFront.h.

Referenced by value().


The documentation for this class was generated from the following files:
MovingPlanarFront::_deactivation_time
const Real _deactivation_time
Deactivation time.
Definition: MovingPlanarFront.h:58
MovingPlanarFront::_active_length
const Real _active_length
Active length.
Definition: MovingPlanarFront.h:46
MovingPlanarFront::_front_normal
RealVectorValue _front_normal
Front unit normal.
Definition: MovingPlanarFront.h:61
MovingPlanarFront::_false_value
const Real _false_value
False value to return.
Definition: MovingPlanarFront.h:52
MovingPlanarFront::_start_posn
const RealVectorValue _start_posn
Initial position of front.
Definition: MovingPlanarFront.h:37
MovingPlanarFront::_true_value
const Real _true_value
True value to return.
Definition: MovingPlanarFront.h:49
MovingPlanarFront::_end_posn
const RealVectorValue _end_posn
Final position of the front: together with start_posn this defines the front's normal.
Definition: MovingPlanarFront.h:40
MovingPlanarFront::_distance
const Function & _distance
The front's distance from start_posn (along the normal direction)
Definition: MovingPlanarFront.h:43
MovingPlanarFront::_activation_time
const Real _activation_time
Activation time.
Definition: MovingPlanarFront.h:55