FEI Version of the Day
HexBeam.hpp
00001 /*
00002 // @HEADER
00003 // ************************************************************************
00004 //             FEI: Finite Element Interface to Linear Solvers
00005 //                  Copyright (2005) Sandia Corporation.
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
00008 // U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Alan Williams (william@sandia.gov) 
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 */
00042 
00043 
00044 #ifndef _HexBeam_h_
00045 #define _HexBeam_h_
00046 
00047 #include <fei_base.hpp>
00048 
00059 class HexBeam {
00060  public:
00061   enum { OneD = 0, TwoD = 1, ThreeD = 2 };
00062 
00063   HexBeam(int W, int D, int DofPerNode,
00064     int decomp, int numProcs, int localProc);
00065   virtual ~HexBeam();
00066 
00067   virtual bool inErrorState() { return( inErrorState_ ); }
00068 
00069   virtual int numNodesPerElem() { return( nodesPerElem_ ); }
00070 
00071   virtual int numDofPerNode() { return( dofPerNode_ ); }
00072 
00073   virtual int numLocalElems() { return( localNumElems_ ); }
00074 
00075   virtual int numLocalNodes() { return( localNumNodes_ ); }
00076 
00077   virtual int firstLocalElem() { return( firstLocalElem_ ); }
00078 
00079   virtual int getElemConnectivity(int elemID, int* nodeIDs);
00080 
00081   virtual int getElemStiffnessMatrix(int elemID, double* elemMat);
00082 
00083   virtual int getElemLoadVector(int elemID, double* elemVec);
00084 
00085   virtual int getNumBCNodes();
00086 
00087   virtual int getBCNodes(int numNodes, int* nodeIDs);
00088 
00089   virtual int getBCValues(int numBCNodes, int* offsetsIntoField, double* vals);
00090 
00091   virtual int getNumSharedNodes();
00092 
00093   virtual int getSharedNodes(int numSharedNodes,
00094          int*& sharedNodes,
00095          int*& numSharingProcsPerNode,
00096          int**& sharingProcs);
00097 
00098   virtual int getNumCRs() { return( 0 ); }
00099 
00100   virtual int getNumNodesPerCR() { return( 0 ); }
00101 
00102   virtual int getCRNodes(int** nodeIDs) { (void)nodeIDs; return(0); }
00103 
00104   int W_;
00105   int D_;
00106   int decomp_;
00107   int numProcs_;
00108   int localProc_;
00109 
00110   int totalNumElems_;
00111   int totalNumNodes_;
00112   int localNumElems_;
00113   int localNumNodes_;
00114   int firstLocalElem_;
00115   int firstLocalNode_;
00116 
00117   int numElemsPerSlice_;
00118   int numNodesPerSlice_;
00119   int numLocalSlices_;
00120 
00121   bool inErrorState_;
00122 
00123   int nodesPerElem_;
00124   int dofPerNode_;
00125 
00126   int numLocalDOF_;
00127   int numGlobalDOF_;
00128 };
00129 
00130 namespace HexBeam_Functions {
00131 
00132 int init_elem_connectivities(FEI* fei, HexBeam& hexcube);
00133 
00134 int init_shared_nodes(FEI* fei, HexBeam& hexcube);
00135 
00136 int init_constraints(FEI* fei, HexBeam& hexcube, int& firstLocalCRID);
00137 
00138 int load_elem_data(FEI* fei, HexBeam& hexcube);
00139 
00140 int load_constraints(FEI* fei, HexBeam& hexcube, int firstLocalCRID);
00141 
00142 int load_BC_data(FEI* fei, HexBeam& hexcube);
00143 
00144 int print_cube_data(HexBeam& hexcube, int numProcs, int localProc);
00145 
00146 
00147 int init_elem_connectivities(fei::MatrixGraph* matrixGraph, HexBeam& hexcube);
00148 
00149 int init_shared_nodes(fei::MatrixGraph* matrixGraph, HexBeam& hexcube);
00150 
00151 int init_constraints(fei::MatrixGraph* matrixGraph, HexBeam& hexcube,
00152          int localProc, int& firstLocalCRID);
00153 
00154 int init_slave_constraints(fei::MatrixGraph* matrixGraph, HexBeam& hexcube);
00155 
00156 int load_elem_data(fei::MatrixGraph* matrixGraph,
00157        fei::Matrix* mat,
00158        fei::Vector* rhs,
00159        HexBeam& hexcube);
00160 
00161 int load_constraints(fei::LinearSystem* linSys, HexBeam& hexcube,
00162          int firstLocalCRID);
00163 
00164 int load_BC_data(fei::LinearSystem* linSys, HexBeam& hexcube);
00165 
00166 }//namespace HexBeam_Functions
00167 
00168 #endif // _HexBeam_h_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends