PPL Logo

FEM_Attribute Class Reference
[ParFUM Unstructured Mesh Framework]

Describes an FEM entity's "attribute"--a user-visible, user-settable 2D table. More...

#include <fem_mesh.h>

Collaboration diagram for FEM_Attribute:

Collaboration graph
[legend]

Public Member Functions

 FEM_Attribute (FEM_Entity *owner_, int myAttr_)
virtual void pup (PUP::er &p)
virtual void pupSingle (PUP::er &p, int pupindx)
virtual ~FEM_Attribute ()
void setGhost (FEM_Attribute *ghost_)
 Install this attribute as our ghost:.
bool isGhost (void) const
 Return true if we're a ghost.
int getAttr (void) const
 Return our attribute code.
FEM_EntitygetEntity (void)
int getLength (void) const
 Return the number of rows in our table of data (0 if unknown).
int getRealLength (void) const
int getMax ()
int getWidth (void) const
 Return the number of columns in our table of data (0 if unknown).
int getRealWidth (void) const
int getDatatype (void) const
 Return our FEM_* datatype (-1 if unknown).
void setLength (int l, const char *caller="")
 Set our length (number of rows, or records) to this value.
void setWidth (int w, const char *caller="")
 Set our width (number of values per row) to this value.
void setDatatype (int dt, const char *caller="")
 Set our datatype (e.g., FEM_INT, FEM_DOUBLE) to this value.
virtual void copyShape (const FEM_Attribute &src)
 Copy our width and datatype from this attribute.
void tryAllocate (void)
 Check if all three of length, width, and datatype are set, but we're not yet allocated.
void reallocate (void)
 Our parent's length has changed: reallocate our storage.
bool isAllocated (void) const
 Return true if we've already had storage allocated.
virtual void set (const void *src, int firstItem, int length, const IDXL_Layout &layout, const char *caller)
 Set our data to these (typically user-supplied, unchecked) values.
virtual void get (void *dest, int firstItem, int length, const IDXL_Layout &layout, const char *caller) const
 Extract this quantity of user data.
virtual void copyEntity (int dstEntity, const FEM_Attribute &src, int srcEntity)=0
 Copy everything associated with src[srcEntity] into our dstEntity.
virtual void register_data (void *dest, int length, int max, const IDXL_Layout &layout, const char *caller)
 Register this user data for this attributre Length, layout etc are checked by the default implementaion.
 FEM_Attribute (FEM_Entity *owner_, int myAttr_)
virtual void pup (PUP::er &p)
virtual void pupSingle (PUP::er &p, int pupindx)
virtual ~FEM_Attribute ()
void setGhost (FEM_Attribute *ghost_)
 Install this attribute as our ghost:.
bool isGhost (void) const
 Return true if we're a ghost.
int getAttr (void) const
 Return our attribute code.
FEM_EntitygetEntity (void)
int getLength (void) const
 Return the number of rows in our table of data (0 if unknown).
int getRealLength (void) const
int getMax ()
int getWidth (void) const
 Return the number of columns in our table of data (0 if unknown).
int getRealWidth (void) const
int getDatatype (void) const
 Return our FEM_* datatype (-1 if unknown).
void setLength (int l, const char *caller="")
 Set our length (number of rows, or records) to this value.
void setWidth (int w, const char *caller="")
 Set our width (number of values per row) to this value.
void setDatatype (int dt, const char *caller="")
 Set our datatype (e.g., FEM_INT, FEM_DOUBLE) to this value.
virtual void copyShape (const FEM_Attribute &src)
 Copy our width and datatype from this attribute.
void tryAllocate (void)
 Check if all three of length, width, and datatype are set, but we're not yet allocated.
void reallocate (void)
 Our parent's length has changed: reallocate our storage.
bool isAllocated (void) const
 Return true if we've already had storage allocated.
virtual void set (const void *src, int firstItem, int length, const IDXL_Layout &layout, const char *caller)
 Set our data to these (typically user-supplied, unchecked) values.
