# A Workflow for Creating Gastric Computational Models from SPARC Scaffolds
## 2 Materials and Methods
### Computational Models
#### 2.1.1 Finite Element Models  
The longitudinal muscle (LM) and circular muscle (CM) layers of the scaffold were extracted from the scaffold and used in this study. The computational model with no  
Figure 1: Workflow to derive computational models using the SPARC scaffold of the rat stomach, obtained from the SPARC portal ([[https://sparc.science/](https://sparc.science/)]([https://sparc.science/](https://sparc.science/))). A number of software packages were used to create: (i) a 2D surface mesh of the serosal surface of the stomach, (ii) a 3D volume mesh of the longitudinal and circular muscle layers with fixed thickness, and (iii) a 3D volume mesh with varying thickness of longitudinal and circular muscle layers. transumal thickness (i.e., surface only) was termed as a 2D FEM model while the models with a transumal thickness were termed as a 3D FEM model. 2D Surface Model: A 2D FEM model, i.e., triangular surface mesh, was created from the serosal surface of the scaffold and exported as an STL (stereolithography) file using CMGUI ([[https://www.cmiss.org/cmgui](https://www.cmiss.org/cmgui)]([https://www.cmiss.org/cmgui](https://www.cmiss.org/cmgui))). The surface mesh was resampled in Meshmixer (Version 3.5, Autodesk Inc., San Francisco, CA, USA) using a _Target Edge Length_ of 0.25 mm. The refined mesh was converted to the input file formats required by the Chaste simulation package [29] (see Sections 2.1.2 and 2.2) using MATLAB (Version R2022b, MathWorks, Natick, MA, USA). 3D Fixed Thickness Volume Model: A 2D surface mesh of the LM and CM layers was first exported from the scaffold as an STL file using CMGUI. Then, a 3D FEM model, i.e., tetrahedral volume mesh, with LM and CM layers was generated using TetGen ([[https://wias-berlin.de/software/tetgen/](https://wias-berlin.de/software/tetgen/)]([https://wias-berlin.de/software/tetgen/](https://wias-berlin.de/software/tetgen/))) with a _maximum tetraledron volume constraint_ of 0.05 and exported as the Chaste input files. 3D Varying Thickness Volume Model: The thickness of muscle layers, previously measured at 15 different points on the rat stomach by [PERSON] et al. [14], was used to derive the most realistic 3D FEM model. First, the interface layer between the LM and CM layers in the scaffold was exported as a 2D surface mesh (i.e., as an STL file) and used as the reference surface to derive varying thickness of muscle layers within the rat stomach. Assuming symmetry between the dorsal and ventral surfaces, a total of 30 data points were defined over the surface of 2D mesh using ParaView (Version 5.10.0, Kitware Inc., Clifton Park, NY, USA), that matched the locations of experimental thickness data. Then, a thickness field was fitted to these 30 data points for each muscle layer using the _Point Dataset Interpolator_ filter with a _Gaussian Kernel_ (Radius = 13 mm, Sharpness = 2.5) in ParaView and the thickness values at the nodal points of the surface mesh were computed. While the radius parameter defines the boundary of data points included in the interpolation at each nodal point, the sharpness parameter specifies the impact of data points with distance. As the sharpness increases the effect of distant points is reduced. The values of 13 mm and 2.5 were determined by satisfying the closest interpolated thickness range to the experimental range. The fitting performance was quantified by computing the root-mean-squared error (RMSE) of fitted values by comparing each experimental thickness data with the interpolated value at the nearest nodal point as follows:  
\[RMSE=\sqrt{\sum_{j=1}^{n}\left(t_{j}-\overline{t}_{j}\right)^{2}_{/n}} \tag{1}\]  
where \(t_{j}\) is the \(j\)-th experimental thickness data while \(\overline{t}_{j}\) is the corresponding fitted value at the nearest node, and \(n=30\) is the total number of thickness values used in fitting. Finally, the fitted thickness values at all nodes in the 2D surface mesh were exported.