FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PoissonData.hpp
Go to the documentation of this file.
1 #ifndef _PoissonData_h_
2 #define _PoissonData_h_
3 /*--------------------------------------------------------------------*/
4 /* Copyright 2005 Sandia Corporation. */
5 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
6 /* non-exclusive license for use of this work by or on behalf */
7 /* of the U.S. Government. Export of this program may require */
8 /* a license from the United States Government. */
9 /*--------------------------------------------------------------------*/
10 
11 #include <fei_base.hpp>
12 //
13 //This is a class for use in exercising FEI implementations.
14 //
15 //This class sets up test data for the Poisson equation on a 2D square,
16 //and provides query functions for obtaining that data.
17 //
18 //The calling program (the 'user' of PoissonData) is left
19 //with the task of calling the FEI functions.
20 //
21 //Also note:
22 //
23 // 1. This class only provides 1 element-block per processor currently.
24 // 2. The function calculateBCs() must be called before the boundary
25 // condition data is requested.
26 //
27 // Alan Williams 12-20-2000
28 //
29 
30 class PoissonData {
31  public:
32  //constructor -- see PoissonData.cpp for descriptions of these
33  //parameters.
34  PoissonData(int L,
35  int numProcs, int localProc, int outputLevel);
36 
37  //destructor.
38  ~PoissonData();
39 
40  int getElemFormat() {return(elemFormat_); };
41 
42  //hardwired for only 1 field...
43  int getNumFields() { return(1);};
44  int* getFieldSizes() { return(&fieldSize_);};
45  int* getFieldIDs() { return(&fieldIDs_[0][0]);};
46 
48 
51  int getNumNodesPerElement() { return(elem_->numElemNodes()); };
52 
53  int* getNumFieldsPerNodeList() { return( numFields_ ); };
54  int** getNodalFieldIDsTable() { return( fieldIDs_ ); };
55 
57 
58  double** getElemStiffness(GlobalID elemID);
59  double* getElemLoad(GlobalID elemID);
60 
61  void addBCNode(GlobalID nodeID, double x, double y);
62 
63  void calculateBCs();
64 
65  int getNumBCNodes() { return( BCNodeIDs_.size() ); }
66  GlobalID* getBCNodeIDs() { return( &BCNodeIDs_[0] ); }
67  int getBCFieldID() { return( fieldIDs_[0][0] ); }
68  double* getBCValues() { return( &BCValues_[0] ); }
69 
70 
71  void getLeftSharedNodes(int& numShared, GlobalID* sharedNodeIDs,
72  int* numProcsPerSharedNode,
73  int** sharingProcs);
74  void getRightSharedNodes(int& numShared, GlobalID* sharedNodeIDs,
75  int* numProcsPerSharedNode,
76  int** sharingProcs);
77  void getTopSharedNodes(int& numShared, GlobalID* sharedNodeIDs,
78  int* numProcsPerSharedNode,
79  int** sharingProcs);
80  void getBottomSharedNodes(int& numShared, GlobalID* sharedNodeIDs,
81  int* numProcsPerSharedNode,
82  int** sharingProcs);
83  private:
84  void check1();
85  void calculateDistribution();
86 
87  void messageAbort(const char* message);
88 
89  void calculateConnectivity(GlobalID* conn, int size, GlobalID elemID);
90  void initializeFieldStuff();
91  void deleteFieldArrays();
92 
93  void printSharedNodes(const char* str,
94  int numShared,
95  GlobalID* nodeIDs,
96  int** shareProcs,
97  int* numShareProcs);
98 
99  Poisson_Elem* elem_; //we're only going to have 1 element instance!!
102 
106 
107  int L_;
110 
113 
119 
120  //*************** field description variables *********
123  int** fieldIDs_;
125 
126  //************* element IDs and connectivities ********
129 
130  //************* boundary condition stuff **************
131  std::vector<GlobalID> BCNodeIDs_;
132  std::vector<double> BCValues_;
133 };
134 
135 int init_elem_connectivities(FEI* fei, PoissonData& poissonData);
136 
138  PoissonData& poissonData);
139 
140 int set_shared_nodes(FEI* fei, PoissonData& poissonData);
141 
142 int set_shared_nodes(fei::VectorSpace* nodeSpace, PoissonData& poissonData);
143 
144 int load_elem_data(FEI* fei, PoissonData& poissonData);
145 
146 int load_elem_data_putrhs(FEI* fei, PoissonData& poissonData);
147 
148 int load_elem_data(fei::MatrixGraph* matrixGraph,
149  fei::Matrix* mat, fei::Vector* rhs,
150  PoissonData& poissonData);
151 
152 int load_BC_data(FEI* fei, PoissonData& poissonData);
153 
154 int load_BC_data(fei::LinearSystem* linSys, PoissonData& poissonData);
155 
156 #endif
157 
int numElemNodes() const
bool elemIDsAllocated_
double ** getElemStiffness(GlobalID elemID)
void calculateBCs()
void messageAbort(const char *message)
GlobalID * getBCNodeIDs()
Definition: PoissonData.hpp:66
int GlobalID
Definition: fei_defs.h:60
int * getNumFieldsPerNodeList()
Definition: PoissonData.hpp:53
GlobalID getElemBlockID()
Definition: PoissonData.hpp:47
void getTopSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
void getBottomSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
double * getBCValues()
Definition: PoissonData.hpp:68
void addBCNode(GlobalID nodeID, double x, double y)
int load_elem_data_putrhs(FEI *fei, PoissonData &poissonData)
std::vector< double > BCValues_
int getElemFormat()
Definition: PoissonData.hpp:40
GlobalID * getElementConnectivity(GlobalID elemID)
void initializeFieldStuff()
void deleteFieldArrays()
int init_elem_connectivities(FEI *fei, HexBeam &hexcube)
Definition: HexBeam.cpp:280
int load_elem_data(FEI *fei, HexBeam &hexcube)
Definition: HexBeam.cpp:440
Definition: FEI.hpp:144
int * numFields_
void calculateDistribution()
int set_shared_nodes(FEI *fei, PoissonData &poissonData)
int ** getNodalFieldIDsTable()
Definition: PoissonData.hpp:54
int getBCFieldID()
Definition: PoissonData.hpp:67
void getLeftSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
void check1()
Definition: PoissonData.cpp:97
GlobalID * elemIDs_
int numLocalElements_
PoissonData(int L, int numProcs, int localProc, int outputLevel)
Definition: PoissonData.cpp:30
void printSharedNodes(const char *str, int numShared, GlobalID *nodeIDs, int **shareProcs, int *numShareProcs)
bool fieldArraysAllocated_
int load_BC_data(FEI *fei, HexBeam &hexcube)
Definition: HexBeam.cpp:484
void getRightSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
void calculateConnectivity(GlobalID *conn, int size, GlobalID elemID)
GlobalID elemBlockID_
int localProc(MPI_Comm comm)
int * getFieldIDs()
Definition: PoissonData.hpp:45
int getNumFields()
Definition: PoissonData.hpp:43
int getNumBCNodes()
Definition: PoissonData.hpp:65
std::vector< GlobalID > BCNodeIDs_
int * getFieldSizes()
Definition: PoissonData.hpp:44
int getNumNodesPerElement()
Definition: PoissonData.hpp:51
double * getElemLoad(GlobalID elemID)
Poisson_Elem * elem_
Definition: PoissonData.hpp:99
int getNumLocalElements()
Definition: PoissonData.hpp:49
int nodesPerElement_
GlobalID * getLocalElementIDs()
Definition: PoissonData.hpp:50
int numProcs(MPI_Comm comm)
int ** fieldIDs_