MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / split

Method split

python/dolfinx/fem/function.py:603–616  ·  view source on GitHub ↗

Extract (any) sub-functions. A sub-function can be extracted from a discrete function that is in a mixed, vector, or tensor FunctionSpace. The sub-function resides in the subspace of the mixed space. Returns: First level of subspaces of the function spac

(self)

Source from the content-addressed store, hash-verified

601 return Function(self._V.sub(i), self.x, name=f"{self!s}_{i}")
602
603 def split(self) -> tuple[Function[Scalar], ...]:
604 """Extract (any) sub-functions.
605
606 A sub-function can be extracted from a discrete function that is
607 in a mixed, vector, or tensor FunctionSpace. The sub-function
608 resides in the subspace of the mixed space.
609
610 Returns:
611 First level of subspaces of the function space.
612 """
613 num_sub_spaces = self.function_space.num_sub_spaces
614 if num_sub_spaces == 1:
615 raise RuntimeError("No subfunctions to extract")
616 return tuple(self.sub(i) for i in range(num_sub_spaces))
617
618 def collapse(self) -> Function[Scalar]:
619 """Create a collapsed version of this Function."""

Callers 8

datadirFunction · 0.80
monolithicMethod · 0.80
monolithic_solveMethod · 0.80
test_mixed_systemMethod · 0.80
test_facet_expressionFunction · 0.80
generate_cmake_filesFunction · 0.80

Calls 1

subMethod · 0.95

Tested by 5

datadirFunction · 0.64
monolithicMethod · 0.64
monolithic_solveMethod · 0.64
test_mixed_systemMethod · 0.64
test_facet_expressionFunction · 0.64