phiFEM 0.7.2.dev2__py3-none-any.whl → 0.8.0.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phifem/mesh_scripts.py +69 -17
- {phifem-0.7.2.dev2.dist-info → phifem-0.8.0.dev1.dist-info}/METADATA +1 -1
- phifem-0.8.0.dev1.dist-info/RECORD +7 -0
- phifem-0.7.2.dev2.dist-info/RECORD +0 -7
- {phifem-0.7.2.dev2.dist-info → phifem-0.8.0.dev1.dist-info}/WHEEL +0 -0
- {phifem-0.7.2.dev2.dist-info → phifem-0.8.0.dev1.dist-info}/licenses/COPYING +0 -0
- {phifem-0.7.2.dev2.dist-info → phifem-0.8.0.dev1.dist-info}/licenses/COPYING.lesser +0 -0
phifem/mesh_scripts.py
CHANGED
|
@@ -662,6 +662,60 @@ def _overwrite_tags(mesh, tags_to_overwrite, new_tags):
|
|
|
662
662
|
return overwritten_tags
|
|
663
663
|
|
|
664
664
|
|
|
665
|
+
def _compute_codim_interpolation_points(
|
|
666
|
+
space: dfx.fem.FunctionSpace,
|
|
667
|
+
) -> np.ndarray[np.float64]:
|
|
668
|
+
"""Compute the same FunctionSpace but defined over a submesh of codim 1.
|
|
669
|
+
|
|
670
|
+
Args:
|
|
671
|
+
space: the original space.
|
|
672
|
+
|
|
673
|
+
Return: a new space defined on a mesh of codim 1.
|
|
674
|
+
"""
|
|
675
|
+
family_name = space.ufl_element().basix_element.family.name
|
|
676
|
+
degree = space.ufl_element().basix_element.degree
|
|
677
|
+
tdim = space.mesh.topology.dim
|
|
678
|
+
codim_mesh = dfx.mesh.create_submesh(space.mesh, tdim - 1, np.array([0.0]))[0]
|
|
679
|
+
codim_cell_name = codim_mesh.topology.cell_name()
|
|
680
|
+
new_elmt = element(family_name, codim_cell_name, degree)
|
|
681
|
+
new_space = dfx.fem.functionspace(codim_mesh, new_elmt)
|
|
682
|
+
return new_space.element.interpolation_points()
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
def _levelset_expression(
|
|
686
|
+
mesh: dfx.mesh.Mesh,
|
|
687
|
+
levelset: Function | Callable,
|
|
688
|
+
interpolation_points: np.NDarray[np.float64],
|
|
689
|
+
) -> Expression:
|
|
690
|
+
"""Sanitize the levelset input by turning it into an Expression.
|
|
691
|
+
|
|
692
|
+
Args:
|
|
693
|
+
levelset: the levelset function.
|
|
694
|
+
detection_space: the detection space.
|
|
695
|
+
|
|
696
|
+
Return: the levelset as an Expression object.
|
|
697
|
+
"""
|
|
698
|
+
|
|
699
|
+
# Sanitize levelset input
|
|
700
|
+
try:
|
|
701
|
+
# Test if levelset is a dolfinx.fem.Function
|
|
702
|
+
_ = levelset.function_space
|
|
703
|
+
levelset_expression = dfx.fem.Expression(
|
|
704
|
+
levelset, interpolation_points, comm=mesh.comm
|
|
705
|
+
)
|
|
706
|
+
except AttributeError:
|
|
707
|
+
try:
|
|
708
|
+
x = ufl.SpatialCoordinate(mesh)
|
|
709
|
+
levelset_expression = dfx.fem.Expression(
|
|
710
|
+
levelset(x), interpolation_points, comm=mesh.comm
|
|
711
|
+
)
|
|
712
|
+
except TypeError:
|
|
713
|
+
print(
|
|
714
|
+
"Invalid levelset type: must be either a dolfinx.fem.Function or a UFL based Callable."
|
|
715
|
+
)
|
|
716
|
+
return levelset_expression
|
|
717
|
+
|
|
718
|
+
|
|
665
719
|
def compute_tags_measures(
|
|
666
720
|
mesh: Mesh,
|
|
667
721
|
levelset: Function | Callable,
|
|
@@ -692,27 +746,25 @@ def compute_tags_measures(
|
|
|
692
746
|
The boundaries measure.
|
|
693
747
|
Submesh c-map, v-map and n-map.
|
|
694
748
|
"""
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
try:
|
|
698
|
-
levelset_expression = dfx.fem.Expression(
|
|
699
|
-
levelset, detection_space.element.interpolation_points()
|
|
700
|
-
)
|
|
701
|
-
except AttributeError:
|
|
702
|
-
try:
|
|
703
|
-
x = mesh.SpatialCoordinate(mesh)
|
|
704
|
-
levelset_expression = dfx.fem.Expression(
|
|
705
|
-
levelset(x), detection_space.element.interpolation_points()
|
|
706
|
-
)
|
|
707
|
-
except TypeError:
|
|
708
|
-
print(
|
|
709
|
-
"Invalid levelset type: must be either a dolfinx.fem.Function or a UFL based Callable."
|
|
710
|
-
)
|
|
749
|
+
interpolation_points = detection_space.element.interpolation_points()
|
|
750
|
+
levelset_expression = _levelset_expression(mesh, levelset, interpolation_points)
|
|
711
751
|
|
|
712
752
|
cells_tags = _tag_cells(
|
|
713
753
|
mesh, levelset_expression, single_layer_cut=single_layer_cut
|
|
714
754
|
)
|
|
715
|
-
|
|
755
|
+
|
|
756
|
+
codim_interpolation_points = _compute_codim_interpolation_points(detection_space)
|
|
757
|
+
levelset_expression_facets = _levelset_expression(
|
|
758
|
+
mesh, levelset, codim_interpolation_points
|
|
759
|
+
)
|
|
760
|
+
|
|
761
|
+
facets_tags = _tag_facets(
|
|
762
|
+
mesh,
|
|
763
|
+
levelset_expression_facets,
|
|
764
|
+
cells_tags,
|
|
765
|
+
levelset_expression,
|
|
766
|
+
single_layer_cut=single_layer_cut,
|
|
767
|
+
)
|
|
716
768
|
|
|
717
769
|
if overwrite_tags is not None:
|
|
718
770
|
if "cells" in overwrite_tags:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: phiFEM
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0.dev1
|
|
4
4
|
Summary: phiFEM: convenience tools to use the phiFEM immersed boundary finite element method with dolfinx.
|
|
5
5
|
Project-URL: Homepage, https://github.com/PhiFEM/phiFEM
|
|
6
6
|
Project-URL: Issues, https://github.com/PhiFEM/phiFEM/issues
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
phifem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
phifem/mesh_scripts.py,sha256=g9G_QjgERcNNdo26tCGymidLYaCRzSvMYwVaCOmiDIs,32508
|
|
3
|
+
phifem-0.8.0.dev1.dist-info/METADATA,sha256=jFmzNbqBlHFois1398voBC6m7rJyKoUpT_a6s_seKGI,5606
|
|
4
|
+
phifem-0.8.0.dev1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
5
|
+
phifem-0.8.0.dev1.dist-info/licenses/COPYING,sha256=xTplwv1WHIfqq_EHLvXcq4ZTBCvBUwhGX1JBNYXrYnE,35146
|
|
6
|
+
phifem-0.8.0.dev1.dist-info/licenses/COPYING.lesser,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
|
7
|
+
phifem-0.8.0.dev1.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
phifem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
phifem/mesh_scripts.py,sha256=Im8vPg3NxA44qiynUmVkCvyu6C6tYcQLKhJpDY0FJbA,30820
|
|
3
|
-
phifem-0.7.2.dev2.dist-info/METADATA,sha256=pggXcQxyYtwUxScyjZtHvFlmkiakNl8kLtbr9qCdj4s,5606
|
|
4
|
-
phifem-0.7.2.dev2.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
5
|
-
phifem-0.7.2.dev2.dist-info/licenses/COPYING,sha256=xTplwv1WHIfqq_EHLvXcq4ZTBCvBUwhGX1JBNYXrYnE,35146
|
|
6
|
-
phifem-0.7.2.dev2.dist-info/licenses/COPYING.lesser,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
|
7
|
-
phifem-0.7.2.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|