Complex physical phenomena can be numerically simulated by mathematical techniques. Usually, these techniques are based on discretization of partial differential equations that govern these phenomena. Hence, these simulations enable the solution of large-scale systems. The parallelization of algorithms of numerical simulation, i.e., their adaptation to parallel processing architectures, is an aim to reach in order to hinder exorbitant execution times. Graphics cards are now used for purposes of general calculation, also known as General-Purpose computation on Graphics Processing Unit (GPGPU). The clear benefit is the excellent performance/price ratio. This document addresses the design of high-performance applications for simulation of electrical machines. We provide a methodology based on Model Driven Engineering (MDE) to model an application and its execution architecture in order to generate OpenCL code. Our goal is to assist specialists in algorithms of numerical simulations to create a code that runs efficiently on GPGPU architectures. The methodology has been applied to an application that solves a linear system resulting from a simulation of an alternator using FEM.