ElemBlock.cpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #include <fei_macros.hpp>
00010 #include <fei_defs.h>
00011 #include <test_utils/ElemBlock.hpp>
00012 #include <cstdlib>
00013 
00014 //==============================================================================
00015 ElemBlock::ElemBlock()
00016  : blockID_(0),
00017    numElements_(0),
00018    numNodesPerElement_(0),
00019    numFieldsPerNode_(NULL),
00020    nodalFieldIDs_(NULL),
00021    elemIDs_(NULL),
00022    elemConn_(NULL),
00023    numStiffRows_(0),
00024    elemFormat_(0),
00025    elemStiff_(NULL),
00026    elemLoad_(NULL),
00027    numElemDOF_(0),
00028    elemDOFFieldIDs_(NULL),
00029    interleaveStrategy_(0),
00030    lumpingStrategy_(0)
00031 {
00032 }
00033 
00034 //==============================================================================
00035 ElemBlock::~ElemBlock() {
00036    deleteMemory();
00037 }
00038 
00039 //==============================================================================
00040 void ElemBlock::deleteMemory() {
00041    for(int i=0; i<numElements_; i++) {
00042       for(int j=0; j<numStiffRows_; j++) {
00043          delete [] elemStiff_[i][j];
00044       }
00045       delete [] elemStiff_[i];
00046       delete [] elemLoad_[i];
00047       delete [] elemConn_[i];
00048    }
00049 
00050    for(int j=0; j<numNodesPerElement_; j++) {
00051       delete [] nodalFieldIDs_[j];
00052    }
00053    delete [] nodalFieldIDs_;
00054    delete [] numFieldsPerNode_;
00055 
00056    delete [] elemStiff_;
00057    delete [] elemLoad_;
00058    delete [] elemConn_;
00059    delete [] elemIDs_;
00060 
00061    if (numElemDOF_ > 0) {
00062       delete [] elemDOFFieldIDs_;
00063       numElemDOF_ = 0;
00064    }
00065 
00066    numElements_ = 0;
00067    numNodesPerElement_ = 0;
00068 }
00069 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:23 2011 for FEI by  doxygen 1.6.3