Update of LabelTensor class and fix Simplex domain (#362)
*Implement new methods in LabelTensor and fix operators
This commit is contained in:
committed by
Nicola Demo
parent
fdb8f65143
commit
7528f6ef74
@@ -27,4 +27,6 @@ class DataConditionInterface(ConditionInterface):
|
||||
def __setattr__(self, key, value):
|
||||
if (key == 'data') or (key == 'conditionalvariable'):
|
||||
check_consistency(value, (LabelTensor, Graph, torch.Tensor))
|
||||
DataConditionInterface.__dict__[key].__set__(self, value)
|
||||
DataConditionInterface.__dict__[key].__set__(self, value)
|
||||
elif key in ('_condition_type', '_problem', 'problem', 'condition_type'):
|
||||
super().__setattr__(key, value)
|
||||
@@ -28,4 +28,6 @@ class DomainEquationCondition(ConditionInterface):
|
||||
DomainEquationCondition.__dict__[key].__set__(self, value)
|
||||
elif key == 'equation':
|
||||
check_consistency(value, (EquationInterface))
|
||||
DomainEquationCondition.__dict__[key].__set__(self, value)
|
||||
DomainEquationCondition.__dict__[key].__set__(self, value)
|
||||
elif key in ('_condition_type', '_problem', 'problem', 'condition_type'):
|
||||
super().__setattr__(key, value)
|
||||
@@ -21,7 +21,7 @@ class InputPointsEquationCondition(ConditionInterface):
|
||||
super().__init__()
|
||||
self.input_points = input_points
|
||||
self.equation = equation
|
||||
self.condition_type = 'physics'
|
||||
self._condition_type = 'physics'
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
if key == 'input_points':
|
||||
@@ -29,4 +29,6 @@ class InputPointsEquationCondition(ConditionInterface):
|
||||
InputPointsEquationCondition.__dict__[key].__set__(self, value)
|
||||
elif key == 'equation':
|
||||
check_consistency(value, (EquationInterface))
|
||||
InputPointsEquationCondition.__dict__[key].__set__(self, value)
|
||||
InputPointsEquationCondition.__dict__[key].__set__(self, value)
|
||||
elif key in ('_condition_type', '_problem', 'problem', 'condition_type'):
|
||||
super().__setattr__(key, value)
|
||||
@@ -26,4 +26,6 @@ class InputOutputPointsCondition(ConditionInterface):
|
||||
def __setattr__(self, key, value):
|
||||
if (key == 'input_points') or (key == 'output_points'):
|
||||
check_consistency(value, (LabelTensor, Graph, torch.Tensor))
|
||||
InputOutputPointsCondition.__dict__[key].__set__(self, value)
|
||||
InputOutputPointsCondition.__dict__[key].__set__(self, value)
|
||||
elif key in ('_condition_type', '_problem', 'problem', 'condition_type'):
|
||||
super().__setattr__(key, value)
|
||||
|
||||
Reference in New Issue
Block a user