Initialize mesh from a C++ mesh. Args: msh: A C++ mesh object. domain: A UFL domain. Note: Mesh objects should usually be constructed using :func:`create_mesh` and not using this class initializer. This class is combined w
(
self,
msh: _cpp.mesh.Mesh_float32 | _cpp.mesh.Mesh_float64,
domain: ufl.Mesh | None,
)
| 357 | _ufl_domain: ufl.Mesh | None |
| 358 | |
| 359 | def __init__( |
| 360 | self, |
| 361 | msh: _cpp.mesh.Mesh_float32 | _cpp.mesh.Mesh_float64, |
| 362 | domain: ufl.Mesh | None, |
| 363 | ): |
| 364 | """Initialize mesh from a C++ mesh. |
| 365 | |
| 366 | Args: |
| 367 | msh: A C++ mesh object. |
| 368 | domain: A UFL domain. |
| 369 | |
| 370 | Note: |
| 371 | Mesh objects should usually be constructed using |
| 372 | :func:`create_mesh` and not using this class initializer. |
| 373 | This class is combined with different base classes that |
| 374 | depend on the scalar type used in the Mesh. |
| 375 | """ |
| 376 | self._cpp_object = msh |
| 377 | self._topology = Topology(self._cpp_object.topology) |
| 378 | self._geometry = Geometry(self._cpp_object.geometry) |
| 379 | self._ufl_domain = domain |
| 380 | if self._ufl_domain is not None: |
| 381 | self._ufl_domain._ufl_cargo = self._cpp_object # type: ignore |
| 382 | |
| 383 | @property |
| 384 | def comm(self): |