1 |
/* $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 |
#include "bruce/Bruce/BruceFactory.h" |
17 |
#include "bruce/Bruce/BruceException.h" |
18 |
|
19 |
#include <iostream> |
20 |
#include <sstream> |
21 |
#include <boost/python/extract.hpp> |
22 |
|
23 |
using namespace std; |
24 |
using namespace escript; |
25 |
|
26 |
namespace bruce { |
27 |
|
28 |
AbstractContinuousDomain* brick(int n0, int n1, int n2, |
29 |
double l0, double l1, double l2) |
30 |
{ |
31 |
int numElements[]={n0,n1,n2}; |
32 |
double length[]={l0,l1,l2}; |
33 |
|
34 |
Bruce::DimVec v0; |
35 |
Bruce::DimVec v1; |
36 |
Bruce::DimVec v2; |
37 |
Bruce::DimVec origin; |
38 |
|
39 |
origin.push_back(0); |
40 |
origin.push_back(0); |
41 |
origin.push_back(0); |
42 |
|
43 |
v0.push_back(l0/n0); |
44 |
v0.push_back(0); |
45 |
v0.push_back(0); |
46 |
|
47 |
v1.push_back(0); |
48 |
v1.push_back(l1/n1); |
49 |
v1.push_back(0); |
50 |
|
51 |
v2.push_back(0); |
52 |
v2.push_back(0); |
53 |
v2.push_back(l2/n2); |
54 |
|
55 |
AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin); |
56 |
return temp; |
57 |
} |
58 |
|
59 |
AbstractContinuousDomain* rectangle(int n0, int n1, |
60 |
double l0, double l1) |
61 |
{ |
62 |
int numElements[]={n0,n1}; |
63 |
double length[]={l0,l1}; |
64 |
|
65 |
Bruce::DimVec v0; |
66 |
Bruce::DimVec v1; |
67 |
Bruce::DimVec v2; |
68 |
Bruce::DimVec origin; |
69 |
|
70 |
origin.push_back(0); |
71 |
origin.push_back(0); |
72 |
|
73 |
v0.push_back(l0/n0); |
74 |
v0.push_back(0); |
75 |
|
76 |
v1.push_back(0); |
77 |
v1.push_back(l1/n1); |
78 |
|
79 |
AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin); |
80 |
return temp; |
81 |
} |
82 |
|
83 |
} // end of namespace |