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