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

Annotation of /trunk/bruce/src/BruceFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 475 - (hide annotations)
Mon Jan 30 05:36:15 2006 UTC (15 years, 5 months ago) by jgs
File size: 2534 byte(s)
rationalise #includes

1 jgs 150 /* $Id$ */
2     /*
3     ******************************************************************************
4     * *
5     * COPYRIGHT ACcESS 2005 - All Rights Reserved *
6     * *
7     * This software is the property of ACcESS. No part of this code *
8     * may be copied in any form or by any means without the expressed written *
9     * consent of ACcESS. Copying, use or modification of this software *
10     * by any unauthorised person is illegal unless that person has a software *
11     * license agreement with ACcESS. *
12     * *
13     ******************************************************************************
14     */
15    
16 jgs 475 #include "Bruce.h"
17    
18     #include "BruceException.h"
19 jgs 465 #include "BruceFactory.h"
20 jgs 150
21 jgs 475 #include <boost/python/extract.hpp>
22    
23     #include <iostream>
24     #include <sstream>
25    
26 jgs 150 using namespace std;
27     using namespace escript;
28    
29     namespace bruce {
30    
31 jgs 151 AbstractContinuousDomain* brick(int n0, int n1, int n2,
32     double l0, double l1, double l2)
33 jgs 150 {
34 jgs 153 double v0_len, v1_len, v2_len;
35 jgs 150
36 jgs 151 Bruce::DimVec v0;
37     Bruce::DimVec v1;
38     Bruce::DimVec v2;
39     Bruce::DimVec origin;
40    
41     origin.push_back(0);
42     origin.push_back(0);
43     origin.push_back(0);
44    
45 jgs 153 if (n0<2) {
46     v0_len = 0;
47     } else {
48     v0_len = l0/(n0-1);
49     }
50    
51     if (n1<2) {
52     v1_len = 0;
53     } else {
54     v1_len = l1/(n1-1);
55     }
56    
57     if (n2<2) {
58     v2_len = 0;
59     } else {
60     v2_len = l2/(n2-1);
61     }
62    
63     v0.push_back(v0_len);
64 jgs 151 v0.push_back(0);
65     v0.push_back(0);
66    
67     v1.push_back(0);
68 jgs 153 v1.push_back(v1_len);
69 jgs 151 v1.push_back(0);
70    
71     v2.push_back(0);
72     v2.push_back(0);
73 jgs 153 v2.push_back(v2_len);
74 jgs 151
75     AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin);
76     return temp;
77 jgs 150 }
78    
79 jgs 151 AbstractContinuousDomain* rectangle(int n0, int n1,
80 jgs 150 double l0, double l1)
81     {
82 jgs 153 double v0_len, v1_len;
83 jgs 150
84 jgs 151 Bruce::DimVec v0;
85     Bruce::DimVec v1;
86     Bruce::DimVec v2;
87     Bruce::DimVec origin;
88    
89     origin.push_back(0);
90     origin.push_back(0);
91    
92 jgs 153 if (n0<2) {
93     v0_len = 0;
94     } else {
95     v0_len = l0/(n0-1);
96     }
97    
98     if (n1<2) {
99     v1_len = 0;
100     } else {
101     v1_len = l1/(n1-1);
102     }
103    
104     v0.push_back(v0_len);
105 jgs 151 v0.push_back(0);
106    
107     v1.push_back(0);
108 jgs 153 v1.push_back(v1_len);
109 jgs 151
110     AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin);
111     return temp;
112 jgs 150 }
113    
114 jgs 153 } // end of namespace

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26