virtual void get (void *dest, int firstItem, int length, const IDXL_Layout &layout, const char *caller) const
 Extract this quantity of user data.
virtual void copyEntity (int dstEntity, const FEM_Attribute &src, int srcEntity)=0
 Copy everything associated with src[srcEntity] into our dstEntity.
virtual void register_data (void *dest, int length, int max, const IDXL_Layout &layout, const char *caller)
 Register this user data for this attributre Length, layout etc are checked by the default implementaion.

Protected Member Functions

virtual void allocate (int length, int width, int datatype)=0
 Allocate storage for at least length width-item records of type datatype.
virtual void allocate (int length, int width, int datatype)=0
 Allocate storage for at least length width-item records of type datatype.

Private Member Functions

void bad (const char *field, bool forRead, int cur, int next, const char *caller) const
void bad (const char *field, bool forRead, int cur, int next, const char *caller) const
 Abort with a nice error message saying:.

Private Attributes

FEM_Entitye
FEM_Attributeghost
int attr
 My attribute code (e.g., FEM_DATA+7, FEM_CONN, etc.).
int width
 Number of columns in our table of data (initially unknown).
int datatype
 Datatype of entries (initially unknown).
bool allocated
 True if subclass allocate has been called.
FEM_Entitye
 Owning entity (to get length, etc.).
FEM_Attributeghost
 Ghost attribute, which has the same width and datatype as us (or 0).

Detailed Description

Describes an FEM entity's "attribute"--a user-visible, user-settable 2D table.

A user-visible 2D table attached to a FEM_Entity.

Common FEM_Attributes include: user data associated with nodes, the element-to-node connectivity array, etc.

Describes an FEM entity's "attribute"--a user-visible, user-settable 2D table. Common FEM_Attributes include: user data associated with nodes, the element-to-node connectivity array, etc.

Definition at line 311 of file fem_mesh.h.


Constructor & Destructor Documentation

FEM_Attribute::FEM_Attribute ( FEM_Entity owner_,
int  myAttr_ 
)

FEM_Attribute::~FEM_Attribute (  )  [virtual]

Definition at line 534 of file fem_mesh.C.

FEM_Attribute::FEM_Attribute ( FEM_Entity owner_,
int  myAttr_ 
)

virtual FEM_Attribute::~FEM_Attribute (  )  [virtual]


Member Function Documentation

void FEM_Attribute::bad ( const char *  field,
bool  forRead,
int  cur,
int  next,
const char *  caller 
) const [private]

Referenced by FEM_T_List< FEM_Mesh >::badIndex(), get(), register_data(), set(), setDatatype(), setLength(), and setWidth().

Here is the caller graph for this function:

virtual void FEM_Attribute::allocate ( int  length,
int  width,
int  datatype 
) [protected, pure virtual]

Allocate storage for at least length width-item records of type datatype.

This routine is called after all three parameters are set, as a convenience for subclasses.

Referenced by tryAllocate().

Here is the caller graph for this function:

void FEM_Attribute::pup ( PUP::er p  )  [virtual]

Definition at line 520 of file fem_mesh.C.

References femVersion, PUP::er::isUnpacking(), and tryAllocate().

Referenced by FEM_Entity_Types< FEM_Elem >::pup(), FEM_Entity::pup(), and PUPmarshall().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::pupSingle ( PUP::er p,
int  pupindx 
) [virtual]

Definition at line 527 of file fem_mesh.C.

References femVersion, PUP::er::isUnpacking(), and tryAllocate().

Referenced by FEM_Interpolate::FEM_InterpolateElementCopy(), femMeshModify::packElemData(), FEM_MUtil::packEntData(), and FEM_MUtil::updateAttrs().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::setGhost ( FEM_Attribute ghost_  )  [inline]

Install this attribute as our ghost:.

Definition at line 338 of file fem_mesh.h.

References ghost.

