Changeset 233 for trunk/src/mesh
- Timestamp:
- Mar 1, 2006 9:46:19 AM (18 years ago)
- Location:
- trunk/src/mesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mesh/mesh.cc
r229 r233 50 50 // 0,0,1 51 51 // }; 52 // 52 53 // 2. numNodes: total number of nodes 53 54 // … … 55 56 // error codes 56 57 // 57 RP_ERROR RpMesh3d::addAllNodes(int numNodes, int* nodes[]) 58 RP_ERROR 59 //RpMesh3d::addAllNodes(int numNodes, int nodes[][3]) 60 RpMesh3d::addAllNodes(int numNodes, int* nodes) 58 61 { 59 62 if (numNodes != m_numNodes) … … 61 64 62 65 for (int i=0; i<numNodes; i++) { 63 m_nodeList[i].set( nodes[i]);66 m_nodeList[i].set(&(nodes[i*3])); 64 67 m_nodeList[i].id(i); 65 68 } … … 79 82 // error codes 80 83 // 81 RP_ERROR RpMesh3d::addNode(int* nodeVal) 84 RP_ERROR 85 RpMesh3d::addNode(int* nodeVal) 82 86 { 83 87 if (m_nodeIndex < m_numNodes) { … … 100 104 // error codes 101 105 // 102 RP_ERROR RpMesh3d::addElement(int numNodes, const int* nodes) 106 RP_ERROR 107 RpMesh3d::addElement(int numNodes, const int* nodes) 103 108 { 104 109 if (numNodes != (*m_elemList)[0].numNodes()) … … 116 121 } 117 122 123 // 124 // add all elements to mesh 125 // 126 // Input: 127 // elemArray: a 2d array, e.g.: 128 // static int elem[6][4] = { 129 // 0,1,5,6, 130 // 1,2,6,7, 131 // 2,3,7,1, 132 // 3,4,1,2, 133 // 5,6,2,3, 134 // 6,7,3,4 135 // }; 136 // 137 // numElements: number of elements in mesh 138 // Note: number of nodes in an element must match the number when mesh object 139 // was instantiated. 140 // 141 // 142 RP_ERROR 143 RpMesh3d::addAllElements(int numElements, int* elemArray) 144 { 145 if (numElements != m_numElements) 146 return RP_ERR_WRONG_NUM_NODES; 147 148 // number of nodes in an element 149 int numNodes = (*m_elemList)[0].numNodes(); 150 for (int i=0; i < m_numElements; i++) { 151 (*m_elemList)[i].addNodes(&(elemArray[i*numNodes]), numNodes); 152 } 153 154 return RP_SUCCESS; 155 } 156 118 157 // retrieve nodes 119 158 void … … 122 161 if (nodeSeqNum < m_numNodes) 123 162 m_nodeList[nodeSeqNum].get(x, y, z); 124 125 163 } 126 164 … … 135 173 } 136 174 137 RP_ERROR RpMesh3d::getNodesList(int* nodesList, int& num) 138 { 139 } 140 141 RpElement RpMesh3d::getElement(int elemSeqNum) 142 { 143 } 144 145 RP_ERROR RpMesh3d::getElement(int elemSeqNum, int* nodesBuf) 146 { 175 RP_ERROR 176 RpMesh3d::getNodesList(int* nodesList, int& num) 177 { 178 return RP_SUCCESS; 179 } 180 181 RpElement 182 RpMesh3d::getElement(int elemSeqNum) 183 { 184 return RP_SUCCESS; 185 } 186 187 RP_ERROR 188 RpMesh3d::getElement(int elemSeqNum, int* nodesBuf) 189 { 190 return RP_SUCCESS; 147 191 } 148 192 149 193 // serialization 150 char* RpMesh3d::serialize() 151 { 152 153 } 154 155 RP_ERROR RpMesh3d::serialize(char* buf, int buflen) 156 { 157 } 158 159 RP_ERROR RpMesh3d::deserialize(const char* buf) 160 { 194 char* 195 RpMesh3d::serialize() 196 { 197 return NULL; 198 } 199 200 RP_ERROR 201 RpMesh3d::serialize(char* buf, int buflen) 202 { 203 204 return RP_SUCCESS; 205 } 206 207 RP_ERROR 208 RpMesh3d::deserialize(const char* buf) 209 { 210 return RP_SUCCESS; 161 211 } 162 212 … … 202 252 } 203 253 204 -
trunk/src/mesh/mesh.h
r228 r233 24 24 25 25 // add all nodes to mesh 26 RP_ERROR addAllNodes(int numNodes, int* nodesList []);26 RP_ERROR addAllNodes(int numNodes, int* nodesList); 27 27 28 28 // add one node to mesh … … 31 31 // add an element to mesh 32 32 RP_ERROR addElement(int numNodesInElem, const int* nodes); 33 34 // add all elements to mesh 35 RP_ERROR addAllElements(int numElements, int* elementArray); 33 36 34 37 // retrieve nodes
Note: See TracChangeset
for help on using the changeset viewer.