示例#1
0
    def __init__(self,model,parameters):
        # Time monitoring
        KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(),timer.ctime())
        self.initial_time = timer.perf_counter()

        # Set number of OMP threads
        parallel=Kratos.OpenMPUtils()
        parallel.SetNumThreads(parameters["problem_data"]["number_of_threads"].GetInt())

        ## Import parallel modules if needed
        if (parameters["problem_data"]["parallel_type"].GetString() == "MPI"):
            import KratosMultiphysics.MetisApplication as MetisApplication
            import KratosMultiphysics.TrilinosApplication as TrilinosApplication
            KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(),"MPI parallel configuration. OMP_NUM_THREADS =",parallel.GetNumThreads())
        else:
            import poromechanics_cleaning_utility
            poromechanics_cleaning_utility.CleanPreviousFiles(os.getcwd()) # Clean previous post files
            KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(),"OpenMP parallel configuration. OMP_NUM_THREADS =",parallel.GetNumThreads())

        # Initialize Fracture Propagation Utility if necessary
        if parameters["problem_data"]["fracture_utility"].GetBool():
            import poromechanics_fracture_propagation_utility
            self.fracture_utility = poromechanics_fracture_propagation_utility.FracturePropagationUtility(model,
                                                                                                        self._GetOrderOfProcessesInitialization())
            parameters = self.fracture_utility.Initialize(parameters)

        # Creating solver and model part and adding variables
        super(PoromechanicsAnalysis,self).__init__(model,parameters)
示例#2
0
gid_output.ExecuteInitialize()

# Initialize the solver
solver.Initialize()

# ExecuteBeforeSolutionLoop
for process in list_of_processes:
    process.ExecuteBeforeSolutionLoop()

## Set results when they are written in a single file
gid_output.ExecuteBeforeSolutionLoop()

# Initialize Fracture Propagation Utility
import poromechanics_fracture_propagation_utility
fracture_utility = poromechanics_fracture_propagation_utility.FracturePropagationUtility(
    PoroModel, original_model_part_name, model_part_number, domain_size,
    problem_name,
    ProjectParameters["solver_settings"]["move_mesh_flag"].GetBool())

## Temporal loop ---------------------------------------------------------------------------------------------

while ((time + tol) <= end_time):

    # Update temporal variables
    delta_time = main_model_part.ProcessInfo[KratosMultiphysics.DELTA_TIME]
    time = time + delta_time
    main_model_part.CloneTimeStep(time)

    # Update imposed conditions
    for process in list_of_processes:
        process.ExecuteInitializeSolutionStep()
示例#3
0
# Initialize the solver
solver.Initialize()

# ExecuteBeforeSolutionLoop
for process in list_of_processes:
    process.ExecuteBeforeSolutionLoop()
    
## Set results when they are written in a single file
gid_output.ExecuteBeforeSolutionLoop()

# Initialize Fracture Propagation Utility
FracturePropagation = ProjectParameters["problem_data"]["fracture_propagation"].GetBool()
if FracturePropagation:
    import poromechanics_fracture_propagation_utility
    fracture_utility = poromechanics_fracture_propagation_utility.FracturePropagationUtility(domain_size,
                                                                                             problem_name,
                                                                                             ProjectParameters["solver_settings"]["move_mesh_flag"].GetBool())

## Temporal loop ---------------------------------------------------------------------------------------------

while( (time+tol) <= end_time ):
    
    # Update temporal variables
    delta_time = main_model_part.ProcessInfo[KratosMultiphysics.DELTA_TIME]
    time = time + delta_time
    main_model_part.CloneTimeStep(time)
    
    # Update imposed conditions
    for process in list_of_processes:
        process.ExecuteInitializeSolutionStep()