SEMAFORInformatik / femagtools

Python API for FEMAG
BSD 2-Clause "Simplified" License
19 stars 13 forks source link

Custom *.mako overriding default in templates folder #43

Closed kurhar closed 6 years ago

kurhar commented 6 years ago

Custom .mako files currently can't override the default .mako files in the femagtools/templates folder. For example an user can't customize the gen_winding.mako without changing it in the femagtools/templates folder.

Example for alternative gen_winding, not yet transformed into a mako (ARCHIVE LINK):

--  Windings and Conductor Specification

--m.tot_num_slot  =         24.000 --   Total Number of slots Q
--m.num_poles     =          4.000 --   Number of Poles 2p
m.num_phases      =          3.000 --   Number of Phases m  <=  200
m.num_layers      =          2.000 --   Number of Layers (slot sides)per slot
m.num_wires       =          6.000 --   Number of wires per slot side
m.current         =          0.000 --   Wdg-Current [A] or flux [Vs/mm];peak
m.coil_span       =          6.000 --   Coil span Y  >= 1
--m.num_slots     =          6.000 --   Number of slots in Model (Rot-Mot)
m.mat_type        =          1.000 --   Ma-type:1=Rot;21=lin-x;22=lin-y
m.wind_type       =          1.000 --   W-typ:1=w&cur;2=w&flux;3=bar&cur
m.win_asym        =          1.000 --   asy. slot pitch: 1=sym.; <1=asym.
m.wdg_location    =          1.000 --   Windg location:1: stator; 2: rotor
m.curr_inp        =          0.000 --   Curent:Const:0; Q-axis:1; D-axis:-1
m.dq_offset       =          0.000 --   Offset to D-axis:>=0 Compl;<0 only Re
m.npols_gen       =          1.000 --   Number of Poles simulated      (>= 1)
m.xcoil_1         =        111.538 --   center coordinate of 1. coil side [mm]
m.ycoil_1         =         14.684 --   center coordinate of 1. coil side [mm]
m.xcoil_2         =        115.699 --   center coordinate of 2. coil side [mm]
m.ycoil_2         =         47.944 --   center coordinate of 2. coil side [mm]

pre_models("Gen_winding");

The only required change for this is in the file femagtools/fsl.py where the directories should be changed in the line: https://github.com/SEMAFORInformatik/femagtools/blob/36cbb064f3acff3e5133d39869b7784f3d6da366/femagtools/fsl.py#L26