Example #1
0
    def readtec_polyline(self, pcs="ALL", trim=True, output_dir=None):
        r"""
        Collect TECPLOT polyline output from this OGS5 model.

        Parameters
        ----------
        pcs : string or None, optional
            specify the PCS type that should be collected
            Possible values are:

                - None/"" (no PCS_TYPE specified in \*.out)
                - "NO_PCS"
                - "GROUNDWATER_FLOW"
                - "LIQUID_FLOW"
                - "RICHARDS_FLOW"
                - "AIR_FLOW"
                - "MULTI_PHASE_FLOW"
                - "PS_GLOBAL"
                - "HEAT_TRANSPORT"
                - "DEFORMATION"
                - "MASS_TRANSPORT"
                - "OVERLAND_FLOW"
                - "FLUID_MOMENTUM"
                - "RANDOM_WALK"

            You can get a list with all known PCS-types by setting pcs="ALL"
            Default : "ALL"
        output_dir : :any:'None' or :class:'str', optional
            Sometimes OGS5 doesn't put the output in the right directory.
            You can specify a separate output directory here in this case.
            Default: :any:'None'
        trim : Bool, optional
            if the ply_ids are not continuous, there will be "None" values in
            the output list. If trim is "True" these values will be eliminated.
            If there is just one output for a polyline, the list will
            be eliminated and the output will be the single dict.
            Default : True

        Returns
        -------
        result : dict
            keys are the Polyline names and the items are lists sorted by the
            ply_id (it is assumed, that the ply_ids are continuous, if not, the
            corresponding list entries are "None")
            if pcs="ALL", the output is a dictionary with the PCS-types as keys
        """
        from ogs5py.reader import readtec_polyline as read

        if output_dir is not None:
            root = output_dir
        elif self.has_output_dir:
            root = self.output_dir
        else:
            root = self.task_root
        return read(task_root=root, task_id=self.task_id, pcs=pcs, trim=trim)
Example #2
0
    def readpvd(self, pcs="ALL", output_dir=None):
        r"""
        Read the paraview pvd files of this OGS5 model.

        All concerned files are converted to a dictionary containing their data

        Parameters
        ----------
        pcs : string or None, optional
            specify the PCS type that should be collected
            Possible values are:

                - None/"" (no PCS_TYPE specified in \*.out)
                - "NO_PCS"
                - "GROUNDWATER_FLOW"
                - "LIQUID_FLOW"
                - "RICHARDS_FLOW"
                - "AIR_FLOW"
                - "MULTI_PHASE_FLOW"
                - "PS_GLOBAL"
                - "HEAT_TRANSPORT"
                - "DEFORMATION"
                - "MASS_TRANSPORT"
                - "OVERLAND_FLOW"
                - "FLUID_MOMENTUM"
                - "RANDOM_WALK"

            You can get a list with all known PCS-types by setting PCS="ALL"
            Default : "ALL"
        output_dir : :any:'None' or :class:'str', optional
            Sometimes OGS5 doesn't put the output in the right directory.
            You can specify a separate output directory here in this case.
            Default: :any:'None'

        Returns
        -------
        result : dict
            keys are the point names and the items are the data from the
            corresponding files
            if pcs="ALL", the output is a dictionary with the PCS-types as keys
        """
        from ogs5py.reader import readpvd as read

        if output_dir is not None:
            root = output_dir
        elif self.has_output_dir:
            root = self.output_dir
        else:
            root = self.task_root
        return read(task_root=root, task_id=self.task_id, pcs=pcs)
Example #3
0
    def output_files(self, pcs=None, typ="VTK", element=None, output_dir=None):
        r"""
        Get a list of output file paths.

        Parameters
        ----------
        pcs : string or None, optional
            specify the PCS type that should be collected
            Possible values are:

                - None/"" (no PCS_TYPE specified in *.out)
                - "NO_PCS"
                - "GROUNDWATER_FLOW"
                - "LIQUID_FLOW"
                - "RICHARDS_FLOW"
                - "AIR_FLOW"
                - "MULTI_PHASE_FLOW"
                - "PS_GLOBAL"
                - "HEAT_TRANSPORT"
                - "DEFORMATION"
                - "MASS_TRANSPORT"
                - "OVERLAND_FLOW"
                - "FLUID_MOMENTUM"
                - "RANDOM_WALK"

            Default : None
        typ : string, optional
            Type of the output ("VTK", "PVD", "TEC_POINT" or "TEC_POLYLINE").
            Default : "VTK"
        element : string or None, optional
            For tecplot output you can specify the name of the output element.
            (Point-name of Line-name from GLI file)
            Default: None
        """
        from ogs5py.tools.output import get_output_files as read

        if output_dir is not None:
            root = output_dir
        elif self.has_output_dir:
            root = self.output_dir
        else:
            root = self.task_root
        return read(root, self.task_id, pcs, typ, element)