def __pow__(self, value): if value != 2: raise ValueError('Only the value "2" is supported.') from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "sqr"): op = operators.math.sqr(self, server=self._server) else: op = dpf_operator.Operator("sqr", server=self._server) op.connect(0, self) return op
def __pow__(self, value): if value != 2: raise ValueError('DPF only the value is "2" supported') from ansys.dpf.core import dpf_operator from ansys.dpf.core import operators if hasattr(operators, "math") and hasattr(operators.math, "sqr_fc"): op = operators.math.sqr_fc(server=self._server) else: op = dpf_operator.Operator("sqr_fc", server=self._server) op.connect(0, self) op.connect(1, value) return op
def __sub__(self, fields_b): """Subtract two fields or two fields containers. Returns ------- minus : operators.math.minus_fc """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "minus_fc"): op = operators.math.minus_fc(server=self._server) else: op = dpf_operator.Operator("minus_fc", server=self._server) op.connect(0, self) op.connect(1, fields_b) return op
def __add__(self, fields_b): """Add two fields or two fields containers. Returns ------- add : operators.math.add_fc """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "add_fc"): op = operators.math.add_fc(self, fields_b, server=self._server) else: op = dpf_operator.Operator("add_fc", server=self._server) op.connect(0, self) op.connect(1, fields_b) return op
def __sub__(self, fields_b): """Subtract two fields. Returns ------- :class:`ansys.dpf.core.operators.math.minus.minus` """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "minus"): op = operators.math.minus(server=self._server) else: op = dpf_operator.Operator("minus", server=self._server) op.connect(0, self) op.connect(1, fields_b) return op
def __add__(self, field_b): """Add two fields. Returns ------- :class:`ansys.dpf.core.operators.math.add.add` """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "add"): op = operators.math.add(server=self._server) else: op = dpf_operator.Operator("add", server=self._server) op.connect(0, self) op.connect(1, field_b) return op
def __mul__(self, value): """Multiply two fields or two fields containers. Returns ------- mul : operators.math.generalized_inner_product_fc """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr( operators.math, "generalized_inner_product_fc"): op = operators.math.generalized_inner_product_fc( server=self._server) else: op = dpf_operator.Operator("generalized_inner_product_fc", server=self._server) op.connect(0, self) op.connect(1, value) return op
def __mul__(self, value): """Multiplies two fields. Returns ------- :class:`ansys.dpf.core.operators.math.generalized_inner_product.generalized_inner_product` """ from ansys.dpf.core import dpf_operator, operators if hasattr(operators, "math") and hasattr(operators.math, "generalized_inner_product"): op = operators.math.generalized_inner_product(server=self._server) else: op = dpf_operator.Operator("generalized_inner_product", server=self._server) op.connect(0, self) op.connect(1, value) return op
def _min_max(self): from ansys.dpf.core import dpf_operator op = dpf_operator.Operator("min_max", server=self._server) op.connect(0, self) return op