Peano
Scenario.py
Go to the documentation of this file.
1 # This file is part of the ExaHyPE2 project. For conditions of distribution and
2 # use, please see the copyright notice at www.peano-framework.org
3 from exahype2.solvers.PDETerms import PDETerms
4 
5 import os, shutil, jinja2
6 
7 class Scenario:
8  domain_offset = [1., 1., 1.]
9  domain_size = [1., 1., 1.]
10 
11  end_time = 0.0
12 
13  tracer_coordinates = []
14 
15  def initial_conditions(self):
16  return PDETerms.User_Defined_Implementation
17 
18  def generate_required_files(self, order):
19  return
20 
21  def generate_file_from_template(self, template_file, full_qualified_filename, dictionary):
22  print(os.path.split(template_file)[0])
23  template_loader = jinja2.FileSystemLoader(searchpath=os.path.split(template_file)[0])
24  templateEnv = jinja2.Environment(loader=template_loader, undefined=jinja2.DebugUndefined)
25  template = templateEnv.get_template( os.path.split(template_file)[1] )
26 
27  with open( full_qualified_filename, "w" ) as output:
28  output.write( template.render(dictionary) )
29 
30  return
31 
32  def copy_file_to_current_folder(self, current_filename, full_qualified_filename):
33  shutil.copyfile(current_filename, full_qualified_filename)
34  return
def initial_conditions(self)
Definition: Scenario.py:15
def generate_required_files(self, order)
Definition: Scenario.py:18
def generate_file_from_template(self, template_file, full_qualified_filename, dictionary)
Definition: Scenario.py:21
def copy_file_to_current_folder(self, current_filename, full_qualified_filename)
Definition: Scenario.py:32