FEI Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
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
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.
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
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();
86
87 void messageAbort(const char* message);
88
89 void calculateConnectivity(GlobalID* conn, int size, GlobalID elemID);
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 *********
125
126 //************* element IDs and connectivities ********
129
130 //************* boundary condition stuff **************
131 std::vector<GlobalID> BCNodeIDs_;
132 std::vector<double> BCValues_;
133};
134
135int init_elem_connectivities(FEI* fei, PoissonData& poissonData);
136
138 PoissonData& poissonData);
139
140int set_shared_nodes(FEI* fei, PoissonData& poissonData);
141
142int set_shared_nodes(fei::VectorSpace* nodeSpace, PoissonData& poissonData);
143
144int load_elem_data(FEI* fei, PoissonData& poissonData);
145
146int load_elem_data_putrhs(FEI* fei, PoissonData& poissonData);
147
148int load_elem_data(fei::MatrixGraph* matrixGraph,
149 fei::Matrix* mat, fei::Vector* rhs,
150 PoissonData& poissonData);
151
152int load_BC_data(FEI* fei, PoissonData& poissonData);
153
154int load_BC_data(fei::LinearSystem* linSys, PoissonData& poissonData);
155
156#endif
157
int init_elem_connectivities(FEI *fei, PoissonData &poissonData)
int load_elem_data(FEI *fei, PoissonData &poissonData)
int set_shared_nodes(FEI *fei, PoissonData &poissonData)
int load_BC_data(FEI *fei, PoissonData &poissonData)
int load_elem_data_putrhs(FEI *fei, PoissonData &poissonData)
Definition FEI.hpp:144
int getNumBCNodes()
void getTopSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
GlobalID getElemBlockID()
void addBCNode(GlobalID nodeID, double x, double y)
bool elemIDsAllocated_
GlobalID * getElementConnectivity(GlobalID elemID)
GlobalID * getBCNodeIDs()
GlobalID * getLocalElementIDs()
void calculateConnectivity(GlobalID *conn, int size, GlobalID elemID)
void initializeFieldStuff()
double * getElemLoad(GlobalID elemID)
GlobalID * elemIDs_
int getBCFieldID()
void printSharedNodes(const char *str, int numShared, GlobalID *nodeIDs, int **shareProcs, int *numShareProcs)
void getBottomSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
int * getFieldIDs()
int getNumFields()
void getLeftSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
std::vector< double > BCValues_
void messageAbort(const char *message)
int * getNumFieldsPerNodeList()
void calculateBCs()
void getRightSharedNodes(int &numShared, GlobalID *sharedNodeIDs, int *numProcsPerSharedNode, int **sharingProcs)
int * getFieldSizes()
int getNumLocalElements()
double ** getElemStiffness(GlobalID elemID)
PoissonData(int L, int numProcs, int localProc, int outputLevel)
double * getBCValues()
std::vector< GlobalID > BCNodeIDs_
int getNumNodesPerElement()
GlobalID elemBlockID_
int getElemFormat()
int ** getNodalFieldIDsTable()
void deleteFieldArrays()
void calculateDistribution()
Poisson_Elem * elem_
bool fieldArraysAllocated_
int numElemNodes() const
int GlobalID
Definition fei_defs.h:60