hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
hummingbird::ParsedVolumetricSource Class Reference

Defines a volumetric source defined by a parsed function passed by the user. More...

#include <parsed_volumetric_source.h>

Inheritance diagram for hummingbird::ParsedVolumetricSource:
[legend]
Collaboration diagram for hummingbird::ParsedVolumetricSource:
[legend]

Public Member Functions

 ParsedVolumetricSource (const std::string expression)
 Construct a new Parsed Volumetric Source object.
double EvaluateAtNode (const Node &node, const Ordinate &ordinate) override
 Evaluate the parsed expression_ at a node in a particular direction. The expression may reference the variables x, y, z (the node's coordinates) and mu (the direction's x-direction cosine).
Public Member Functions inherited from hummingbird::SourceBase
 SourceBase ()=default
 Construct a new Source Base object.
virtual ~SourceBase ()=default
 Destroy the Source Base object.

Private Attributes

const std::string expression_
 Function expression to be evaluated.

Detailed Description

Defines a volumetric source defined by a parsed function passed by the user.

Definition at line 19 of file parsed_volumetric_source.h.

Constructor & Destructor Documentation

◆ ParsedVolumetricSource()

hummingbird::ParsedVolumetricSource::ParsedVolumetricSource ( const std::string expression)

Construct a new Parsed Volumetric Source object.

Parameters
expressionFunction expression to be evaluated

Definition at line 8 of file parsed_volumetric_source.cc.

Member Function Documentation

◆ EvaluateAtNode()

double hummingbird::ParsedVolumetricSource::EvaluateAtNode ( const Node & node,
const Ordinate & ordinate )
overridevirtual

Evaluate the parsed expression_ at a node in a particular direction. The expression may reference the variables x, y, z (the node's coordinates) and mu (the direction's x-direction cosine).

Parameters
nodeNode
ordinateOrdinate (direction)
Returns
Volumetric source in n/cm2/s/str
Exceptions
std::runtime_errorif the expression fails to parse
Todo
Add support for 2- and 3D angular functions (currently only supports mu-functions).

Implements hummingbird::SourceBase.

Definition at line 11 of file parsed_volumetric_source.cc.

Member Data Documentation

◆ expression_

const std::string hummingbird::ParsedVolumetricSource::expression_
private

Function expression to be evaluated.

Definition at line 44 of file parsed_volumetric_source.h.


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