PanNDE
All Classes Namespaces Functions Pages
Public Types | Public Member Functions | List of all members
PanNDE::Field Class Referenceabstract

#include "modules/PanNDE/include/Field.hpp"

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

Public Types

enum  FieldType { NODE =0, CELL =1, CONSTANT =2 }
 

Public Member Functions

virtual FieldType type ()=0
 
virtual std::shared_ptr< PanNDE::Meshmesh ()=0
 
virtual double * data ()=0
 
virtual double & at (int index)=0
 
virtual double atCell (int cidx)=0
 
virtual double atNode (int nidx)=0
 
virtual int32_t size ()=0
 
virtual void mapFrom (std::shared_ptr< PanNDE::Field > other)=0
 
virtual void mapFrom (PanNDE::Field *other)=0
 

Detailed Description

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

Member Function Documentation

◆ at()

virtual double& PanNDE::Field::at ( int  index)
pure virtual

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

Implemented in HostData::HostField.

◆ atCell()

virtual double PanNDE::Field::atCell ( int  cidx)
pure virtual

get the value at cell index

Parameters
cidxcell index desired

Implemented in HostData::HostField.

◆ atNode()

virtual double PanNDE::Field::atNode ( int  nidx)
pure virtual

get the value at node index

Parameters
nidxnodal index desired

Implemented in HostData::HostField.

◆ data()

virtual double* PanNDE::Field::data ( )
pure virtual

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())

Implemented in HostData::HostField.

◆ mapFrom() [1/2]

virtual void PanNDE::Field::mapFrom ( PanNDE::Field other)
pure virtual

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.

Implemented in HostData::HostField.

◆ mapFrom() [2/2]

virtual void PanNDE::Field::mapFrom ( std::shared_ptr< PanNDE::Field other)
pure virtual

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()

virtual std::shared_ptr<PanNDE::Mesh> PanNDE::Field::mesh ( )
pure virtual

get the mesh to which the field is attached

Implemented in HostData::HostField.

◆ size()

virtual int32_t PanNDE::Field::size ( )
pure virtual

get the number of values in the underlying data array

Implemented in HostData::HostField.

◆ type()

virtual FieldType PanNDE::Field::type ( )
pure virtual

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

Implemented in HostData::HostField.


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