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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 10 months ago) by ksteube
File size: 2076 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #include "Bruce.h"
17
18 #include "BruceException.h"
19 #include "BruceFactory.h"
20
21 #include <boost/python/extract.hpp>
22
23 #include <iostream>
24 #include <sstream>
25
26 using namespace std;
27 using namespace escript;
28
29 namespace bruce {
30
31 AbstractContinuousDomain* brick(int n0, int n1, int n2,
32 double l0, double l1, double l2)
33 {
34 double v0_len, v1_len, v2_len;
35
36 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 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 v0.push_back(0);
65 v0.push_back(0);
66
67 v1.push_back(0);
68 v1.push_back(v1_len);
69 v1.push_back(0);
70
71 v2.push_back(0);
72 v2.push_back(0);
73 v2.push_back(v2_len);
74
75 AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, n2, origin);
76 return temp;
77 }
78
79 AbstractContinuousDomain* rectangle(int n0, int n1,
80 double l0, double l1)
81 {
82 double v0_len, v1_len;
83
84 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 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 v0.push_back(0);
106
107 v1.push_back(0);
108 v1.push_back(v1_len);
109
110 AbstractContinuousDomain* temp=new Bruce(v0, v1, v2, n0, n1, 0, origin);
111 return temp;
112 }
113
114 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26