2 |
|
|
3 |
|
|
4 |
from escript.escript import * |
from escript.escript import * |
5 |
from escript.modelframe import Model |
from escript.modelframe import Model,ParameterSet |
6 |
from finley import finley |
from finley import finley |
7 |
|
|
8 |
class RectangularDomain(Model): |
class RectangularDomain(Model): |
54 |
|
|
55 |
return self._domain |
return self._domain |
56 |
|
|
57 |
class ScalarConstrainer(Model): |
class ScalarConstrainer(ParameterSet): |
58 |
"""@brief creates a characteristic function for the location of constraints for a scalar value |
"""@brief creates a characteristic function for the location of constraints for a scalar value |
59 |
|
|
60 |
@param domain (in) - rectangular domain |
@param domain (in) - rectangular domain |
70 |
|
|
71 |
""" |
""" |
72 |
def __init__(self,debug=False): |
def __init__(self,debug=False): |
73 |
Model.__init__(self,debug=debug) |
ParameterSet.__init__(self,debug=debug) |
74 |
self.declareParameter(domain=None, \ |
self.declareParameter(domain=None, \ |
75 |
left=False, \ |
left=False, \ |
76 |
right=False, \ |
right=False, \ |
99 |
if self.top: self._location_of_constraint+=(x[1]-sup(x[1])).whereZero() |
if self.top: self._location_of_constraint+=(x[1]-sup(x[1])).whereZero() |
100 |
return self._location_of_constraint |
return self._location_of_constraint |
101 |
|
|
102 |
class VectorConstrainer(Model): |
class VectorConstrainer(ParameterSet): |
103 |
"""@brief creates a characteristic function for the location of constraints for a scalar value |
"""@brief creates a characteristic function for the location of constraints for a scalar value |
104 |
|
|
105 |
@param domain (in) - rectangular domain |
@param domain (in) - rectangular domain |
121 |
|
|
122 |
""" |
""" |
123 |
def __init__(self,debug=False): |
def __init__(self,debug=False): |
124 |
Model.__init__(self,debug=debug) |
ParameterSet.__init__(self,debug=debug) |
125 |
self.declareParameter(domain=None, \ |
self.declareParameter(domain=None, \ |
126 |
left=[0,0,0], \ |
left=[0,0,0], \ |
127 |
right=[0,0,0], \ |
right=[0,0,0], \ |