Referenced by FEM_Entity::add().

Here is the caller graph for this function:

bool FEM_Attribute::isGhost ( void   )  const [inline]

Return true if we're a ghost.

Definition at line 341 of file fem_mesh.h.

References ghost.

int FEM_Attribute::getAttr ( void   )  const [inline]

FEM_Entity* FEM_Attribute::getEntity ( void   )  [inline]

Definition at line 346 of file fem_mesh.h.

References e.

int FEM_Attribute::getLength ( void   )  const

Return the number of rows in our table of data (0 if unknown).

This value is obtained directly from our owning Entity.

Referenced by get(), set(), setLength(), and tryAllocate().

Here is the caller graph for this function:

int FEM_Attribute::getWidth ( void   )  const [inline]

Return the number of columns in our table of data (0 if unknown).

Definition at line 356 of file fem_mesh.h.

References width.

Referenced by copyShape(), get(), lookupAdaptAdjacencies(), lookupEdgeAdaptAdjacencies(), register_data(), set(), setWidth(), and tryAllocate().

Here is the caller graph for this function:

int FEM_Attribute::getRealWidth ( void   )  const [inline]

Definition at line 357 of file fem_mesh.h.

References width.

Referenced by register_data(), set(), and tryAllocate().

Here is the caller graph for this function:

int FEM_Attribute::getDatatype ( void   )  const [inline]

Return our FEM_* datatype (-1 if unknown).

Definition at line 360 of file fem_mesh.h.

References datatype.

Referenced by copyShape(), get(), register_data(), set(), setDatatype(), and tryAllocate().

Here is the caller graph for this function:

void FEM_Attribute::setLength ( int  l,
const char *  caller = "" 
)

Set our length (number of rows, or records) to this value.

Default implementation calls setLength on our owning entity and tries to call allocate().

Definition at line 536 of file fem_mesh.C.

References bad(), getLength(), FEM_Entity::setLength(), and tryAllocate().

Referenced by set().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::setWidth ( int  w,
const char *  caller = "" 
)

Set our width (number of values per row) to this value.

The default implementation sets width and tries to call allocate().

Definition at line 544 of file fem_mesh.C.

References bad(), getWidth(), ghost, setWidth(), and tryAllocate().

Referenced by copyShape(), register_data(), set(), and setWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::setDatatype ( int  dt,
const char *  caller = "" 
)

Set our datatype (e.g., FEM_INT, FEM_DOUBLE) to this value.

The default implementation sets width and tries to call allocate().

Definition at line 553 of file fem_mesh.C.

References bad(), getDatatype(), ghost, setDatatype(), and tryAllocate().

Referenced by copyShape(), register_data(), set(), and setDatatype().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::copyShape ( const FEM_Attribute src  )  [virtual]

Copy our width and datatype from this attribute.

The default implementation calls setWidth and setDatatype. which should be enough for virtually any attribute.

Definition at line 562 of file fem_mesh.C.

References getDatatype(), getWidth(), setDatatype(), and setWidth().

Referenced by FEM_Entity::copyShape().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::tryAllocate ( void   ) 

Check if all three of length, width, and datatype are set, but we're not yet allocated.

If so, call allocate; else ignore.

Definition at line 641 of file fem_mesh.C.

References allocate(), allocated, femVersion, getDatatype(), getLength(), getMax(), getRealLength(), getRealWidth(), and getWidth().

Referenced by allocated(), pup(), pupSingle(), reallocate(), setDatatype(), setLength(), and setWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::reallocate ( void   )  [inline]

Our parent's length has changed: reallocate our storage.

Definition at line 393 of file fem_mesh.h.

References allocated, and tryAllocate().

Here is the call graph for this function:

bool FEM_Attribute::isAllocated ( void   )  const [inline]

Return true if we've already had storage allocated.

Definition at line 396 of file fem_mesh.h.

References allocated.

