Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_PDE_2DMesh.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2014 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_PDE_2DMesh.h,v $
27 //
28 // Purpose : This is the class for mesh processing/ownership.
29 // of two dimensional meshes.
30 //
31 // Special Notes :
32 //
33 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
34 //
35 // Creation Date : 04/21/02
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.20.2.1 $
41 //
42 // Revision Date : $Date: 2014/02/26 20:16:31 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-------------------------------------------------------------------------
46 
47 #ifndef Xyce_N_DEV_PDE_2DMesh__h
48 #define Xyce_N_DEV_PDE_2DMesh__h
49 
50 // ---------- Standard Includes ----------
51 #include <list>
52 #include <vector>
53 
54 // ---------- Xyce Includes ----------
55 #include <N_DEV_fwd.h>
56 #include <N_DEV_PDEMeshContainer.h>
57 #include <N_UTL_Xyce.h>
58 #include <N_DEV_CompositeParam.h>
59 #include <N_DEV_PDE_Electrode.h>
60 
61 // ---------- Preprocessor Defines ----------
62 
63 // these are used by function computeIntPB:
64 #define TAG12 0
65 #define TAG23 1
66 #define TAG13 2
67 
68 #define VERTEX_A 0 // vertex A
69 #define VERTEX_B 1 // vertex B
70 #define VERTEX_C 2 // vertex C
71 #define VERTEX_D 3 // vertex D
72 
73 #define EDGE_AB 0 // edge AB
74 #define EDGE_BC 1 // edge BC
75 #define EDGE_AC 2 // edge AC
76 #define EDGE_CD 2 // edge CD
77 #define EDGE_AD 3 // edge AD
78 
79 #define TYPE_EDGE 7 // edge label
80 #define TYPE_REGION 8 // region label
81 
82 
83 namespace Xyce {
84 namespace Device {
85 
86 // ---------- Forward Declarations ----------
87 class mNode;
88 class mEdge;
89 class mCell;
90 class mLabel;
91 class mNodeInfo;
92 class mEdgeInfo;
93 
94 
95 class NADJ;
96 class MESHHEAD;
97 class XLATCONST;
98 class XLATLABEL;
99 class NODE;
100 class EDGE;
101 class TRI;
102 class EDGEINFO;
103 class NODEINFO;
104 
105 // ---------- Enum Definitions ----------
106 // mesh types:
107 enum meshType {
110  NUMTYPE // total number of 2D mesh types
111 };
112 
113 //-----------------------------------------------------------------------------
114 // Class : PDE_2DMesh : public PDEMeshContainer
115 // Purpose :
116 // Special Notes :
117 // Creator : Eric Keiter
118 // Creation Date : 04/21/02
119 //-----------------------------------------------------------------------------
121 {
122 public:
123  PDE_2DMesh (const DeviceOptions & do1, int sgplotLevel1);
124 
125  PDE_2DMesh (const PDE_2DMesh & right);
126 
127  ~PDE_2DMesh ();
128 
129  // Assignment operator.
130  PDE_2DMesh & operator=(PDE_2DMesh const & rhsMesh);
131 
132  bool initializeMesh (const std::string & meshFileName_tmp);
133 
135  (int nx, int ny,
136  double xlength, double ylength,
137  int numElectrodes, std::string & outputMeshFileName,
138  std::map<std::string,PDE_2DElectrode*> & elMap,
139  bool cylFlag);
140 
141  bool resizeMesh (double xlength, double ylength);
142 
143  // output mesh information:
144  void dumpMesh ();
145  void printLabels ();
146  void outputMeshInfo ();
147 
148  int getNumNodes ();
149  int getNumEdges ();
150  int getNumCells ();
151  int getNumLabels();
152 
153  int getMaxNodeNN ();
154 
155  double getMaxSize ();
156 
157  double getXMax ();
158  double getXMin ();
159  double getYMax ();
160  double getYMin ();
161 
162  double interp (double *F, double r, double z);
163  bool interpVector (double *F, double r, double z, double & xvec, double & yvec);
164 
165  void findCell(double r, double z, int & isuccess,
166  int & inode, int & iCell, int iStartCell = 0);
167 
168  double findMinDist(int iCell, double r, double z);
169 
170  double compAngle( double x1, double y1,
171  double x2, double y2,
172  double x3, double y3);
173 
174  bool scaleMesh (double xScale);
175 
176  bool labelNameExist (std::string & labelName);
177  bool labelEdgeType (std::string & labelName);
178  bool dopingVectorExist ();
179 
180  bool getDopingVector (std::vector<double> & cvec_tmp);
181  bool getXVector (std::vector<double> & xvec_tmp);
182  bool getYVector (std::vector<double> & yvec_tmp);
183 
184  double * getDopingVector ();
185  double * getXVector ();
186  double * getYVector ();
187 
188  mNode * getNode (int i);
189  mEdge * getEdge (int i);
190  mCell * getCell (int i);
191  mLabel * getLabel (int i);
192  mLabel * getLabel (std::string & name);
193 
194  double lengthAdjust (double x1, double y1, double x2, double y2);
195 
196  int ** getNodeIndexVector ();
197 
198 protected:
199 private:
200  bool readSGFMeshFile (const std::string & meshFileName_tmp);
201 
202  bool writeSGFMeshFile (const std::string & meshFileName_tmp);
203 
204  bool setupInternalMesh (int nx, int ny, double xlength, double ylength);
205 
207 
208  bool errorCheckElectrodes (int numElectrodes,
209  std::map<std::string,PDE_2DElectrode*> & elMap);
210 
211  bool setupDefaultLabels (int numberElectrodes);
212 
213  bool setupInternalLabels (int numberElectrodes,
214  std::map<std::string,PDE_2DElectrode*> & elMap);
215 
216  bool setupGeometry ();
217 
218  bool computeIntPB (double &x, double &y,
219  int inodeA,int inodeB,int inodeC);
220 
221  double areaAdjust (double x1, double y1,
222  double x2, double y2,
223  double x3, double y3);
224 
225  double computeAngle (int inode1,int inode2,int inode3);
226 
227  bool cellNodes ();
228 
229  bool fCCWorder (int inode1, int inode2, int inode3);
230 
231  void calcAdjacencyInfo ();
232 
234  (NADJ &nadj, int itri, int iVertex, int uIntLabel, bool fCW);
235 
236  void getElementInfo
237  (int itri, int *ainode, int *aiedge, int *aitri, int *auLabel);
238 
239  void elementNodes (int itri, int *ainode);
240 
241 public:
242  bool cylGeom; // cylindrical geometry flag. refactor later.
243 
244 protected:
245 
246 
247 private:
248  PDE_2DMesh ();
249 
250  std::string meshFileName;
251 
253 
254  double xMax;
255  double yMax;
256  double xMin;
257  double yMin;
258  double dx;
259  double dy;
260 
261  double xRatio, yRatio;
262 
263  double x0;
265 
266  double vol; // total volume of domain
267  double invVol; // inverse of the total volume
268 
269  double surfArea; // surface area
270  double circum; // total circumference
271  double invCircum; // inverse of the total circumference.
272 
273  double depth; // if this is a cartesian mesh, depth in z-direction.
274 
275  int numAdj; // number of edge adjacency structures
276  // (>= numNodes. Every mNode class has at least one.)
277 
278  int numNodes;
279  int numEdges;
280  int numCells;
282  int numRegLabels; // Number of region labels. (no edge labels, etc.)
283 
284  int numBndryNodes; // This is the number of nodes that sit on
285  // boundaries between regions.
286 
287  int maxNodeNN; // maximum number of nearest neighbors for a node.
288 
289  int iRecentCellLookup; // This var is the result of the most
290  // recent "findCell" call (if that function
291  // has indeed been called). It can be used
292  // for subsequent findCell calls, as the
293  // iStartCell argument. The findCell function
294  // searches over the mesh, proceeding from
295  // cell to cell via nearest neighbors.
296  // If it has a good starting point, the search goes
297  // much, much faster.
298 
299  bool dopingSet; // doping array was read in from mesh file.
300 
301  std::vector<mNode> mNodeVector;
302  std::vector<mEdge> mEdgeVector;
303  std::vector<mCell> mCellVector;
304  std::vector<mLabel> mLabelVector;
305 
306  std::vector<double> dopingVector;
307  std::vector<double> xVector;
308  std::vector<double> yVector;
309 
310  std::vector<int> visitCellFlagVec;
311 
312  std::map<std::string, mLabel> mLabelMap;
313 
314  // used for the internally generated mesh.
315  int ixMax;
316  int iyMax;
317  int ** nodeIndices;
318  int ** edgeIndices;
319  int ** cellIndices;
320 
321  // arrays used by calcAdjacencyInfo:
322  std::vector<int> afVisitedVec;
323  int * aiBegin; // change these to STL later...
324  int * aiEnd;
326 
328 
330 
332 };
333 
334 //-----------------------------------------------------------------------------
335 // Much of what follows are 2D mesh primitives. If I ever get around to doing
336 // things in 3D I will reuse as much of this as possible, and rename things
337 // that can't be re-used (to have either the string "2D" or "3D" somewhere
338 // in the name).
339 //-----------------------------------------------------------------------------
340 
341 //-----------------------------------------------------------------------------
342 // Class : mNode
343 // Purpose : mesh node class
344 // Special Notes :
345 // Creator : Eric Keiter
346 // Creation Date : 04/21/02
347 //-----------------------------------------------------------------------------
348 class mNode
349 {
350 public:
351  mNode ();
352 
353 protected:
354 private:
355 
356 public:
357  double x; // x coordinate
358  double y; // y coordinate
359 
360  // node adjacency information:
361  double area; // area of integration box
362  int cnode; // number of adjacent nodes
363  int inode; // index of node under analysis
364  int numCells; // number of cells
365 
366  int edgeStatus; // if boundary between regions = 0
367  // if exterior then = 1
368  // if interior then = 2
369 
370  bool fBndry; // set if node is a boundary node.
371  bool fGotAll; // set if all nodes were visited.
372 
373  std::vector<EDGEINFO> edgeInfoVector;
374 
375 protected:
376 private:
377 };
378 
379 //-----------------------------------------------------------------------------
380 // Class : mEdge
381 // Purpose : mesh edge class
382 //
383 // Special Notes : "1" and "A" are conceptually the same.
384 // "2" and "B" are conceptually the same.
385 //
386 // For box integration, the "local" node is always node A,
387 // while the neighbor node is always node B.
388 //
389 // Creator : Eric Keiter
390 // Creation Date : 04/21/02
391 //-----------------------------------------------------------------------------
392 class mEdge
393 {
394 public:
395  mEdge ();
396 
397 protected:
398 private:
399 
400 public:
401  int uLabel; // edge label
402  int inodeA; // index of node A
403  int inodeB; // index of node B
404 
405  int edgeStatus; // if boundary between regions = 0
406  // if exterior then = 1
407  // if interior then = 2
408 
409  // edge geometry information:
410  double ilen; // integration length
411  double elen; // edge length
412  double Area1; // partial area 1, nodeA
413  double Area2; // partial area 2, nodeB
414 
415  double angle; // angle between edge and x-axis.
416  double midpoint_x;
417  double midpoint_y;
418 
419  int iedge; // edge index
420  int ielem; // element index
421 
422 protected:
423 private:
424 };
425 
426 //-----------------------------------------------------------------------------
427 // Class : mCell
428 // Purpose : mesh cell class.
429 // Special Notes :
430 // Creator : Eric Keiter
431 // Creation Date : 04/21/02
432 //-----------------------------------------------------------------------------
433 class mCell
434 {
435 public:
436  mCell ();
437 
438 protected:
439 private:
440 
441 public:
442  int uLabel; // region label
443 
444  int iedgeAB; // index of edge AB
445  int iedgeBC; // index of edge BC
446  int iedgeCD; // index of edge AC or CD
447  int iedgeDA; // index of edge DA
448 
449  int icellAB; // index of cell adj. to edge AB
450  int icellBC; // index of cell adj. to edge BC
451  int icellCD; // index of cell adj. to edge AC or CD
452  int icellDA; // index of cell adj. to edge DA
453 
454  // owned nodes:
455  int inodeA;
456  int inodeB;
457  int inodeC;
458  int inodeD;
459 
460  std::vector<int> mNodeVector; // container of owned node indices.
461 
462 protected:
463 private:
464 };
465 
466 
467 //-----------------------------------------------------------------------------
468 // Class : mLabel
469 // Purpose : mesh label class.
470 // Special Notes :
471 // Creator : Eric Keiter
472 // Creation Date : 04/23/02
473 //-----------------------------------------------------------------------------
474 class mLabel
475 {
476 public:
477  mLabel ();
478 
479 protected:
480 private:
481 
482 public:
483  std::string name; // label name
484  int iIndex; // label index
485  int uType; // label type (region or edge)
486  int cNode; // number of nodes
487 
488  double vol; // volume of this region. (if it is a region...)
489  double surfArea; // surface area of this region.
490 
491  std::vector<int> mNodeVector;
492 };
493 
494 
495 //-----------------------------------------------------------------------------
496 // Class : mEdgeInfo
497 // Purpose : This class contains edge information for a single edge.
498 // Special Notes :
499 // Creator : Eric Keiter
500 // Creation Date : 04/21/02
501 //-----------------------------------------------------------------------------
503 {
504 public:
505 protected:
506 private:
507 
508 public:
509  double ilen; // integration length
510  double elen; // edge length
511  double area1; // partial area 1
512  double area2; // partial area 2
513  int iedge; // edge index
514  int inode; // node index
515  int icell; // cell index
516 
517 protected:
518 private:
519 };
520 
521 
522 //-----------------------------------------------------------------------------
523 // Class : mNodeInfo
524 // Purpose : This class contains node information for a single node.
525 // Special Notes :
526 // Creator : Eric Keiter
527 // Creation Date : 04/21/02
528 //-----------------------------------------------------------------------------
530 {
531 public:
532 protected:
533 private:
534 
535 public:
536  double area; // area of integration box
537  int numNeighbors; // number of neighbors
538  int numCells; // number of cells
539  mEdgeInfo *mEdgeInfoPtr; // edge information array
540 
541 protected:
542 private:
543 };
544 
545 //-----------------------------------------------------------------------------
546 // What follows are SGF mesh primitives. Most of these are only used for
547 // reading in SGF style mesh files, but some are used for calculating
548 // geometric mesh information.
549 //-----------------------------------------------------------------------------
550 
551 #define LEN_IDENT 15 // identifier length
552 
553 #define EDGESTATUS_BOUNDARY 0
554 #define EDGESTATUS_EXTERIOR 1
555 #define EDGESTATUS_INTERIOR 2
556 
557 //-----------------------------------------------------------------------------
558 // Class : MESHHEAD
559 // Purpose :
560 // Special Notes :
561 // Creator : Eric Keiter
562 // Creation Date : 04/23/02
563 //-----------------------------------------------------------------------------
564 // neighbor adjacency structure
565 class NADJ // nadj
566 {
567 public:
568  int cnode; // number of adjacent nodes
569  int inode; // index of node under analysis
570  bool fBndry; // set if node is a boundary node
571  bool fGotAll; // set if all nodes were visited
572  int ainode[32]; // indices of neighboring nodes
573  int aiedge[32]; // indices of "spoke" edges
574  int aielem[32]; // triangle indices
575  int auLabel[32]; // triangle labels
576 };
577 
578 //-----------------------------------------------------------------------------
579 // Class : MESHHEAD
580 // Purpose :
581 // Special Notes :
582 // Creator : Eric Keiter
583 // Creation Date : 04/23/02
584 //-----------------------------------------------------------------------------
585 class MESHHEAD
586 {
587 public:
588  char szLogo[64]; // text logo
589  char szSign[16]; // signature
590  unsigned int cConstant; // number of constants
591  unsigned int cLabel; // number of labels
592  unsigned int cArray; // number of 1D arrays
593  unsigned int cRegLabel; // number of region labels
594  unsigned int cBndryNode; // number of boundary nodes
595  unsigned int cNode; // number of nodes
596  unsigned int cEdge; // number of edges
597  unsigned int cTriangle; // number of triangles
598  bool fCylGeom; // cylindrical geometry flag
599 };
600 
601 //-----------------------------------------------------------------------------
602 // Class : XLATCONST
603 // Purpose :
604 // Special Notes :
605 // Creator : Eric Keiter
606 // Creation Date : 04/23/02
607 //-----------------------------------------------------------------------------
609 {
610 public:
611  char szName[LEN_IDENT+1]; // constant name
612  unsigned int uType; // constant type
613  union //
614  { double r; // value of real constant
615  int n; // value of integer constant
616  } data;
617 };
618 
619 //-----------------------------------------------------------------------------
620 // Class : XLATLABEL
621 // Purpose :
622 // Special Notes :
623 // Creator : Eric Keiter
624 // Creation Date : 04/23/02
625 //-----------------------------------------------------------------------------
627 {
628 public:
629  char szName[LEN_IDENT+1]; // label name
630  unsigned int iIndex; // label index
631  unsigned int uType; // label type
632  unsigned int cNode; // number of nodes
633 };
634 
635 //-----------------------------------------------------------------------------
636 // Class : NODE
637 // Purpose :
638 // Special Notes :
639 // Creator : Eric Keiter
640 // Creation Date : 04/23/02
641 //-----------------------------------------------------------------------------
642 class NODE
643 {
644 public:
645  double x; // x coordinate
646  double y; // y coordinate
647 };
648 
649 //-----------------------------------------------------------------------------
650 // Class : EDGE
651 // Purpose :
652 // Special Notes :
653 // Creator : Eric Keiter
654 // Creation Date : 04/23/02
655 //-----------------------------------------------------------------------------
656 class EDGE
657 {
658 public:
659  unsigned int uLabel; // edge label
660  int inodeA; // index of node A
661  int inodeB; // index of node B
662 };
663 
664 //-----------------------------------------------------------------------------
665 // Class : TRI
666 // Purpose :
667 // Special Notes :
668 // Creator : Eric Keiter
669 // Creation Date : 04/23/02
670 //-----------------------------------------------------------------------------
671 class TRI
672 {
673 public:
674  unsigned int uLabel; // region label
675  int iedgeAB; // index of edge AB
676  int iedgeBC; // index of edge BC
677  int iedgeAC; // index of edge AC or CD
678  int iedgeAD; // index of edge AD
679  int itriAB; // index of tri. adj. to edge AB
680  int itriBC; // index of tri. adj. to edge BC
681  int itriAC; // index of tri. adj. to edge AC or CD
682  int itriAD; // index of tri. adj. to edge AD
683 };
684 
685 //-----------------------------------------------------------------------------
686 // Class : EDGEINFO
687 // Purpose :
688 // Special Notes :
689 // Creator : Eric Keiter
690 // Creation Date : 04/23/02
691 //-----------------------------------------------------------------------------
692 class EDGEINFO
693 {
694 public:
695  double ilen; // integration length
696  double elen; // edge length
697  double Area1; // partial area 1
698  double Area2; // partial area 2
699  int iedge; // edge index
700  int inode; // node index
701  int ielem; // element index
702 
704  ilen(0.0), elen(0.0), Area1(0.0), Area2(0.0), iedge(-1), inode(-1), ielem(-1)
705  {};
706 
707 };
708 
709 
710 //-----------------------------------------------------------------------------
711 // Class : NODEINFO
712 // Purpose :
713 // Special Notes :
714 // Creator : Eric Keiter
715 // Creation Date : 04/23/02
716 //-----------------------------------------------------------------------------
717 class NODEINFO
718 {
719 public:
720  double Area; // area of integration box
721  unsigned int cNeighbor; // number of neighbors
722  unsigned int cTriangle; // number of triangles
723  EDGEINFO *aedgeinfo; // edge information array
724 };
725 
726 
727 //-----------------------------------------------------------------------------
728 // Class : mInterpAreaHelp
729 // Purpose : This is a helper class for performing interpolations
730 // on a mesh. It contains information about 3 points in space
731 // and performs a linear interpolation between them.
732 // Special Notes :
733 // Creator : Eric Keiter
734 // Creation Date : 09/18/02
735 //-----------------------------------------------------------------------------
737 {
738 public:
739  double x0,y0;
740  double x1,y1;
741  double x2,y2;
742  double v0,v1,v2;
743  double f0,f1,f2;
744  double vlim;
745  double aa, bb, cc;
747  int iend;
748 
749 public:
750  mInterpAreaHelp ();
751  double interpReg(double r, double z);
752  bool findCoef();
753 };
754 
755 //-----------------------------------------------------------------------------
756 // Class : mInterpEdgeHelp
757 // Purpose : This is a helper class for performing interpolations
758 // on a mesh. It contains information about an edge, including
759 // the linear equation for it. y = AA*x + BB.
760 //
761 // It also determines this edge's relationship to a point in
762 // space. An interpolation routine can use this help class
763 // to determine if a point in space falls within a mesh cell
764 // or not.
765 //
766 // Special Notes :
767 // Creator : Eric Keiter
768 // Creation Date : 09/18/02
769 //-----------------------------------------------------------------------------
771 {
772 public:
773  double xA;
774  double yA;
775  double xB;
776  double yB;
777 
778  double AA;
779  double BB;
780 
781  bool iflagx; // is the passed point between xA and xB of this edge?
782  bool iflagy; // is the passed point between yA and yB of this edge?
783 
784  bool x_hiFlag; // is this edge above the passed point in x?
785  bool x_loFlag; // is this edge below the passed point in x?
786  bool y_hiFlag; // is this edge above the passed point in y?
787  bool y_loFlag; // is this edge above the passed point in y?
788 
789 public:
790  mInterpEdgeHelp();
791  bool setupEdge (double r, double z);
792 
793 };
794 
795 
796 //------------------------ Inline functions ----------------------------------
797 
798 
799 inline int PDE_2DMesh::getNumNodes () { return numNodes; }
800 
801 inline int PDE_2DMesh::getNumEdges () { return numEdges; }
802 
803 inline int PDE_2DMesh::getNumCells () { return numCells; }
804 
805 inline int PDE_2DMesh::getNumLabels() { return numLabels; }
806 
807 inline int PDE_2DMesh::getMaxNodeNN () { return maxNodeNN; }
808 
809 inline double PDE_2DMesh::getMaxSize ()
810 { return (((yMax-yMin)>(xMax-xMin))?yMax:xMax); }
811 
812 inline double PDE_2DMesh::getXMax () {return xMax; }
813 inline double PDE_2DMesh::getXMin () {return xMin; }
814 inline double PDE_2DMesh::getYMax () {return yMax; }
815 inline double PDE_2DMesh::getYMin () {return yMin; }
816 
818 { return dopingSet; }
819 
820 inline double * PDE_2DMesh::getDopingVector ()
821 {
822  return &(dopingVector[0]);
823 }
824 
825 inline double * PDE_2DMesh::getXVector ()
826 {
827  return &(xVector[0]);
828 }
829 
830 inline double * PDE_2DMesh::getYVector ()
831 {
832  return &(yVector[0]);
833 }
834 
835 inline mNode * PDE_2DMesh::getNode (int i)
836 {
837  return &(mNodeVector[i]);
838 }
839 
840 inline mEdge * PDE_2DMesh::getEdge (int i)
841 {
842  return &(mEdgeVector[i]);
843 }
844 
845 inline mCell * PDE_2DMesh::getCell (int i)
846 {
847  return &(mCellVector[i]);
848 }
849 
850 inline mLabel * PDE_2DMesh::getLabel (int i)
851 {
852  return &(mLabelVector[i]);
853 }
854 
856 {
857  return nodeIndices;
858 }
859 
860 //-----------------------------------------------------------------------------
861 // Function : sq
862 // Purpose :
863 // Special Notes : put this somewhere else later...
864 //
865 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
866 // Creation Date : 04/22/02
867 //-----------------------------------------------------------------------------
868 inline double sq(double x)
869 {
870  return(x * x);
871 }
872 
873 //-----------------------------------------------------------------------------
874 // Function : PDE_2DElectrode::operator<<
875 // Purpose : "<<" operator
876 // Special Notes :
877 // Scope : public
878 // Creator : Eric R. Keiter, 9233, SNL, Parallel Computational Sciences
879 // Creation Date : 04/18/03
880 //-----------------------------------------------------------------------------
881 inline std::ostream & operator<<(std::ostream & os, const PDE_2DElectrode & el)
882 {
883  os << el.name << ":\n";
884  os << " node = " << el.nodeName << "\n";
885  os << " side = " << el.side << "\n";
886  os << " start = " << el.start << "\n";
887  os << " end = " << el.end << "\n";
888  os << std::endl;
889 
890  return os;
891 }
892 
893 } // namespace Device
894 } // namespace Xyce
895 
897 
898 #endif
899