|
| 1 | +""" |
| 2 | +meshed_edges_extractors |
| 3 | +======================= |
| 4 | +Autogenerated DPF operator classes. |
| 5 | +""" |
| 6 | + |
| 7 | +from warnings import warn |
| 8 | +from ansys.dpf.core.dpf_operator import Operator |
| 9 | +from ansys.dpf.core.inputs import Input, _Inputs |
| 10 | +from ansys.dpf.core.outputs import Output, _Outputs |
| 11 | +from ansys.dpf.core.operators.specification import PinSpecification, Specification |
| 12 | + |
| 13 | + |
| 14 | +class meshed_edges_extractors(Operator): |
| 15 | + """Build meshed edges from a scoping of points. |
| 16 | +
|
| 17 | + Parameters |
| 18 | + ---------- |
| 19 | + mesh : MeshedRegion |
| 20 | + mesh_scoping : Scoping |
| 21 | + Nodal scoping of nodes that define the |
| 22 | + extracted edge. |
| 23 | +
|
| 24 | +
|
| 25 | + Examples |
| 26 | + -------- |
| 27 | + >>> from ansys.dpf import core as dpf |
| 28 | +
|
| 29 | + >>> # Instantiate operator |
| 30 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 31 | +
|
| 32 | + >>> # Make input connections |
| 33 | + >>> my_mesh = dpf.MeshedRegion() |
| 34 | + >>> op.inputs.mesh.connect(my_mesh) |
| 35 | + >>> my_mesh_scoping = dpf.Scoping() |
| 36 | + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) |
| 37 | +
|
| 38 | + >>> # Instantiate operator and connect inputs in one line |
| 39 | + >>> op = dpf.operators.mesh.meshed_edges_extractors( |
| 40 | + ... mesh=my_mesh, |
| 41 | + ... mesh_scoping=my_mesh_scoping, |
| 42 | + ... ) |
| 43 | +
|
| 44 | + >>> # Get output data |
| 45 | + >>> result_mesh = op.outputs.mesh() |
| 46 | + """ |
| 47 | + |
| 48 | + def __init__(self, mesh=None, mesh_scoping=None, config=None, server=None): |
| 49 | + super().__init__(name="meshed_edges_extractor", config=config, server=server) |
| 50 | + self._inputs = InputsMeshedEdgesExtractors(self) |
| 51 | + self._outputs = OutputsMeshedEdgesExtractors(self) |
| 52 | + if mesh is not None: |
| 53 | + self.inputs.mesh.connect(mesh) |
| 54 | + if mesh_scoping is not None: |
| 55 | + self.inputs.mesh_scoping.connect(mesh_scoping) |
| 56 | + |
| 57 | + @staticmethod |
| 58 | + def _spec(): |
| 59 | + description = """Build meshed edges from a scoping of points.""" |
| 60 | + spec = Specification( |
| 61 | + description=description, |
| 62 | + map_input_pin_spec={ |
| 63 | + 0: PinSpecification( |
| 64 | + name="mesh", |
| 65 | + type_names=["abstract_meshed_region"], |
| 66 | + optional=False, |
| 67 | + document="""""", |
| 68 | + ), |
| 69 | + 1: PinSpecification( |
| 70 | + name="mesh_scoping", |
| 71 | + type_names=["scoping"], |
| 72 | + optional=False, |
| 73 | + document="""Nodal scoping of nodes that define the |
| 74 | + extracted edge.""", |
| 75 | + ), |
| 76 | + }, |
| 77 | + map_output_pin_spec={ |
| 78 | + 0: PinSpecification( |
| 79 | + name="mesh", |
| 80 | + type_names=["abstract_meshed_region"], |
| 81 | + optional=False, |
| 82 | + document="""""", |
| 83 | + ), |
| 84 | + }, |
| 85 | + ) |
| 86 | + return spec |
| 87 | + |
| 88 | + @staticmethod |
| 89 | + def default_config(server=None): |
| 90 | + """Returns the default config of the operator. |
| 91 | +
|
| 92 | + This config can then be changed to the user needs and be used to |
| 93 | + instantiate the operator. The Configuration allows to customize |
| 94 | + how the operation will be processed by the operator. |
| 95 | +
|
| 96 | + Parameters |
| 97 | + ---------- |
| 98 | + server : server.DPFServer, optional |
| 99 | + Server with channel connected to the remote or local instance. When |
| 100 | + ``None``, attempts to use the global server. |
| 101 | + """ |
| 102 | + return Operator.default_config(name="meshed_edges_extractor", server=server) |
| 103 | + |
| 104 | + @property |
| 105 | + def inputs(self): |
| 106 | + """Enables to connect inputs to the operator |
| 107 | +
|
| 108 | + Returns |
| 109 | + -------- |
| 110 | + inputs : InputsMeshedEdgesExtractors |
| 111 | + """ |
| 112 | + return super().inputs |
| 113 | + |
| 114 | + @property |
| 115 | + def outputs(self): |
| 116 | + """Enables to get outputs of the operator by evaluating it |
| 117 | +
|
| 118 | + Returns |
| 119 | + -------- |
| 120 | + outputs : OutputsMeshedEdgesExtractors |
| 121 | + """ |
| 122 | + return super().outputs |
| 123 | + |
| 124 | + |
| 125 | +class InputsMeshedEdgesExtractors(_Inputs): |
| 126 | + """Intermediate class used to connect user inputs to |
| 127 | + meshed_edges_extractors operator. |
| 128 | +
|
| 129 | + Examples |
| 130 | + -------- |
| 131 | + >>> from ansys.dpf import core as dpf |
| 132 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 133 | + >>> my_mesh = dpf.MeshedRegion() |
| 134 | + >>> op.inputs.mesh.connect(my_mesh) |
| 135 | + >>> my_mesh_scoping = dpf.Scoping() |
| 136 | + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) |
| 137 | + """ |
| 138 | + |
| 139 | + def __init__(self, op: Operator): |
| 140 | + super().__init__(meshed_edges_extractors._spec().inputs, op) |
| 141 | + self._mesh = Input(meshed_edges_extractors._spec().input_pin(0), 0, op, -1) |
| 142 | + self._inputs.append(self._mesh) |
| 143 | + self._mesh_scoping = Input( |
| 144 | + meshed_edges_extractors._spec().input_pin(1), 1, op, -1 |
| 145 | + ) |
| 146 | + self._inputs.append(self._mesh_scoping) |
| 147 | + |
| 148 | + @property |
| 149 | + def mesh(self): |
| 150 | + """Allows to connect mesh input to the operator. |
| 151 | +
|
| 152 | + Parameters |
| 153 | + ---------- |
| 154 | + my_mesh : MeshedRegion |
| 155 | +
|
| 156 | + Examples |
| 157 | + -------- |
| 158 | + >>> from ansys.dpf import core as dpf |
| 159 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 160 | + >>> op.inputs.mesh.connect(my_mesh) |
| 161 | + >>> # or |
| 162 | + >>> op.inputs.mesh(my_mesh) |
| 163 | + """ |
| 164 | + return self._mesh |
| 165 | + |
| 166 | + @property |
| 167 | + def mesh_scoping(self): |
| 168 | + """Allows to connect mesh_scoping input to the operator. |
| 169 | +
|
| 170 | + Nodal scoping of nodes that define the |
| 171 | + extracted edge. |
| 172 | +
|
| 173 | + Parameters |
| 174 | + ---------- |
| 175 | + my_mesh_scoping : Scoping |
| 176 | +
|
| 177 | + Examples |
| 178 | + -------- |
| 179 | + >>> from ansys.dpf import core as dpf |
| 180 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 181 | + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) |
| 182 | + >>> # or |
| 183 | + >>> op.inputs.mesh_scoping(my_mesh_scoping) |
| 184 | + """ |
| 185 | + return self._mesh_scoping |
| 186 | + |
| 187 | + |
| 188 | +class OutputsMeshedEdgesExtractors(_Outputs): |
| 189 | + """Intermediate class used to get outputs from |
| 190 | + meshed_edges_extractors operator. |
| 191 | +
|
| 192 | + Examples |
| 193 | + -------- |
| 194 | + >>> from ansys.dpf import core as dpf |
| 195 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 196 | + >>> # Connect inputs : op.inputs. ... |
| 197 | + >>> result_mesh = op.outputs.mesh() |
| 198 | + """ |
| 199 | + |
| 200 | + def __init__(self, op: Operator): |
| 201 | + super().__init__(meshed_edges_extractors._spec().outputs, op) |
| 202 | + self._mesh = Output(meshed_edges_extractors._spec().output_pin(0), 0, op) |
| 203 | + self._outputs.append(self._mesh) |
| 204 | + |
| 205 | + @property |
| 206 | + def mesh(self): |
| 207 | + """Allows to get mesh output of the operator |
| 208 | +
|
| 209 | + Returns |
| 210 | + ---------- |
| 211 | + my_mesh : MeshedRegion |
| 212 | +
|
| 213 | + Examples |
| 214 | + -------- |
| 215 | + >>> from ansys.dpf import core as dpf |
| 216 | + >>> op = dpf.operators.mesh.meshed_edges_extractors() |
| 217 | + >>> # Connect inputs : op.inputs. ... |
| 218 | + >>> result_mesh = op.outputs.mesh() |
| 219 | + """ # noqa: E501 |
| 220 | + return self._mesh |
0 commit comments