void FEM_Attribute::set ( const void *  src,
int  firstItem,
int  length,
const IDXL_Layout layout,
const char *  caller 
) [virtual]

Set our data to these (typically user-supplied, unchecked) values.

Subclasses normally override this method as: virtual void set( ...) { super::set(...); copy data from src. }

Definition at line 567 of file fem_mesh.C.

References bad(), CmiAbort(), femVersion, getDatatype(), getLength(), getRealLength(), getRealWidth(), getWidth(), setDatatype(), setLength(), setWidth(), IDXL_Layout::type, and IDXL_Layout::width.

Referenced by FEM_Mesh_data_layoutP().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Attribute::get ( void *  dest,
int  firstItem,
int  length,
const IDXL_Layout layout,
const char *  caller 
) const [virtual]

Extract this quantity of user data.

Length and layout are parameter checked by the default implementation. Subclasses normally override this method as: virtual void get( ...) { super::get(...); copy data to dest. }

Definition at line 595 of file fem_mesh.C.

References bad(), getDatatype(), getLength(), getWidth(), IDXL_Layout::type, and IDXL_Layout::width.

Referenced by FEM_Mesh_data_layoutP(), FEM_REFINE2D_Split(), makeGhost(), makeGhosts(), and ParFUM_generateGlobalNodeNumbers().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void FEM_Attribute::copyEntity ( int  dstEntity,
const FEM_Attribute src,
int  srcEntity 
) [pure virtual]

Copy everything associated with src[srcEntity] into our dstEntity.

Referenced by FEM_Entity::copyEntity(), FEM_Interpolate::FEM_InterpolateElementCopy(), FEM_Interpolate::FEM_InterpolateNodeOnEdge(), FEM_REFINE2D_Split(), and FEM_Refine_Operation().

Here is the caller graph for this function:

void FEM_Attribute::register_data ( void *  dest,
int  length,
int  max,
const IDXL_Layout layout,
const char *  caller 
) [virtual]

Register this user data for this attributre Length, layout etc are checked by the default implementaion.

Definition at line 615 of file fem_mesh.C.

References bad(), femVersion, getDatatype(), getRealWidth(), getWidth(), setDatatype(), setWidth(), IDXL_Layout::type, and IDXL_Layout::width.

Here is the call graph for this function:

void FEM_Attribute::bad ( const char *  field,
bool  forRead,
int  cur,
int  next,
const char *  caller 
) const [private]

Abort with a nice error message saying:.

Our <field> was previously set to <cur>; it cannot now be <next>

virtual void FEM_Attribute::allocate ( int  length,
int  width,
int  datatype 
) [protected, pure virtual]

Allocate storage for at least length width-item records of type datatype.

This routine is called after all three parameters are set, as a convenience for subclasses.

virtual void FEM_Attribute::pup ( PUP::er p  )  [virtual]

virtual void FEM_Attribute::pupSingle ( PUP::er p,
int  pupindx 
) [virtual]

void FEM_Attribute::setGhost ( FEM_Attribute ghost_  )  [inline]

Install this attribute as our ghost:.

Definition at line 414 of file ParFUM_internals.h.

References ghost.

bool FEM_Attribute::isGhost ( void   )  const [inline]

Return true if we're a ghost.

Definition at line 417 of file ParFUM_internals.h.

References ghost.

int FEM_Attribute::getAttr ( void   )  const [inline]

Return our attribute code.

Definition at line 420 of file ParFUM_internals.h.

References attr.

FEM_Entity* FEM_Attribute::getEntity ( void   )  [inline]

Definition at line 422 of file ParFUM_internals.h.

References e.

int FEM_Attribute::getLength ( void   )  const

Return the number of rows in our table of data (0 if unknown).

This value is obtained directly from our owning Entity.

int FEM_Attribute::getRealLength ( void   )  const

int FEM_Attribute::getMax (  ) 

int FEM_Attribute::getWidth ( void   )  const [inline]

Return the number of columns in our table of data (0 if unknown).

