'''This page provides tips to:'''
 1. run scripts based on the OS.
 1. troubleshoot issues in model development and model convergence.
 1. troubleshoot issues due to software packages.


-----

=== Running python scripts for mesh generation and template model generation ===


'''Usage instructions:'''


''Linux''
    • Need Salome 7.8 to run StlToMed.py and MedToFebio.py (both written in Python 2.7)
''Windows''
    • Need Salome 8.3 (to run MedToFebio.py, older versions do not work)
    • However, if Salome 8.3 is used to correct ties and contacts in MED files then the exported version is MED 3.3.1 which will not be compatible with Salome 7.8 (required for Linux). 
    • In that case either use Salome 7.8 or Salome 9.2 (or above) to correct MED files and save in MED version 3.2. 
    • To run StlToMed.py and MedToFebio.py from Salome 8.3,
	1. Open command prompt
	1. navigate to Salome directory,
	1. type: >run_salome.bat -t --pinter path\StlToMed.py OR path\MedToFebio.py args:path\	Connectivity.xml

''Both''
    • In connectivity.xml file all .stl locations have to be pointed to the directory they are located in. 

'''Script specific'''

'''MedToFebio.py'''
    • MED files have to be in version 3.2. 
    • Does not work well on Windows 

Note: Febio 2.7 works if pre-strain is not used, otherwise use Febio 2.8(or above). 
      Preferably, use Febio version 2.9 as it handles contacts better 

'''OS preference:'''
    • Segmentation/geometry generation (Slicer, Meshlab): Windows/Linux
    • StltoMed.py (Salome): Linux
    • Fix contacts and ties(Salome): Linux, Windows (have to export MED files in v3.2)
    • MedtoFebio.py (Salome): Linux, Windows 
    • Pick Landmarks (Meshlab): Windows/ Linux
    • Customization: Windows/Linux 
    • Febio: Windows/Linux (edit geometry file location in Febio_custom.feb)

----
=== Installing python packages in Salome ===

''Windows''
 1. If certain python libraries are not installed in Salome’s Python installation– go to the folder where python is installed in the Salome directory – open power shell – type –  .\python -m pip install <library>
 1. Linking external packages does not usually work well in windows.


''Linux''

https://simtk.org/plugins/moinmoin/multis/Infrastructure/AuxiliarySoftware/Python_with_SALOME

----


=== Building model with updated model component ===


 1. Update component (update MED files)
 1. Transfer MED groups (using python script)
 1. convert MED files to version 3.2 (Salome 9.2 and above)
 1. Update connectivity.xml (if needed)
 1. MED2FEbio.py
 1. Customize 
 1. run in febio 2.9

----

=== Model convergence troubleshooting ===



 1. reduce mesh size 
 1. adjust mcl-msn_m ties spring stiffness
 1. adjust prestrain values 
 1. mci-mns_m contact may need to be added in some cases
 1. check surface and volume mesh quality before template model generation
 1. individually turn off contacts 

for further details go to,
https://simtk.org/plugins/moinmoin/openknee/Specifications/ModelTroubleshooting