def initialize(self, filename=None): """Initialize the Heat model. Parameters ---------- filename : str, optional Path to name of input file. """ if filename is None: self._model = Heat() elif isinstance(filename, types.StringTypes): with open(filename, "r") as file_obj: self._model = Heat.from_file_like(file_obj.read()) else: self._model = Heat.from_file_like(filename) self._values = {"plate_surface__temperature": self._model.temperature} self._var_units = {"plate_surface__temperature": "K"} self._grids = {0: ["plate_surface__temperature"]} self._grid_type = {0: "uniform_rectilinear_grid"}
def initialize(self, filename=None): """Initialize the Heat model. Parameters ---------- filename : str, optional Path to name of input file. """ if filename is None: self._model = Heat() elif isinstance(filename, types.StringTypes): with open(filename, 'r') as file_obj: self._model = Heat.from_file_like(file_obj.read()) else: self._model = Heat.from_file_like(filename) self._values = { 'plate_surface__temperature': self._model.temperature, } self._var_units = {'plate_surface__temperature': 'K'} self._grids = {0: ['plate_surface__temperature']} self._grid_type = {0: 'uniform_rectilinear_grid'}