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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 465 - (hide annotations)
Wed Jan 25 01:08:17 2006 UTC (15 years, 6 months ago) by jgs
File size: 2409 byte(s)
reorganise bruce source tree:
move all from src/Bruce -> src
remove inc
adjust all #includes appropriately


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 465 #include "BruceFactory.h"
17 jgs 150
18     using namespace std;
19     using namespace escript;
20    
21     namespace bruce {
22    
23 jgs 151 AbstractContinuousDomain* brick(int n0, int n1, int n2,
24     double l0, double l1, double l2)
25 jgs 150 {
26 jgs 153 double v0_len, v1_len, v2_len;
27 jgs 150
28 jgs 151 Bruce::DimVec v0;
29     Bruce::DimVec v1;
30     Bruce::DimVec v2;
31     Bruce::DimVec origin;
32    
33     origin.push_back(0);
34     origin.push_back(0);
35     origin.push_back(0);
36    
37 jgs 153 if (n0<2) {
38     v0_len = 0;
39     } else {
40     v0_len = l0/(n0-1);
41     }
42    
43     if (n1<2) {
44     v1_len = 0;
45     } else {
46     v1_len = l1/(n1-1);
47     }
48    
49     if (n2<2) {
50     v2_len = 0;
51     } else {
52     v2_len = l2/(n2-1);
53     }
54    
55     v0.push_back(v0_len);
56 jgs 151 v0.push_back(0);
57     v0.push_back(0);
58    
59     v1.push_back(0);
60 jgs 153 v1.push_back(v1_len);
61 jgs 151 v1.push_back(0);
62    
63     v2.push_back(0);
64     v2.push_back(0);
65 jgs 153 v2.push_back(v2_len);
66 jgs 151
67     AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin);
68     return temp;
69 jgs 150 }
70    
71 jgs 151 AbstractContinuousDomain* rectangle(int n0, int n1,
72 jgs 150 double l0, double l1)
73     {
74 jgs 153 double v0_len, v1_len;
75 jgs 150
76 jgs 151 Bruce::DimVec v0;
77     Bruce::DimVec v1;
78     Bruce::DimVec v2;
79     Bruce::DimVec origin;
80    
81     origin.push_back(0);
82     origin.push_back(0);
83    
84 jgs 153 if (n0<2) {
85     v0_len = 0;
86     } else {
87     v0_len = l0/(n0-1);
88     }
89    
90     if (n1<2) {
91     v1_len = 0;
92     } else {
93     v1_len = l1/(n1-1);
94     }
95    
96     v0.push_back(v0_len);
97 jgs 151 v0.push_back(0);
98    
99     v1.push_back(0);
100 jgs 153 v1.push_back(v1_len);
101 jgs 151
102     AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin);
103     return temp;
104 jgs 150 }
105    
106 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