95 |
at time node. For two dimensional domains back values are ignored. |
at time node. For two dimensional domains back values are ignored. |
96 |
|
|
97 |
@ivar domain: domain |
@ivar domain: domain |
|
@ivar left_bottom_front: (in) coordinates of left, bottom, front corner |
|
|
of the box |
|
|
@ivar right_top_back: (in) coordinates of the right, top, back corner |
|
|
of the box |
|
98 |
@ivar value_left_bottom_front: (in) value at left,bottom,front corner |
@ivar value_left_bottom_front: (in) value at left,bottom,front corner |
99 |
@ivar value_right_bottom_front: (in) value at right, bottom, front corner |
@ivar value_right_bottom_front: (in) value at right, bottom, front corner |
100 |
@ivar value_left_top_front: (in) value at left,top,front corner |
@ivar value_left_top_front: (in) value at left,top,front corner |
108 |
def __init__(self, debug=False): |
def __init__(self, debug=False): |
109 |
ParameterSet.__init__(self, debug=debug) |
ParameterSet.__init__(self, debug=debug) |
110 |
self.declareParameter(domain=None, |
self.declareParameter(domain=None, |
|
left_bottom_front=[0.,0.,0.], |
|
|
right_top_back=[1.,1.,1.], |
|
111 |
value_left_bottom_front=0., |
value_left_bottom_front=0., |
112 |
value_right_bottom_front=0., |
value_right_bottom_front=0., |
113 |
value_left_top_front=0., |
value_left_top_front=0., |
126 |
""" |
""" |
127 |
x = self.domain.getX() |
x = self.domain.getX() |
128 |
if self.domain.getDim() == 2: |
if self.domain.getDim() == 2: |
129 |
f_right = (x[0] - self.left_bottom_front[0])/\ |
x0,x1=x[0],x[1] |
130 |
(self.right_top_back[0] - self.left_bottom_front[0]) |
left_bottom_front0,right_top_back0=inf(x0),sup(x0) |
131 |
|
left_bottom_front1,right_top_back1=inf(x[1]),sup(x[1]) |
132 |
|
f_right = (x[0] - self.left_bottom_front0)/\ |
133 |
|
(self.right_top_back0 - self.left_bottom_front0) |
134 |
f_left = 1. - f_right |
f_left = 1. - f_right |
135 |
f_top = (x[1] - self.left_bottom_front[1])/\ |
f_top = (x[1] - self.left_bottom_front1)/\ |
136 |
(self.right_top_back[1] - self.left_bottom_front[1]) |
(self.right_top_back1 - self.left_bottom_front1) |
137 |
f_bottom = 1. - f_top |
f_bottom = 1. - f_top |
138 |
out = f_left * f_bottom * self.value_left_bottom_front \ |
out = f_left * f_bottom * self.value_left_bottom_front \ |
139 |
+ f_right * f_bottom * self.value_right_bottom_front \ |
+ f_right * f_bottom * self.value_right_bottom_front \ |
140 |
+ f_left * f_top * self.value_left_top_front \ |
+ f_left * f_top * self.value_left_top_front \ |
141 |
+ f_right * f_top * self.value_right_top_front |
+ f_right * f_top * self.value_right_top_front |
142 |
else: |
else: |
143 |
f_right = (x[0] - self.left_bottom_front[0])/\ |
x0,x1,x2=x[0],x[1],x[2] |
144 |
(self.right_top_back[0] - self.left_bottom_front[0]) |
left_bottom_front0,right_top_back0=inf(x0),sup(x0) |
145 |
|
left_bottom_front1,right_top_back1=inf(x[1]),sup(x[1]) |
146 |
|
left_bottom_front2,right_top_back2=inf(x[2]),sup(x[2]) |
147 |
|
f_right = (x[0] - self.left_bottom_front0)/\ |
148 |
|
(self.right_top_back0 - self.left_bottom_front0) |
149 |
f_left = 1. - f_right |
f_left = 1. - f_right |
150 |
f_top = (x[1] - self.left_bottom_front[1])/\ |
f_top = (x[1] - self.left_bottom_front1)/\ |
151 |
(self.right_top_back[1] - self.left_bottom_front[1]) |
(self.right_top_back1 - self.left_bottom_front1) |
152 |
f_bottom = 1. - f_top |
f_bottom = 1. - f_top |
153 |
f_back = (x[2] - self.left_bottom_front[1])/\ |
f_back = (x[2] - self.left_bottom_front1)/\ |
154 |
(self.right_top_back[2] - self.left_bottom_front[2]) |
(self.right_top_back2 - self.left_bottom_front2) |
155 |
f_front = 1. - f_back |
f_front = 1. - f_back |
156 |
out = f_left * f_bottom * f_front * self.value_left_bottom_front\ |
out = f_left * f_bottom * f_front * self.value_left_bottom_front\ |
157 |
+ f_right * f_bottom * f_front * self.value_right_bottom_front\ |
+ f_right * f_bottom * f_front * self.value_right_bottom_front\ |
208 |
""" |
""" |
209 |
Returns a linear combination of the f0*v0+f1*v1+f2*v2+f3*v3+f4*v4 |
Returns a linear combination of the f0*v0+f1*v1+f2*v2+f3*v3+f4*v4 |
210 |
|
|
211 |
@ivar f0: (in) numerical object or None, default=None (in) |
@ivar f0: numerical object or None, default=None (in) |
212 |
@ivar v0: (in) numerical object or None, default=None (in) |
@ivar v0: numerical object or None, default=None (in) |
213 |
@ivar f1: (in) numerical object or None, default=None (in) |
@ivar f1: numerical object or None, default=None (in) |
214 |
@ivar v1: (in) numerical object or None, default=None (in) |
@ivar v1: numerical object or None, default=None (in) |
215 |
@ivar f2: (in) numerical object or None, default=None (in) |
@ivar f2: numerical object or None, default=None (in) |
216 |
@ivar v2: (in) numerical object or None, default=None (in) |
@ivar v2: numerical object or None, default=None (in) |
217 |
@ivar f3: (in) numerical object or None, default=None (in) |
@ivar f3: numerical object or None, default=None (in) |
218 |
@ivar v3: (in) numerical object or None, default=None (in) |
@ivar v3: numerical object or None, default=None (in) |
219 |
@ivar f4: (in) numerical object or None, default=None (in) |
@ivar f4: numerical object or None, default=None (in) |
220 |
@ivar v4: (in) numerical object or None, default=None (in) |
@ivar v4: numerical object or None, default=None (in) |
221 |
""" |
""" |
222 |
def __init__(self,debug=False): |
def __init__(self,debug=False): |
223 |
Model.__init__(self,debug=debug) |
Model.__init__(self,debug=debug) |