Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ef3d0831 authored by Martin Genet's avatar Martin Genet
Browse files

New print_tools.py file

parent 0f0c9f88
No related branches found
No related tags found
No related merge requests found
......@@ -14,22 +14,13 @@ import numpy
import os
import myFEniCSPythonLibrary as myFEniCS
import myVTKPythonLibrary as myVTK
from print_tools import *
########################################################################
dolfin.parameters['form_compiler']['cpp_optimize_flags'] = '-O3'
dolfin.parameters["form_compiler"]["cpp_optimize"] = True
dolfin.parameters["form_compiler"]["optimize"] = True
def print_str(tab, string):
print " | "*tab + string
def print_var(tab, name, val):
print " | "*tab + name + " = " + str(val)
def print_sci(tab, name, val):
print " | "*tab + name.ljust(13) + " = " + format(val,".4e")
dolfin.parameters["form_compiler"]["optimize"] = False # can't use that for "complex" mechanical models…
########################################################################
......
File moved
#coding=utf8
########################################################################
### ###
### Created by Martin Genet, 2016 ###
### ###
### École Polytechnique, Palaiseau, France ###
### ###
########################################################################
import myVTKPythonLibrary as myVTK
########################################################################
#class Printer:
#def __init__(self):
#self.cur_level = 0
#def inc(self):
#self.cur_level += 1
#def dec(self):
#self.cur_level -= 1
#def print_str(self, string, var_level=0):
#print " | "*(self.cur_level+var_level) + string
#def print_var(self, name, val, var_level=0):
#print " | "*(self.cur_level+var_level) + name + " = " + str(val)
#def print_sci(self, name, val, var_level=0):
#print " | "*(self.cur_level+var_level) + name.ljust(13) + " = " + format(val,".4e")
########################################################################
def print_str(tab, string):
print " | "*tab + string
def print_var(tab, name, val):
print " | "*tab + name + " = " + str(val)
def print_sci(tab, name, val):
print " | "*tab + name.ljust(13) + " = " + format(val,".4e")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment