parameters_processing.py
def load_olver_parameters(solver_params_file):
  """
  Load coupled solver parameters from file.

  :param str solver_params_file:  Path to the file with the parameters.
  :return: String that can be processed by Dolfin's parameters system.
  :rtype: str
  """

  cpl_solver_args = ""

  if solver_params_file:
    try:
      with open (solver_params_file, "r") as coupled_solver_params_file:
        modules = deque()

        for l in coupled_solver_params_file:
          s = l.strip().split('#')[0]
          if s:
            # Find submodule level
            for i,c in enumerate(s):
              if c == "[":
                if s[-1-i] != "]":
                  raise InvalidFileFormat
              else:
                break

            if i > 0:
              # Get module name
              module = s[i:-i].strip().lower()

              # Add it to the appropriate level in the submodules structure
              nlvl = len(modules)
              if i == nlvl + 1:
                modules.append(module)
              elif i == nlvl:
                modules[-1] = module
              elif i < nlvl:
                for j in xrange(nlvl-i):
                  modules.pop()
                modules[-1] = module
              else:
                raise InvalidFileFormat

            else:
              # Actual parameter
              cpl_solver_args += " --{}.{}".format(".".join(modules), __stripper.sub("=", s))

    except Exception as e:
      raise RuntimeError("Solver parameters could not be read from "+solver_params_file + ".\n" + str(e))

  return cpl_solver_args

  Load coupled solver parameters from file.

  :param str solver_params_file:  Path to the file with the parameters.
  :return: String that can be processed by Dolfin's parameters system.
  :rtype: str
  
Load coupled solver parameters from file.
Load coupled solver parameters from file .
def load_olver_parameters(solver_params_file):
  cpl_solver_args = ""
  if solver_params_file:
    try:
      with open (solver_params_file, "r") as coupled_solver_params_file:
        modules = deque()
        for l in coupled_solver_params_file:
          s = l.strip().split('#')[0]
          if s:
            for i,c in enumerate(s):
              if c == "[":
                if s[-1-i] != "]":
                  raise InvalidFileFormat
              else:
                break
            if i > 0:
              module = s[i:-i].strip().lower()
              nlvl = len(modules)
              if i == nlvl + 1:
                modules.append(module)
              elif i == nlvl:
                modules[-1] = module
              elif i < nlvl:
                for j in xrange(nlvl-i):
                  modules.pop()
                modules[-1] = module
              else:
                raise InvalidFileFormat
            else:
              cpl_solver_args += " --{}.{}".format(".".join(modules), __stripper.sub("=", s))
    except Exception as e:
      raise RuntimeError("Solver parameters could not be read from "+solver_params_file + ".\n" + str(e))
  return cpl_solver_args
def load_olver_parameters ( solver_params_file ) : cpl_solver_args = "" if solver_params_file : try : with open ( solver_params_file , "r" ) as coupled_solver_params_file : modules = deque ( ) for l in coupled_solver_params_file : s = l . strip ( ) . split ( '#' ) [ 0 ] if s : for i , c in enumerate ( s ) : if c == "[" : if s [ - 1 - i ] != "]" : raise InvalidFileFormat else : break if i > 0 : module = s [ i : - i ] . strip ( ) . lower ( ) nlvl = len ( modules ) if i == nlvl + 1 : modules . append ( module ) elif i == nlvl : modules [ - 1 ] = module elif i < nlvl : for j in xrange ( nlvl - i ) : modules . pop ( ) modules [ - 1 ] = module else : raise InvalidFileFormat else : cpl_solver_args += " --{}.{}" . format ( "." . join ( modules ) , __stripper . sub ( "=" , s ) ) except Exception as e : raise RuntimeError ( "Solver parameters could not be read from " + solver_params_file + ".\n" + str ( e ) ) return cpl_solver_args
Load coupled solver parameters from file.
Load coupled solver parameters from file .
"""
  Load coupled solver parameters from file.

  :param str solver_params_file:  Path to the file with the parameters.
  :return: String that can be processed by Dolfin's parameters system.
  :rtype: str
  """ # Find submodule level # Get module name # Add it to the appropriate level in the submodules structure # Actual parameter
String that can be processed by Dolfin's parameters system.
String that can be processed by Dolfin ' s parameters system .
str
solver_params_file
Path to the file with the parameters.
Path to the file with the parameters .