MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LocalDataElement.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 _LOCAL_DATA_ELEMENT_H
10 #define _LOCAL_DATA_ELEMENT_H
11 
12 class SrcFinfo;
13 class FuncOrder;
14 
21 {
22  public:
32  LocalDataElement( Id id, const Cinfo* c, const string& name,
33  unsigned int numData = 1 );
34 
39  LocalDataElement( Id id, const Element* orig, unsigned int n );
40 
45 
49  Element* copyElement( Id newParent, Id newId, unsigned int n,
50  bool toGlobal ) const;
51 
53  // Information access fields
55 
57  unsigned int numData() const;
58 
60  unsigned int localDataStart() const;
61 
63  unsigned int getNode( unsigned int dataId ) const;
64 
66  unsigned int startDataIndex( unsigned int node ) const;
67 
69  unsigned int rawIndex( unsigned int dataId ) const;
70 
71 
73  bool isGlobal() const {
74  return false;
75  }
76 
78  unsigned int getNumOnNode( unsigned int node ) const;
79 
81  // data access stuff
83 
94  void resize( unsigned int newNumData );
95 
97  // Utility function for figuring out node data assignments when
98  // the data array is resized.
100  unsigned int setDataSize( unsigned int numData );
101 
102  private:
109  unsigned int numData_;
110 
116  unsigned int numPerNode_;
117 
121  unsigned int localDataStart_;
122 };
123 
124 #endif // _LOCAL_DATA_ELEMENT_H
unsigned int numData_
unsigned int getNode(unsigned int dataId) const
Inherited virtual. Returns node location of specified object.
unsigned int localDataStart() const
Inherited virtual. Returns index of first entry on this node.
void resize(unsigned int newNumData)
Element * copyElement(Id newParent, Id newId, unsigned int n, bool toGlobal) const
unsigned int numData() const
Inherited virtual. Returns number of data entries over all nodes.
unsigned int setDataSize(unsigned int numData)
unsigned int numPerNode_
bool isGlobal() const
Inherited virtual. Reports if this is Global, which it isn't.
unsigned int startDataIndex(unsigned int node) const
Inherited virtual. Returns start DataIndex on specified node.
static char name[]
Definition: mfield.cpp:401
unsigned int getNumOnNode(unsigned int node) const
Inherited virtual.
Definition: Id.h:17
unsigned int rawIndex(unsigned int dataId) const
Converts dataId to index on current node.
unsigned int localDataStart_
Definition: Cinfo.h:18
LocalDataElement(Id id, const Cinfo *c, const string &name, unsigned int numData=1)