KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Public Member Functions | Public Attributes | List of all members
python_solver.PythonSolver Class Reference

The base class for the Python Solvers in the applications Changes to this BaseClass have to be discussed first! More...

Collaboration diagram for python_solver.PythonSolver:

Public Member Functions

def __init__ (self, model, settings)
 The constructor of the PythonSolver-Object. More...
 
def GetDefaultParameters (cls)
 This function returns the default-settings used by this class. More...
 
def ValidateSettings (self)
 This function validates the settings of the solver. More...
 
def AddVariables (self)
 This function add the Variables needed by this PythonSolver to the the ModelPart It has to be called BEFORE the ModelPart is read! More...
 
def AddDofs (self)
 This function add the Dofs needed by this PythonSolver to the the ModelPart It has to be called AFTER the ModelPart is read! More...
 
def GetDofsList (self)
 This function returns a list containing the DOFs required by this PythonSolver In needs to be reimplemented in the derived solvers according to the physics to be solved Ideally, DOFs list must be retrieved from the elements and conditions GetSpecification method (see GetDofsListFromSpecifications in the SpecificationUtilities) More...
 
def ImportModelPart (self)
 This function reads the ModelPart. More...
 
def PrepareModelPart (self)
 This function prepares the ModelPart for being used by the PythonSolver. More...
 
def GetMinimumBufferSize (self)
 This function returns the minimum buffer size needed for this PythonSolver. More...
 
def ExportModelPart (self)
 This function exports the ModelPart to and mdpa-file. More...
 
def AdvanceInTime (self, current_time)
 This function advances the PythonSolver in time Usage: It is designed to be called once per solution step, before performing the solution. More...
 
def Initialize (self)
 This function initializes the PythonSolver Usage: It is designed to be called ONCE, BEFORE the execution of the solution-loop. More...
 
def Finalize (self)
 This function finalizes the PythonSolver Usage: It is designed to be called ONCE, AFTER the execution of the solution-loop. More...
 
def Predict (self)
 This function performs all the required operations that should be executed (for each step) ONCE, AFTER initializing the solution step. More...
 
def InitializeSolutionStep (self)
 This function performs all the required operations that should be executed (for each step) BEFORE solving the solution step. More...
 
def FinalizeSolutionStep (self)
 This function performs all the required operations that should be executed (for each step) AFTER solving the solution step. More...
 
def SolveSolutionStep (self)
 This function solves the current step. More...
 
def Check (self)
 This function checks the PythonSolver. More...
 
def Clear (self)
 This function clears the PythonSolver. More...
 
def GetComputingModelPart (self)
 

Public Attributes

 model
 
 settings
 
 echo_level
 

Detailed Description

The base class for the Python Solvers in the applications Changes to this BaseClass have to be discussed first!

Constructor & Destructor Documentation

◆ __init__()

def python_solver.PythonSolver.__init__ (   self,
  model,
  settings 
)

The constructor of the PythonSolver-Object.

    It is intended to be called from the constructor
    of deriving classes:
    super().__init__(settings)

    Keyword arguments:
    self -- It signifies an instance of a class.
    model -- The Model to be used
    settings -- The solver settings used

Member Function Documentation

◆ AddDofs()

def python_solver.PythonSolver.AddDofs (   self)

This function add the Dofs needed by this PythonSolver to the the ModelPart It has to be called AFTER the ModelPart is read!

◆ AddVariables()

def python_solver.PythonSolver.AddVariables (   self)

This function add the Variables needed by this PythonSolver to the the ModelPart It has to be called BEFORE the ModelPart is read!

◆ AdvanceInTime()

def python_solver.PythonSolver.AdvanceInTime (   self,
  current_time 
)

This function advances the PythonSolver in time Usage: It is designed to be called once per solution step, before performing the solution.

◆ Check()

def python_solver.PythonSolver.Check (   self)

This function checks the PythonSolver.

It usually calls the "Check" function of a solving strategy

◆ Clear()

def python_solver.PythonSolver.Clear (   self)

This function clears the PythonSolver.

◆ ExportModelPart()

def python_solver.PythonSolver.ExportModelPart (   self)

This function exports the ModelPart to and mdpa-file.

◆ Finalize()

def python_solver.PythonSolver.Finalize (   self)

This function finalizes the PythonSolver Usage: It is designed to be called ONCE, AFTER the execution of the solution-loop.

◆ FinalizeSolutionStep()

def python_solver.PythonSolver.FinalizeSolutionStep (   self)

This function performs all the required operations that should be executed (for each step) AFTER solving the solution step.

◆ GetComputingModelPart()

def python_solver.PythonSolver.GetComputingModelPart (   self)

◆ GetDefaultParameters()

def python_solver.PythonSolver.GetDefaultParameters (   cls)

This function returns the default-settings used by this class.

◆ GetDofsList()

def python_solver.PythonSolver.GetDofsList (   self)

This function returns a list containing the DOFs required by this PythonSolver In needs to be reimplemented in the derived solvers according to the physics to be solved Ideally, DOFs list must be retrieved from the elements and conditions GetSpecification method (see GetDofsListFromSpecifications in the SpecificationUtilities)

◆ GetMinimumBufferSize()

def python_solver.PythonSolver.GetMinimumBufferSize (   self)

This function returns the minimum buffer size needed for this PythonSolver.

◆ ImportModelPart()

def python_solver.PythonSolver.ImportModelPart (   self)

This function reads the ModelPart.

◆ Initialize()

def python_solver.PythonSolver.Initialize (   self)

This function initializes the PythonSolver Usage: It is designed to be called ONCE, BEFORE the execution of the solution-loop.

◆ InitializeSolutionStep()

def python_solver.PythonSolver.InitializeSolutionStep (   self)

This function performs all the required operations that should be executed (for each step) BEFORE solving the solution step.

◆ Predict()

def python_solver.PythonSolver.Predict (   self)

This function performs all the required operations that should be executed (for each step) ONCE, AFTER initializing the solution step.

◆ PrepareModelPart()

def python_solver.PythonSolver.PrepareModelPart (   self)

This function prepares the ModelPart for being used by the PythonSolver.

◆ SolveSolutionStep()

def python_solver.PythonSolver.SolveSolutionStep (   self)

This function solves the current step.

It can be called multiple times within one solution step Returns whether the problem is converged

◆ ValidateSettings()

def python_solver.PythonSolver.ValidateSettings (   self)

This function validates the settings of the solver.

Member Data Documentation

◆ echo_level

python_solver.PythonSolver.echo_level

◆ model

python_solver.PythonSolver.model

◆ settings

python_solver.PythonSolver.settings

The documentation for this class was generated from the following file: