{ "cells": [ { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Finite element model from surfaces with constant mesh size\n", "==========================================================\n", "\n", "As previously, we will generate the finite element model from a group of surfaces. But here we specify the characteristic length of the mesh for the whole mesh.\n", "\n", "The process is the exact same." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from shamo import FEM\n", "\n", "model = FEM(\"fem_from_surfaces_lc-constant\", \"../../derivatives\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "data_path = Path(\"../../rawdata/surfaces\")\n", "tissues = {\n", " f\"tissue_{i}\": data_path / f\"surfaces_tissue{i}.stl\" for i in range(1, 8)\n", "}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "structure = [\n", " \"tissue_1\", [\n", " [\"tissue_2\",\n", " [\"tissue_3\"]\n", " ],\n", " [\"tissue_4\", [\n", " [\"tissue_5\"],\n", " [\"tissue_6\",\n", " [\"tissue_7\"]\n", " ]\n", " ]]\n", " ]\n", "]" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "The only difference is how we use the :py:func:`~shamo.FEM.mesh_from_surfaces` method. Here, we provide a value for the `lc` parameter." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model.mesh_from_surfaces(tissues, structure, 0.005)" ] } ], "metadata": { "kernelspec": { "display_name": "shamo", "language": "python", "name": "shamo" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }