def _CreateLevelSetConvectionProcess(self):
        # Construct the level set convection process
        domain_size = self.main_model_part.ProcessInfo[KratosMultiphysics.DOMAIN_SIZE]
        computing_model_part = self.GetComputingModelPart()
        if self._bfecc_convection:
            if have_conv_diff:
                if domain_size == 2:
                    locator = KratosMultiphysics.BinBasedFastPointLocator2D(computing_model_part)
                    locator.UpdateSearchDatabase()
                    level_set_convection_process = KratosConvDiff.BFECCConvection2D(locator)
                else:
                    locator = KratosMultiphysics.BinBasedFastPointLocator3D(computing_model_part)
                    locator.UpdateSearchDatabase()
                    level_set_convection_process = KratosConvDiff.BFECCConvection3D(locator)
            else:
                raise Exception("The BFECC level set convection requires the Kratos ConvectionDiffusionApplication compilation.")
        else:
            linear_solver = self._GetLinearSolver()
            if domain_size == 2:
                level_set_convection_process = KratosMultiphysics.LevelSetConvectionProcess2D(
                    KratosMultiphysics.DISTANCE,
                    computing_model_part,
                    linear_solver)
            else:
                level_set_convection_process = KratosMultiphysics.LevelSetConvectionProcess3D(
                    KratosMultiphysics.DISTANCE,
                    computing_model_part,
                    linear_solver)

        return level_set_convection_process
Example #2
0
    def _set_level_set_convection_process(self):
        # Construct the level set convection process
        if self._bfecc_convection:
            if have_conv_diff:
                if self.main_model_part.ProcessInfo[
                        KratosMultiphysics.DOMAIN_SIZE] == 2:
                    locator = KratosMultiphysics.BinBasedFastPointLocator2D(
                        self.main_model_part).UpdateSearchDatabase()
                    level_set_convection_process = KratosConvDiff.BFECCConvection2D(
                        locator)
                else:
                    locator = KratosMultiphysics.BinBasedFastPointLocator3D(
                        self.main_model_part).UpdateSearchDatabase()
                    level_set_convection_process = KratosConvDiff.BFECCConvection3D(
                        locator)
            else:
                raise Exception(
                    "The BFECC level set convection requires the Kratos ConvectionDiffusionApplication compilation."
                )
        else:
            if self.main_model_part.ProcessInfo[
                    KratosMultiphysics.DOMAIN_SIZE] == 2:
                level_set_convection_process = KratosMultiphysics.LevelSetConvectionProcess2D(
                    KratosMultiphysics.DISTANCE, self.main_model_part,
                    self.linear_solver)
            else:
                level_set_convection_process = KratosMultiphysics.LevelSetConvectionProcess3D(
                    KratosMultiphysics.DISTANCE, self.main_model_part,
                    self.linear_solver)

        return level_set_convection_process
Example #3
0
    def _CreateBFECCConvection(self):
        # Create the locator for the BFECC convector
        domain_size = self.GetComputingModelPart().ProcessInfo[
            KratosMultiphysics.DOMAIN_SIZE]
        if domain_size == 2:
            point_locator = KratosMultiphysics.BinBasedFastPointLocator2D(
                self.GetComputingModelPart())
        elif domain_size == 3:
            point_locator = KratosMultiphysics.BinBasedFastPointLocator3D(
                self.GetComputingModelPart())
        else:
            err_msg = "Wrong domain size: {0}".format(domain_size)
            raise Exception(err_msg)

        # Initialize the locator search database
        point_locator.UpdateSearchDatabase()

        # Create the BFECC convection utility
        if domain_size == 2:
            bfecc_utility = ConvectionDiffusionApplication.BFECCConvection2D(
                point_locator)
        else:
            bfecc_utility = ConvectionDiffusionApplication.BFECCConvection3D(
                point_locator)

        return bfecc_utility