Definition at line 432 of file ParFUM_internals.h.

References width.

int FEM_Attribute::getRealWidth ( void   )  const [inline]

Definition at line 433 of file ParFUM_internals.h.

References width.

int FEM_Attribute::getDatatype ( void   )  const [inline]

Return our FEM_* datatype (-1 if unknown).

Definition at line 436 of file ParFUM_internals.h.

References datatype.

void FEM_Attribute::setLength ( int  l,
const char *  caller = "" 
)

Set our length (number of rows, or records) to this value.

Default implementation calls setLength on our owning entity and tries to call allocate().

void FEM_Attribute::setWidth ( int  w,
const char *  caller = "" 
)

Set our width (number of values per row) to this value.

The default implementation sets width and tries to call allocate().

void FEM_Attribute::setDatatype ( int  dt,
const char *  caller = "" 
)

Set our datatype (e.g., FEM_INT, FEM_DOUBLE) to this value.

The default implementation sets width and tries to call allocate().

virtual void FEM_Attribute::copyShape ( const FEM_Attribute src  )  [virtual]

Copy our width and datatype from this attribute.

The default implementation calls setWidth and setDatatype. which should be enough for virtually any attribute.

void FEM_Attribute::tryAllocate ( void   ) 

Check if all three of length, width, and datatype are set, but we're not yet allocated.

If so, call allocate; else ignore.

void FEM_Attribute::reallocate ( void   )  [inline]

Our parent's length has changed: reallocate our storage.

Definition at line 469 of file ParFUM_internals.h.

References allocated, and tryAllocate().

Here is the call graph for this function:

bool FEM_Attribute::isAllocated ( void   )  const [inline]

Return true if we've already had storage allocated.

Definition at line 472 of file ParFUM_internals.h.

References allocated.

virtual void FEM_Attribute::set ( const void *  src,
int  firstItem,
int  length,
const IDXL_Layout layout,
const char *  caller 
) [virtual]

Set our data to these (typically user-supplied, unchecked) values.

Subclasses normally override this method as: virtual void set( ...) { super::set(...); copy data from src. }

virtual void FEM_Attribute::get ( void *  dest,
int  firstItem,
int  length,
const IDXL_Layout layout,
const char *  caller 
) const [virtual]

Extract this quantity of user data.

Length and layout are parameter checked by the default implementation. Subclasses normally override this method as: virtual void get( ...) { super::get(...); copy data to dest. }

virtual void FEM_Attribute::copyEntity ( int  dstEntity,
const FEM_Attribute src,
int  srcEntity 
) [pure virtual]

Copy everything associated with src[srcEntity] into our dstEntity.

virtual void FEM_Attribute::register_data ( void *  dest,
int  length,
int  max,
const IDXL_Layout layout,
const char *  caller 
) [virtual]

Register this user data for this attributre Length, layout etc are checked by the default implementaion.


Field Documentation

Definition at line 312 of file fem_mesh.h.

Referenced by getEntity(), getMax(), getRealLength(), and MeshElem::operator+=().

My attribute code (e.g., FEM_DATA+7, FEM_CONN, etc.).

Definition at line 314 of file fem_mesh.h.

Referenced by getAttr(), and PUPmarshall().

Number of columns in our table of data (initially unknown).

Definition at line 316 of file fem_mesh.h.

Referenced by getRealWidth(), and getWidth().

Datatype of entries (initially unknown).

Definition at line 317 of file fem_mesh.h.

Referenced by getDatatype().

True if subclass allocate has been called.

Definition at line 318 of file fem_mesh.h.

Referenced by isAllocated(), reallocate(), and tryAllocate().

Owning entity (to get length, etc.).

Definition at line 384 of file ParFUM_internals.h.

Ghost attribute, which has the same width and datatype as us (or 0).

Definition at line 386 of file ParFUM_internals.h.


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

Generated on Mon Sep 21 08:24:00 2020 for Charm++ by  doxygen 1.5.5