# A Computational Sketch-Based Approach Towards Optimal Product Design Solutions
## 2 Materials and Methods
### Finite Element Analysis  
In the present work, the FreeFEM++ [18] firmware was employed to construct a suitable FE simulation environment that can retrieve data from the previous phases of the methodology in order to automatically simulate and optimize the design of the captured sketch. FreeFEM++ could be effectively utilized for software development in computational simulations by integrating its capabilities into the workflow through various approaches. In general, the library provides a high-level scripting language for defining partial differential equations (PDEs), generating meshes, and solving complex numerical problems. In addition, FreeFEM can be integrated into a software pipeline via the utilization of its API (App. Programming Interface) to define and solve PDEs programmatically.  
This approach allows for tighter integration and greater control over the simulation process. Moreover, it should be noted that the firmware supports advanced features such as mesh adaptation and post-processing tools for exporting results. By leveraging FreeFEM++ for the mechanical simulations of the designed components, a software module was developed that efficiently handles complex numerical problems while benefiting from the library's robust tools for mesh generation, solving, and post-processing. Regarding the explanation of the theoretical background, an isotropy linear elastic material was considered that can be represented by the Poison ratio and the Elastic modulus, which constitute the Lame constants. Hence, the constitutive equation of the employed isotropy linear elastic material can be stated as [18; 19]:  
\[\sigma=\lambda(\
abla\mathbf{u})\mathbf{I}+2\mu\varepsilon(\mathbf{u}) \tag{1}\]  
and  
\[\sigma=\mathbf{C}\varepsilon(\mathbf{u}) \tag{2}\]  
where \(\sigma\) is the stress tensor, \(\mathbf{C}\) is the 4 th-order elasticity tensor, \(\varepsilon\) is the infinitesimal strain tensor, and \(\mathbf{u}\) is the displacement vector. The Lame constants \(\mu\) and \(\lambda\) are the following:  
\[\lambda=\mathrm{Ev}/(1+\
u)(1-2\
u) \tag{3}\]  
\[\mu=\mathrm{E}/2(1+\
u) \tag{4}\]  
such as the parameter \(\
u\) represent the Poisson's ratio and \(\mathrm{E}\) is the Elastic modulus. Moreover, taking into account the sketch in Figure 4, the boundary conditions and the governing equation can be determined by the following PDEs:  
\[-\
abla\sigma=\mathbf{F}\text{ in }\Omega \tag{5}\]  
\[\sigma\mathbf{n}=\mathbf{t}\text{ on }\Omega_{\mathrm{t}} \tag{6}\]  
\[\mathbf{u}=0\text{ on }\Omega_{\mathrm{u}} \tag{7}\]  
where \(\Omega\subset\mathrm{R}^{\mathrm{n}}\) (n = 2, 3) composes the bounded domain. In particular, the boundaries \(\partial\Omega\) of the whole domain \(\Omega\) can be represented by two main domains, the Dirichlet \(\partial\Omega_{u}\) and the Neumann boundary conditions \(\partial\Omega_{t}\). Furthermore, \(\mathbf{t}\) composes the stress vector, \(\mathbf{n}\) is the normal unit vector and \(\mathbf{F}\) is the body force per unit mass. It is worth mentioning that the library relies on the weak form of the Galerkin method to solve elasticity problems, as documented in Equation (8). Hereupon, the weak formulation of the elasticity problem was modified into a FreeFEM++ idiom in order to be processed by the firmware [19; 20]. Withthe aid of the built-in tools of the FreeFEM++, the discretization, assembly of the linear system, as well as the solution of the resulting equations were handled.  
\[\int_{\Omega}\sigma(\mathbf{u}):\varepsilon(\mathbf{v})\;\mathrm{d}\mathbf{x}= \int_{\Omega}\mathbf{F}\;\mathbf{v}\;\mathrm{d}\Omega+\int_{\partial\Omega_{ \mathrm{t}}}\mathbf{t}\;\mathbf{v}\;\mathrm{d}\Omega_{\mathrm{t}} \tag{8}\]