MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FieldElement.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2013 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 #ifndef _FIELD_ELEMENT_H
10 #define _FIELD_ELEMENT_H
11 
18 class FieldElement: public Element
19 {
20  public:
21  FieldElement( Id parent, Id kid, const Cinfo* c, const string& name,
22  const FieldElementFinfoBase* fef
23  );
24 
25  ~FieldElement();
26 
30  Element* copyElement( Id newParent, Id newId, unsigned int n,
31  bool toGlobal ) const;
32 
35  unsigned int numData() const;
36 
38  unsigned int numLocalData() const;
39 
41  unsigned int localDataStart() const;
42 
44  unsigned int numField( unsigned int rawIndex ) const;
45 
47  unsigned int totNumLocalField() const;
48 
50  unsigned int getNode( unsigned int dataId ) const;
51 
53  unsigned int startDataIndex ( unsigned int node ) const;
54 
56  unsigned int rawIndex( unsigned int dataId ) const;
57 
62  bool hasFields() const {
63  return true;
64  }
65 
67  bool isGlobal() const;
68 
70  unsigned int getNumOnNode( unsigned int node ) const;
71 
73  // data access stuff
75 
93  char* data( unsigned int rawIndex,
94  unsigned int fieldIndex = 0 ) const;
95 
101  void resize( unsigned int newNumData );
102 
107  void resizeField(
108  unsigned int rawIndex, unsigned int newNumField );
109 
115  void zombieSwap( const Cinfo* zCinfo );
116 
117  private:
120 };
121 
122 #endif // _FIELD_ELEMENT_H
unsigned int startDataIndex(unsigned int node) const
Virtual: Returns start DataIndex on specified node.
bool hasFields() const
Definition: FieldElement.h:62
void resize(unsigned int newNumData)
unsigned int numField(unsigned int rawIndex) const
Virtual: Returns number of field entries for specified data.
const FieldElementFinfoBase * fef_
Definition: FieldElement.h:119
Element * copyElement(Id newParent, Id newId, unsigned int n, bool toGlobal) const
unsigned int getNumOnNode(unsigned int node) const
Inherited virtual.
char * data(unsigned int rawIndex, unsigned int fieldIndex=0) const
unsigned int numLocalData() const
Virtual: Returns number of data entries on current node.
unsigned int localDataStart() const
Virtual: Returns index of first data entry on this node.
unsigned int getNode(unsigned int dataId) const
Virtual: Returns location of specified dataId.
FieldElement(Id parent, Id kid, const Cinfo *c, const string &name, const FieldElementFinfoBase *fef)
void resizeField(unsigned int rawIndex, unsigned int newNumField)
static char name[]
Definition: mfield.cpp:401
void zombieSwap(const Cinfo *zCinfo)
unsigned int numData() const
Virtual: Returns number of data entries.
Definition: Id.h:17
unsigned int rawIndex(unsigned int dataId) const
Virtual: Returns converted dataId to index on current node.
unsigned int totNumLocalField() const
Virtual: Returns number of field entries on current node.
Definition: Cinfo.h:18
bool isGlobal() const
Virtual. Returns true if global, ie, if its parent is global.