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

Method collapse

python/dolfinx/fem/function.py:618–626  ·  view source on GitHub ↗

Create a collapsed version of this Function.

(self)

Source from the content-addressed store, hash-verified

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."""
620 u_collapsed = self._cpp_object.collapse() # type: ignore
621 V_collapsed = FunctionSpace(
622 self.function_space._mesh,
623 self.ufl_element(), # type: ignore
624 u_collapsed.function_space,
625 )
626 return Function(V_collapsed, la.Vector(u_collapsed.x))
627
628
629class ElementMetaData(typing.NamedTuple):

Callers 15

test_empty_rank_collapseFunction · 0.45
test_biharmonicFunction · 0.45
monolithic_solveMethod · 0.45
test_collapseFunction · 0.45
test_vector_constant_bcFunction · 0.45
test_sub_constant_bcFunction · 0.45
test_mixed_constant_bcFunction · 0.45
test_mixed_systemMethod · 0.45
collapseMethod · 0.45

Calls 3

FunctionSpaceClass · 0.70
FunctionClass · 0.70
VectorMethod · 0.45

Tested by 11

test_empty_rank_collapseFunction · 0.36
test_biharmonicFunction · 0.36
monolithic_solveMethod · 0.36
test_collapseFunction · 0.36
test_vector_constant_bcFunction · 0.36
test_sub_constant_bcFunction · 0.36
test_mixed_constant_bcFunction · 0.36
test_mixed_systemMethod · 0.36