Finite element model from surfaces with per tissue mesh sizeΒΆ

A last possibility is to specify a value of characteristic length for each tissue. The process is once again the same.

[ ]:
from shamo import FEM

model = FEM("fem_from_surfaces_lc-tissue", "../../derivatives")
[ ]:
from pathlib import Path

data_path = Path("../../rawdata/surfaces")
tissues = {
    f"tissue_{i}": data_path / f"surfaces_tissue{i}.stl" for i in range(1, 8)
}
[ ]:
structure = [
    "tissue_1", [
        ["tissue_2",
            ["tissue_3"]
        ],
        ["tissue_4", [
            ["tissue_5"],
            ["tissue_6",
                ["tissue_7"]
            ]
        ]]
    ]
]

We simply have to define a dictionary containing the values for the characteristic length. If all the tissues do not have a special value, the defaut key must be included.

[ ]:
lc = {
    "default": 0.5,
    "tissue_2": 0.01,
    "tissue_4": 0.01,
}

Finally we pass this dictionary to the mesh_from_surfaces() method.

[ ]:
model.mesh_from_surfaces(tissues, structure, lc)