Chi-Tech
chi_physics::FieldFunctionGridBased Class Reference

#include <fieldfunction_gridbased.h>

Inheritance diagram for chi_physics::FieldFunctionGridBased:
chi_physics::FieldFunction ChiObject

Public Types

typedef std::pair< chi_mesh::Vector3, chi_mesh::Vector3BoundingBox
 
typedef std::vector< std::shared_ptr< const FieldFunctionGridBased > > FFList
 

Public Member Functions

 FieldFunctionGridBased (const chi::InputParameters &params)
 
 FieldFunctionGridBased (const std::string &text_name, chi_math::SDMPtr &discretization_ptr, chi_math::Unknown unknown)
 
 FieldFunctionGridBased (const std::string &text_name, chi_math::SDMPtr &sdm_ptr, chi_math::Unknown unknown, const std::vector< double > &field_vector)
 
 FieldFunctionGridBased (const std::string &text_name, chi_math::SDMPtr &sdm_ptr, chi_math::Unknown unknown, double field_value)
 
virtual ~FieldFunctionGridBased ()=default
 
const chi_math::SpatialDiscretizationGetSpatialDiscretization () const
 
const std::vector< double > & FieldVectorRead () const
 
std::vector< double > & FieldVector ()
 
void UpdateFieldVector (const std::vector< double > &field_vector)
 
void UpdateFieldVector (const Vec &field_vector)
 
std::vector< double > GetGhostedFieldVector () const
 
virtual std::vector< double > GetPointValue (const chi_mesh::Vector3 &point) const
 Returns the component values at requested point. More...
 
double Evaluate (const chi_mesh::Cell &cell, const chi_mesh::Vector3 &position, unsigned int component) const override
 
- Public Member Functions inherited from chi_physics::FieldFunction
 FieldFunction (const chi::InputParameters &params)
 
 FieldFunction (const std::string &text_name, chi_math::Unknown unknown)
 
virtual ~FieldFunction ()=default
 
const std::string & TextName () const
 
const chi_math::UnknownUnknown () const
 
const chi_math::UnknownManagerGetUnknownManager () const
 
void PushOntoStack (std::shared_ptr< ChiObject > &new_object) override
 Overrides the stack placement so that FieldFunctions go to the field function stack. More...
 
virtual double Evaluate (const chi_mesh::Cell &cell, const chi_mesh::Vector3 &position, unsigned int component) const
 
- Public Member Functions inherited from ChiObject
 ChiObject ()
 
 ChiObject (const chi::InputParameters &params)
 
void SetStackID (size_t stack_id)
 
size_t StackID () const
 
virtual void PushOntoStack (std::shared_ptr< ChiObject > &new_object)
 
virtual ~ChiObject ()=default
 

Static Public Member Functions

static chi::InputParameters GetInputParameters ()
 
static void ExportMultipleToVTK (const std::string &file_base_name, const FFList &ff_list)
 
- Static Public Member Functions inherited from chi_physics::FieldFunction
static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from ChiObject
static chi::InputParameters GetInputParameters ()
 

Protected Attributes

chi_math::SDMPtr sdm_
 
std::unique_ptr< chi_math::GhostedParallelSTLVectorghosted_field_vector_
 

Static Private Member Functions

static chi_math::SDMPtr MakeSpatialDiscretization (const chi::InputParameters &params)
 
static std::unique_ptr< chi_math::GhostedParallelSTLVectorMakeFieldVector (const chi_math::SpatialDiscretization &discretization, const chi_math::UnknownManager &uk_man)
 

Private Attributes

const BoundingBox local_grid_bounding_box_
 

Detailed Description

Definition at line 29 of file fieldfunction_gridbased.h.

Member Typedef Documentation

◆ BoundingBox

◆ FFList

typedef std::vector<std::shared_ptr<const FieldFunctionGridBased> > chi_physics::FieldFunctionGridBased::FFList

Static method to export multiple grid-based field functions.

Definition at line 78 of file fieldfunction_gridbased.h.

Constructor & Destructor Documentation

◆ FieldFunctionGridBased() [1/4]

chi_physics::FieldFunctionGridBased::FieldFunctionGridBased ( const chi::InputParameters params)
explicit

ObjectMaker based constructor.

Definition at line 54 of file ff_gridbased_00_constrdestr.cc.

◆ FieldFunctionGridBased() [2/4]

chi_physics::FieldFunctionGridBased::FieldFunctionGridBased ( const std::string &  text_name,
chi_math::SDMPtr discretization_ptr,
chi_math::Unknown  unknown 
)

Creates a field function, filling it with zeros.

Definition at line 66 of file ff_gridbased_00_constrdestr.cc.

◆ FieldFunctionGridBased() [3/4]

chi_physics::FieldFunctionGridBased::FieldFunctionGridBased ( const std::string &  text_name,
chi_math::SDMPtr sdm_ptr,
chi_math::Unknown  unknown,
const std::vector< double > &  field_vector 
)

Creates a field function with an associated field vector. The field's data vector is set to the incoming field vector.

