PanNDE
All Classes Namespaces Functions Pages
Public Types | Public Member Functions | List of all members
HostData::HostField Class Reference

#include "modules/HostData/include/HostField.hpp"

Inheritance diagram for HostData::HostField:
PanNDE::Field

Public Types

enum  FieldType { NODE =0, CELL =1, CONSTANT =2 }
 
- Public Types inherited from PanNDE::Field
enum  FieldType { NODE =0, CELL =1, CONSTANT =2 }
 

Public Member Functions

PanNDE::Field::FieldType type () override
 
std::shared_ptr< PanNDE::Meshmesh () override
 
double * data () override
 
double & at (int index) override
 
double atCell (int cidx) override
 
double atNode (int nidx) override
 
int32_t size () override
 
void mapFrom (std::shared_ptr< PanNDE::Field > other) override
 
void mapFrom (PanNDE::Field *other) override
 
 HostField (std::shared_ptr< PanNDE::Mesh > mesh, PanNDE::Field::FieldType tp)
 
 HostField (PanNDE::Mesh *mesh, PanNDE::Field::FieldType tp)
 
- Public Member Functions inherited from PanNDE::Field
virtual void mapFrom (std::shared_ptr< PanNDE::Field > other)=0
 

Detailed Description

Implements the expected characteristics of a field attached to a mesh.

Constructor & Destructor Documentation

◆ HostField() [1/2]

HostData::HostField::HostField ( std::shared_ptr< PanNDE::Mesh mesh,
PanNDE::Field::FieldType  tp 
)
inline

constructor

Parameters
meshmesh on which the field is attached
tpfield type

◆ HostField() [2/2]

HostData::HostField::HostField ( PanNDE::Mesh mesh,
PanNDE::Field::FieldType  tp 
)
inline

constructor

Parameters
meshmesh on which the field is attached
tpfield type

Member Function Documentation

◆ at()

double& HostData::HostField::at ( int  index)
inlineoverridevirtual

get the value by reference at the index. the index corresponds to the mesh index based on the whether the field is cell or node centered.

Parameters
indexlocation index of the value desired

Implements PanNDE::Field.

◆ atCell()

double HostData::HostField::atCell ( int  cidx)
inlineoverridevirtual

get the value at cell index

Parameters
cidxcell index desired

Implements PanNDE::Field.

◆ atNode()

double HostData::HostField::atNode ( int  nidx)
inlineoverridevirtual

get the value at node index

Parameters
nidxnodal index desired

Implements PanNDE::Field.

◆ data()

double* HostData::HostField::data ( )
inlineoverridevirtual

get the pointer to underlying data array. This should be used with caution, and only when low level access is necessary (e.g., there is a need for a memcpy())

Implements PanNDE::Field.

◆ mapFrom() [1/2]

void HostData::HostField::mapFrom ( PanNDE::Field other)
inlineoverridevirtual

map data from other field into this field. This should copy if the other field is of the same type (cell/node), and this should map the data if the other is not the same type. This solution is not the preferred solution as it does not use a smart pointer.

Implements PanNDE::Field.

◆ mapFrom() [2/2]

void HostData::HostField::mapFrom ( std::shared_ptr< PanNDE::Field other)
inlineoverride

map data from other field into this field. This should copy if the other field is of the same type (cell/node), and this should map the data if the other is not the same type

◆ mesh()

std::shared_ptr<PanNDE::Mesh> HostData::HostField::mesh ( )
inlineoverridevirtual

get the mesh to which the field is attached

Implements PanNDE::Field.

◆ size()

int32_t HostData::HostField::size ( )
inlineoverridevirtual

get the number of values in the underlying data array

Implements PanNDE::Field.

◆ type()

PanNDE::Field::FieldType HostData::HostField::type ( )
inlineoverridevirtual

get the type of field, i.e., how the data is stored (Cell/Nodal)

Implements PanNDE::Field.


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