Beispiel #1
0
    def __init__(self, *args, **kwargs):
        RunApp.__init__(self, *args, **kwargs)

        self.moose_dir = os.environ.get(
            'MOOSE_DIR',
            os.path.abspath(
                os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             '..')))

        if os.environ.get("LIBMESH_DIR"):
            self.libmesh_dir = os.environ['LIBMESH_DIR']
        else:
            self.libmesh_dir = os.path.join(self.moose_dir, 'libmesh',
                                            'installed')

        if self.specs['turn_off_exodus_output']:
            self.specs['cli_args'][:0] = ['Outputs/exodus=false']

        if list(map(int,
                    util.getPetscVersion(
                        self.libmesh_dir).split("."))) < [3, 9]:
            self.old_petsc = True
            self.specs['cli_args'].extend(
                ['-snes_type test', '-snes_mf_operator 0'])
        else:
            self.old_petsc = False
            self.specs['cli_args'].extend(
                ['-snes_test_jacobian', '-snes_force_iteration'])
            if not self.specs['run_sim']:
                self.specs['cli_args'].extend([
                    '-snes_type', 'ksponly', '-ksp_type', 'preonly',
                    '-pc_type', 'none', '-snes_convergence_test', 'skip'
                ])
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     RunApp.__init__(self, *args, **kwargs)
     if (self.specs.isValid("expect_err") == False
             and self.specs.isValid("expect_assert") == False):
         raise RuntimeError(
             'Either "expect_err" or "expect_assert" must be supplied in RunException'
         )
Beispiel #3
0
    def validParams():
        params = RunApp.validParams()
        params.addParam('ratio_tol', 1e-8,
                        "Relative tolerance to compare the ration against.")
        params.addParam(
            'difference_tol', 1e-8,
            "Relative tolerance to compare the difference against.")
        params.addParam(
            'state', 'user',
            "The state for which we want to compare against the "
            "finite-differenced Jacobian ('user', 'const_positive', or "
            "'const_negative'.")
        params.addParam(
            'run_sim', False,
            "Whether to actually run the simulation, testing the Jacobian "
            "at every non-linear iteration of every time step. This is only "
            "relevant for petsc versions >= 3.9.")
        params.addParam('turn_off_exodus_output', True,
                        "Whether to set exodus=false in Outputs")

        # override default values
        params.setDefault('valgrind', 'NONE')
        params.setDefault('petsc_version', ('>=3.9.4', ))
        params.setDefault('method', 'OPT')

        return params
Beispiel #4
0
 def validParams():
     params = RunApp.validParams()
     params.addParam(
         'gold_dir', 'gold',
         "The directory where the \"golden standard\" files reside relative to the TEST_DIR: (default: ./gold/)"
     )
     params.addParam('abs_zero', 1e-10,
                     "Absolute zero cutoff used in exodiff comparisons.")
     params.addParam('rel_err', 5.5e-6,
                     "Relative error value used in exodiff comparisons.")
     return params
Beispiel #5
0
 def validParams():
     params = RunApp.validParams()
     params.add('jsondiff',
                vtype=str,
                array=True,
                required=True,
                doc="A list of XML files to compare.")
     params.addParam(
         'gold_dir', 'gold',
         "The directory where the \"golden standard\" files reside relative to the TEST_DIR: (default: ./gold/)"
     )
     params.addParam('skip_keys', [],
                     "A list of keys to skip in the JSON comparison")
     return params
Beispiel #6
0
    def validParams():
        params = RunApp.validParams()

        #params.addParam('expect_err', "A regular expression or literal string that must occur in the output (see match_literal). (Test may terminate unexpectedly and be considered passing)")
        params.addParam(
            'expect_assert',
            "DEBUG MODE ONLY: A regular expression that must occur in the output. (Test may terminate unexpectedly and be considered passing)"
        )
        #params.addParam('should_crash', True, "Inidicates that the test is expected to crash or otherwise terminate early")
        params.set('should_crash', True)

        # RunException tests executed in parallel need to have their output redirected to a file, and examined individually
        params['redirect_output'] = True

        return params
Beispiel #7
0
    def validParams():
        params = RunApp.validParams()

        # Input is optional in the base class. Make it required here
        # params.addRequiredParam('input', "The python input file to use for this test.")
        params.addParam(
            'test_case',
            "The specific test case to run (Default: All test cases in the module)"
        )
        params.addParam(
            'buffer', False,
            "Equivalent to passing -b or --buffer to the unittest.")
        params.addParam('separate', False,
                        "Run each test in the file in a separate subprocess")
        # We don't want to check for any errors on the screen with unit tests
        params['errors'] = tuple()
        params['valgrind'] = 'NONE'
        params['recover'] = False
        return params
Beispiel #8
0
    def validParams():
        params = RunApp.validParams()
        params.add('xmldiff',
                   vtype=str,
                   array=True,
                   required=True,
                   doc="A list of XML files to compare.")
        params.addParam(
            'gold_dir', 'gold',
            "The directory where the \"golden standard\" files reside relative to the TEST_DIR: (default: ./gold/)"
        )
        params.addParam('abs_zero', 1e-10,
                        "Absolute zero cutoff used in exodiff comparisons.")
        params.addParam('rel_err', 5.5e-6,
                        "Relative error value used in exodiff comparisons.")
        params.addParam(
            'ignored_attributes', [],
            "Ignore e.g. type and/or version in sample XML block <VTKFile type=\"Foo\" version=\"0.1\">"
        )

        return params
Beispiel #9
0
 def __init__(self, *args, **kwargs):
     RunApp.__init__(self, *args, **kwargs)
Beispiel #10
0
 def checkRunnable(self, options):
     if options.enable_recover:
         self.addCaveats('PetscJacTester RECOVER')
         self.setStatus(self.skip)
         return False
     return RunApp.checkRunnable(self, options)
Beispiel #11
0
 def checkRunnable(self, options):
     if options.enable_recover:
         self.addCaveats('type=RunException')
         self.setStatus(self.skip)
         return False
     return RunApp.checkRunnable(self, options)