/[escript]/trunk/esys2/bruce/src/Bruce/BruceFactory.cpp
ViewVC logotype

Diff of /trunk/esys2/bruce/src/Bruce/BruceFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 152 by jgs, Thu Sep 22 01:55:00 2005 UTC revision 153 by jgs, Tue Oct 25 01:51:20 2005 UTC
# Line 28  namespace bruce { Line 28  namespace bruce {
28  AbstractContinuousDomain* brick(int n0, int n1, int n2,  AbstractContinuousDomain* brick(int n0, int n1, int n2,
29                                  double l0, double l1, double l2)                                  double l0, double l1, double l2)
30  {  {
31    int numElements[]={n0,n1,n2};    double v0_len, v1_len, v2_len;
   double length[]={l0,l1,l2};  
32    
33    Bruce::DimVec v0;    Bruce::DimVec v0;
34    Bruce::DimVec v1;    Bruce::DimVec v1;
# Line 40  AbstractContinuousDomain* brick(int n0, Line 39  AbstractContinuousDomain* brick(int n0,
39    origin.push_back(0);    origin.push_back(0);
40    origin.push_back(0);    origin.push_back(0);
41    
42    v0.push_back(l0/n0);    if (n0<2) {
43        v0_len = 0;
44      } else {
45        v0_len = l0/(n0-1);
46      }
47    
48      if (n1<2) {
49        v1_len = 0;
50      } else {
51        v1_len = l1/(n1-1);
52      }
53    
54      if (n2<2) {
55        v2_len = 0;
56      } else {
57        v2_len = l2/(n2-1);
58      }
59    
60      v0.push_back(v0_len);
61    v0.push_back(0);    v0.push_back(0);
62    v0.push_back(0);    v0.push_back(0);
63    
64    v1.push_back(0);    v1.push_back(0);
65    v1.push_back(l1/n1);    v1.push_back(v1_len);
66    v1.push_back(0);    v1.push_back(0);
67    
68    v2.push_back(0);    v2.push_back(0);
69    v2.push_back(0);    v2.push_back(0);
70    v2.push_back(l2/n2);    v2.push_back(v2_len);
71    
72    AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin);    AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin);
73    return temp;    return temp;
# Line 59  AbstractContinuousDomain* brick(int n0, Line 76  AbstractContinuousDomain* brick(int n0,
76  AbstractContinuousDomain* rectangle(int n0, int n1,  AbstractContinuousDomain* rectangle(int n0, int n1,
77                                      double l0, double l1)                                      double l0, double l1)
78  {  {
79    int numElements[]={n0,n1};    double v0_len, v1_len;
   double length[]={l0,l1};  
80    
81    Bruce::DimVec v0;    Bruce::DimVec v0;
82    Bruce::DimVec v1;    Bruce::DimVec v1;
# Line 70  AbstractContinuousDomain* rectangle(int Line 86  AbstractContinuousDomain* rectangle(int
86    origin.push_back(0);    origin.push_back(0);
87    origin.push_back(0);    origin.push_back(0);
88    
89    v0.push_back(l0/n0);    if (n0<2) {
90        v0_len = 0;
91      } else {
92        v0_len = l0/(n0-1);
93      }
94    
95      if (n1<2) {
96        v1_len = 0;
97      } else {
98        v1_len = l1/(n1-1);
99      }
100    
101      v0.push_back(v0_len);
102    v0.push_back(0);    v0.push_back(0);
103    
104    v1.push_back(0);    v1.push_back(0);
105    v1.push_back(l1/n1);    v1.push_back(v1_len);
106    
107    AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin);    AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin);
108    return temp;    return temp;
109  }  }
110    
111  }  // end of namespace  } // end of namespace

Legend:
Removed from v.152  
changed lines
  Added in v.153

  ViewVC Help
Powered by ViewVC 1.1.26