~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/fei/base/fei_BlockDescriptor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
//====Constructor===============================================================
15
15
BlockDescriptor::BlockDescriptor()
16
 
 : numNodesPerElement(0),
17
 
   blockID_(-1),
 
16
 : blockID_(-1),
 
17
   numNodesPerElement_(0),
18
18
   numFieldsPerNode_(NULL),
19
19
   nodalFieldIDs_(NULL),
20
20
   fieldIDsAllocated_(false),
43
43
 
44
44
//==============================================================================
45
45
void BlockDescriptor::destroyFieldArrays() {
46
 
   if (numNodesPerElement == 0) return;
 
46
   if (numNodesPerElement_ == 0) return;
47
47
 
48
 
   for(int i=0; i<numNodesPerElement; i++) {
 
48
   for(int i=0; i<numNodesPerElement_; i++) {
49
49
      delete [] nodalFieldIDs_[i];
50
50
   }
51
51
 
53
53
   nodalFieldIDs_ = NULL;
54
54
   delete [] numFieldsPerNode_;
55
55
   numFieldsPerNode_ = NULL;
56
 
   numNodesPerElement = 0;
 
56
   numNodesPerElement_ = 0;
57
57
}
58
58
 
59
59
//==============================================================================
65
65
 
66
66
  destroyFieldArrays();
67
67
 
68
 
  numNodesPerElement = numNodes;
69
 
 
70
 
  numFieldsPerNode_ = new int[numNodesPerElement];
71
 
 
72
 
  for(int i=0; i<numNodesPerElement; i++) {
 
68
  numNodesPerElement_ = numNodes;
 
69
 
 
70
  numFieldsPerNode_ = new int[numNodesPerElement_];
 
71
 
 
72
  for(int i=0; i<numNodesPerElement_; i++) {
73
73
    numFieldsPerNode_[i] = 0;
74
74
  }
75
75
  return(0);
84
84
//==============================================================================
85
85
int BlockDescriptor::allocateFieldIDsTable()
86
86
{
87
 
  nodalFieldIDs_ = new int*[numNodesPerElement];
 
87
  nodalFieldIDs_ = new int*[numNodesPerElement_];
88
88
  bool rowsAllZeroLength = true;
89
89
 
90
 
  for(int i=0; i<numNodesPerElement; i++) {
 
90
  for(int i=0; i<numNodesPerElement_; i++) {
91
91
    if (numFieldsPerNode_[i] > 0) {
92
92
      nodalFieldIDs_[i] = new int[numFieldsPerNode_[i]];
93
93
      rowsAllZeroLength = false;
95
95
    else nodalFieldIDs_[i] = NULL;
96
96
  }
97
97
 
98
 
  if (rowsAllZeroLength || numNodesPerElement == 0) {
 
98
  if (rowsAllZeroLength || numNodesPerElement_ == 0) {
99
99
    FEI_CERR << "BlockDescriptor::allocateFieldIDsTable: ERROR, all rows of"
100
100
         << " fieldIDs table have zero length. Set fieldsPerNode entries"
101
101
         << " first." << FEI_ENDL;
127
127
//also, unless the node lies on a block boundary and 'fieldID' is only in
128
128
//the other block.
129
129
//
130
 
   for(int i=0; i<numNodesPerElement; i++) {
 
130
   for(int i=0; i<numNodesPerElement_; i++) {
131
131
      for(int j=0; j<numFieldsPerNode_[i]; j++) {
132
132
         if (nodalFieldIDs_[i][j] == fieldID) return(true);
133
133
      }