Definition at line 78 of file ff_gridbased_00_constrdestr.cc.

◆ FieldFunctionGridBased() [4/4]

chi_physics::FieldFunctionGridBased::FieldFunctionGridBased ( const std::string &  text_name,
chi_math::SDMPtr sdm_ptr,
chi_math::Unknown  unknown,
double  field_value 
)

Creates a field function where all the values are assigned to the single supplied value.

Definition at line 96 of file ff_gridbased_00_constrdestr.cc.

◆ ~FieldFunctionGridBased()

virtual chi_physics::FieldFunctionGridBased::~FieldFunctionGridBased ( )
virtualdefault

Member Function Documentation

◆ Evaluate()

double chi_physics::FieldFunctionGridBased::Evaluate ( const chi_mesh::Cell cell,
const chi_mesh::Vector3 position,
unsigned int  component 
) const
overridevirtual

Evaluates the field function, on a cell, at the specified point.

Reimplemented from chi_physics::FieldFunction.

Definition at line 92 of file ff_gridbased_05_values.cc.

◆ ExportMultipleToVTK()

void chi_physics::FieldFunctionGridBased::ExportMultipleToVTK ( const std::string &  file_base_name,
const FFList ff_list 
)
static

Export multiple field functions to VTK.

Definition at line 18 of file ff_gridbased_03b_exportvtkwithappend.cc.

◆ FieldVector()

std::vector< double > & chi_physics::FieldFunctionGridBased::FieldVector ( )

Returns a reference to the locally stored field data.

Definition at line 123 of file ff_gridbased_00_constrdestr.cc.

◆ FieldVectorRead()

const std::vector< double > & chi_physics::FieldFunctionGridBased::FieldVectorRead ( ) const

Returns a read-only reference to the locally stored field data.

Definition at line 118 of file ff_gridbased_00_constrdestr.cc.

◆ GetGhostedFieldVector()

std::vector< double > chi_physics::FieldFunctionGridBased::GetGhostedFieldVector ( ) const

Makes a copy of the locally stored data with ghost access.

Makes a ghosted version of the field vector.

Definition at line 6 of file ff_gridbased_04_utils.cc.

◆ GetInputParameters()

chi::InputParameters chi_physics::FieldFunctionGridBased::GetInputParameters ( )
static

Returns required input parameters.

Definition at line 19 of file ff_gridbased_00_constrdestr.cc.

◆ GetPointValue()

std::vector< double > chi_physics::FieldFunctionGridBased::GetPointValue ( const chi_mesh::Vector3 point) const
virtual

Returns the component values at requested point.

Not necessarily an optimal routine to use when repeatedly querying a field function.

Definition at line 16 of file ff_gridbased_05_values.cc.

◆ GetSpatialDiscretization()

const chi_math::SpatialDiscretization & chi_physics::FieldFunctionGridBased::GetSpatialDiscretization ( ) const

Returns the spatial discretization method.

Definition at line 111 of file ff_gridbased_00_constrdestr.cc.

◆ MakeFieldVector()

std::unique_ptr< chi_math::GhostedParallelSTLVector > chi_physics::FieldFunctionGridBased::MakeFieldVector ( const chi_math::SpatialDiscretization discretization,
const chi_math::UnknownManager uk_man 
)
staticprivate

Static method for making the ghosted vector for the constructors.

Private method for creating the field vector.

Definition at line 192 of file ff_gridbased_00_constrdestr.cc.

◆ MakeSpatialDiscretization()

chi_math::SDMPtr chi_physics::FieldFunctionGridBased::MakeSpatialDiscretization ( const chi::InputParameters params)
staticprivate

Static method for making the GetSpatialDiscretization for the constructors.

Private method for creating the spatial discretization method.

Definition at line 130 of file ff_gridbased_00_constrdestr.cc.

◆ UpdateFieldVector() [1/2]

void chi_physics::FieldFunctionGridBased::UpdateFieldVector ( const std::vector< double > &  field_vector)

Updates the field vector with a local STL vector.

Updates the field data with a STL vector.

Definition at line 9 of file ff_gridbased_01_updates.cc.

◆ UpdateFieldVector() [2/2]

void chi_physics::FieldFunctionGridBased::UpdateFieldVector ( const Vec field_vector)

Updates the field vector with a PETSc vector. This only operates locally.

Updates the field data with a PETSc vector.

Definition at line 22 of file ff_gridbased_01_updates.cc.

Field Documentation

◆ ghosted_field_vector_

std::unique_ptr<chi_math::GhostedParallelSTLVector> chi_physics::FieldFunctionGridBased::ghosted_field_vector_
protected

Definition at line 98 of file fieldfunction_gridbased.h.

◆ local_grid_bounding_box_

const BoundingBox chi_physics::FieldFunctionGridBased::local_grid_bounding_box_
private

Definition at line 110 of file fieldfunction_gridbased.h.

◆ sdm_

chi_math::SDMPtr chi_physics::FieldFunctionGridBased::sdm_
protected

Definition at line 97 of file fieldfunction_gridbased.h.


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