Create a copy of the Function. The function space is shared and the degree-of-freedom vector is copied. Returns: A new Function with a copy of the degree-of-freedom vector.
(self)
| 544 | self._cpp_object.interpolate_f(np.asarray(u0(x), dtype=self.dtype), cells0) |
| 545 | |
| 546 | def copy(self) -> Function[Scalar]: |
| 547 | """Create a copy of the Function. |
| 548 | |
| 549 | The function space is shared and the degree-of-freedom vector is |
| 550 | copied. |
| 551 | |
| 552 | Returns: |
| 553 | A new Function with a copy of the degree-of-freedom vector. |
| 554 | """ |
| 555 | return Function( |
| 556 | self.function_space, |
| 557 | la.Vector(type(self.x._cpp_object)(self.x._cpp_object)), |
| 558 | name=self.name, |
| 559 | ) |
| 560 | |
| 561 | @property |
| 562 | def x(self) -> la.Vector[Scalar]: |