#module imports {{{
import fielddisplay 
import ismumps
from  mumpsoptions import *
from  iluasmoptions import *
#}}}
class solver:
	#properties
	def __init__(self):
		# {{{ Properties
		if ismumps:
			self.options=[["NoneAnalysis",mumpsoptions()]]
		else:
			self.options=[["NoneAnalysis",iluasmoptions()]]
		#}}}
	def __repr__(obj):
		# {{{ Display
		
		string2="   solver parameters:"
		for i in range(len(obj.options)):
			option=obj.options[i]
			analysis=option[0]
			ioptions=option[1]

			string=""
			for i in range(len(ioptions)):
				option=ioptions[i]
				if not option:
					#do nothing
					pass
				elif len(option)==1:
					#this option has only one argument
					string="%s%s%s"%(string," -",option[0])
				elif len(option)==2:
					#option with value. value can be string or scalar
					if isinstance(option[1],float):
						string="%s%s%s%s%s"%(string," -",option[0]," ","%g"%(option[1]))
					elif isinstance(option[1],str):
						string="%s%s%s%s%s"%(string," -",option[0]," ",option[1])
					elif isinstance(option[1],int):
						string="%s%s%s%s%s"%(string," -",option[0]," ","%i"%(option[1]))
					else:
						raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))
				else:
					raise RuntimeError("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))

			string2="%s\n%s"%(string2,"   %s -> '%s'"%(analysis,string))
		return string2
	#}}}
