OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
pfc::Constant Class Reference

A class that represents a constant field modifier for use as an initial condition in a partial differential equation (PDE) model. More...

#include <constant.hpp>

Inheritance diagram for pfc::Constant:
Collaboration diagram for pfc::Constant:

Public Member Functions

 Constant ()=default
 Default constructor for the Constant class.
 
 Constant (double n0)
 Constructor for the Constant class that sets the initial density value.
 
double get_density () const
 Get the current density value.
 
void set_density (double n0)
 Set the density value.
 
void apply (Model &m, double t_unused) override
 Apply the constant field modifier to the given model.
 
- Public Member Functions inherited from pfc::FieldModifier
void set_field_name (const std::string &field_name)
 
const std::string & get_field_name () const
 
virtual const std::string & get_modifier_name () const
 Get the name of the field modifier.
 
virtual ~FieldModifier ()=default
 Destructor for the FieldModifier class.
 

Detailed Description

A class that represents a constant field modifier for use as an initial condition in a partial differential equation (PDE) model.

The Constant class inherits from the FieldModifier abstract base class and overrides the apply method to set the field to a constant value.

Constructor & Destructor Documentation

◆ Constant()

pfc::Constant::Constant ( double  n0)
inline

Constructor for the Constant class that sets the initial density value.

Parameters
n0The constant value to set for the field.

Member Function Documentation

◆ apply()

void pfc::Constant::apply ( Model m,
double  t_unused 
)
inlineoverridevirtual

Apply the constant field modifier to the given model.

This method sets the field in the model to the constant density value.

Parameters
mThe model to apply the field modifier to.
tThe current time (unused in this implementation).

Implements pfc::FieldModifier.

◆ get_density()

double pfc::Constant::get_density ( ) const
inline

Get the current density value.

Returns
The density value.

◆ set_density()

void pfc::Constant::set_density ( double  n0)
inline

Set the density value.

Parameters
n0The new density value to set.

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