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.
Functions | Variables
script Namespace Reference

Functions

def StartTimeMeasuring ()
 
def StopTimeMeasuring (time_ip, process, report)
 
def SetParallelSize (num_threads)
 TIME MONITORING END ####. More...
 
def GetParallelSize ()
 

Variables

 t0p = timer.clock()
 
 t0w = timer.time()
 
 parameter_file = open("ProjectParameters.json",'r')
 PARSING THE PARAMETERS ####. More...
 
 ProjectParameters = KratosMultiphysics.Parameters(parameter_file.read())
 
 echo_level = ProjectParameters["problem_data"]["echo_level"].GetInt()
 
 threads = ProjectParameters["problem_data"]["threads"].GetInt()
 
def num_threads = GetParallelSize()
 
 main_model_part = KratosMultiphysics.ModelPart(ProjectParameters["problem_data"]["model_part_name"].GetString())
 Model_part settings start ####. More...
 
dictionary Model = {ProjectParameters["problem_data"]["model_part_name"].GetString() : main_model_part}
 TODO replace this "model" for real one once available in kratos core. More...
 
 solver_module = __import__(ProjectParameters["solver_settings"]["solver_type"].GetString())
 
 solver = solver_module.CreateSolver(main_model_part, ProjectParameters["solver_settings"])
 
 part_name = ProjectParameters["solver_settings"]["processes_sub_model_part_list"][i].GetString()
 Get the list of the submodel part in the object Model. More...
 
 list_of_processes = process_factory.KratosProcessFactory(Model).ConstructListOfProcesses( ProjectParameters["constraints_process_list"] )
 
 computing_model_part = solver.GetComputingModelPart()
 processes settings end #### More...
 
 problem_path = os.getcwd()
 Sets strategies, builders, linear solvers, schemes and solving info, and fills the buffer. More...
 
 problem_name = ProjectParameters["problem_data"]["problem_name"].GetString()
 
 output_settings = ProjectParameters["output_configuration"]
 
 gid_output
 
int current_id = 0
 Output settings end ####. More...
 
 step = main_model_part.ProcessInfo[KratosMultiphysics.STEP]
 
 time = main_model_part.ProcessInfo[KratosMultiphysics.TIME]
 
 end_time = ProjectParameters["problem_data"]["end_time"].GetDouble()
 
 delta_time = ProjectParameters["problem_data"]["time_step"].GetDouble()
 
def clock_time = StartTimeMeasuring();
 
 tfp = timer.clock()
 END SOLUTION ####. More...
 
 tfw = timer.time()
 
 domain_size = fluid_ulf_var.domain_size
 
 fluid_model_part = ModelPart("FluidPart")
 
 structure_model_part = ModelPart("StructurePart")
 
 combined_model_part = ModelPart("CombinedPart");
 
 SolverType = fluid_ulf_var.SolverType
 
 fluid_only_model_part = ModelPart("FluidOnlyPart");
 
 input_file_name = fluid_ulf_var.problem_name
 
 gid_mode = GiDPostMode.GiD_PostBinary
 
 multifile = MultiFileFlag.MultipleFiles
 
 deformed_mesh_flag = WriteDeformedMeshFlag.WriteDeformed
 
 write_conditions = WriteConditionsFlag.WriteConditions
 
 gid_io = GidIO(input_file_name, gid_mode, multifile, deformed_mesh_flag, write_conditions)
 
 model_part_io_origin = ModelPartIO(input_file_name)
 
 compute_reactions = fluid_ulf_var.compute_reactions
 
 box_corner1 = Vector(3);
 
 box_corner2 = Vector(3);
 
string outstring2 = "convergence_info.txt"
 
 outputfile1 = open(outstring2, 'w')
 
 add_nodes = fluid_ulf_var.adaptive_refinement
 
 bulk_modulus = fluid_ulf_var.bulk_modulus
 
 density = fluid_ulf_var.density
 
 FSI = fluid_ulf_var.FSI
 
float is_fsi_interf = 0.0
 
 alpha_shape
 
 Dt = fluid_ulf_var.Dt
 
 full_Dt = Dt
 
float initial_Dt = 0.001 * full_Dt
 
 final_time = fluid_ulf_var.max_time
 
 output_step = fluid_ulf_var.output_step
 
float safety_factor = 0.5
 
 next_output_time = output_step
 
 inlet_vel = Vector(3)
 
 dummy = LagrangianInletProcess(fluid_model_part, 0.0, inlet_vel)
 
float new_Dt = 0.00000001;
 
 file_name = input_file_name
 

Function Documentation

◆ GetParallelSize()

def script.GetParallelSize ( )

◆ SetParallelSize()

def script.SetParallelSize (   num_threads)

TIME MONITORING END ####.

SET NUMBER OF THREADS ####

◆ StartTimeMeasuring()

def script.StartTimeMeasuring ( )

◆ StopTimeMeasuring()

def script.StopTimeMeasuring (   time_ip,
  process,
  report 
)

Variable Documentation

◆ add_nodes

◆ alpha_shape

script.alpha_shape

◆ box_corner1

script.box_corner1 = Vector(3);

◆ box_corner2

script.box_corner2 = Vector(3);

◆ bulk_modulus

script.bulk_modulus = fluid_ulf_var.bulk_modulus

◆ clock_time

def script.clock_time = StartTimeMeasuring();

◆ combined_model_part

script.combined_model_part = ModelPart("CombinedPart");

◆ compute_reactions

script.compute_reactions = fluid_ulf_var.compute_reactions

◆ computing_model_part

script.computing_model_part = solver.GetComputingModelPart()

processes settings end ####

START SOLUTION ####

◆ current_id

int script.current_id = 0

Output settings end ####.

◆ deformed_mesh_flag

script.deformed_mesh_flag = WriteDeformedMeshFlag.WriteDeformed

◆ delta_time

script.delta_time = ProjectParameters["problem_data"]["time_step"].GetDouble()

◆ density

script.density = fluid_ulf_var.density

◆ domain_size

script.domain_size = fluid_ulf_var.domain_size

◆ Dt

script.Dt = fluid_ulf_var.Dt

◆ dummy

script.dummy = LagrangianInletProcess(fluid_model_part, 0.0, inlet_vel)

◆ echo_level

script.echo_level = ProjectParameters["problem_data"]["echo_level"].GetInt()

◆ end_time

script.end_time = ProjectParameters["problem_data"]["end_time"].GetDouble()

◆ file_name

script.file_name = input_file_name

◆ final_time

script.final_time = fluid_ulf_var.max_time

◆ fluid_model_part

script.fluid_model_part = ModelPart("FluidPart")

◆ fluid_only_model_part

script.fluid_only_model_part = ModelPart("FluidOnlyPart");

◆ FSI

script.FSI = fluid_ulf_var.FSI

◆ full_Dt

script.full_Dt = Dt

◆ gid_io

◆ gid_mode

script.gid_mode = GiDPostMode.GiD_PostBinary

◆ gid_output

script.gid_output
Initial value:
1 = GiDOutputProcess(computing_model_part,
2  problem_name,
3  output_settings)

◆ initial_Dt

float script.initial_Dt = 0.001 * full_Dt

◆ inlet_vel

script.inlet_vel = Vector(3)

◆ input_file_name

script.input_file_name = fluid_ulf_var.problem_name

◆ is_fsi_interf

float script.is_fsi_interf = 0.0

◆ list_of_processes

script.list_of_processes = process_factory.KratosProcessFactory(Model).ConstructListOfProcesses( ProjectParameters["constraints_process_list"] )

◆ main_model_part

script.main_model_part = KratosMultiphysics.ModelPart(ProjectParameters["problem_data"]["model_part_name"].GetString())

Model_part settings start ####.

◆ Model

dictionary script.Model = {ProjectParameters["problem_data"]["model_part_name"].GetString() : main_model_part}

TODO replace this "model" for real one once available in kratos core.

◆ model_part_io_origin

script.model_part_io_origin = ModelPartIO(input_file_name)

◆ multifile

script.multifile = MultiFileFlag.MultipleFiles

◆ new_Dt

script.new_Dt = 0.00000001;

◆ next_output_time

script.next_output_time = output_step

◆ num_threads

def script.num_threads = GetParallelSize()

◆ output_settings

script.output_settings = ProjectParameters["output_configuration"]

◆ output_step

script.output_step = fluid_ulf_var.output_step

◆ outputfile1

script.outputfile1 = open(outstring2, 'w')

◆ outstring2

string script.outstring2 = "convergence_info.txt"

◆ parameter_file

script.parameter_file = open("ProjectParameters.json",'r')

PARSING THE PARAMETERS ####.

◆ part_name

script.part_name = ProjectParameters["solver_settings"]["processes_sub_model_part_list"][i].GetString()

Get the list of the submodel part in the object Model.

◆ problem_name

script.problem_name = ProjectParameters["problem_data"]["problem_name"].GetString()

◆ problem_path

script.problem_path = os.getcwd()

Sets strategies, builders, linear solvers, schemes and solving info, and fills the buffer.

Output settings start ####

◆ ProjectParameters

script.ProjectParameters = KratosMultiphysics.Parameters(parameter_file.read())

◆ safety_factor

float script.safety_factor = 0.5

◆ solver

script.solver = solver_module.CreateSolver(main_model_part, ProjectParameters["solver_settings"])

◆ solver_module

script.solver_module = __import__(ProjectParameters["solver_settings"]["solver_type"].GetString())

◆ SolverType

script.SolverType = fluid_ulf_var.SolverType

◆ step

int script.step = main_model_part.ProcessInfo[KratosMultiphysics.STEP]

◆ structure_model_part

script.structure_model_part = ModelPart("StructurePart")

◆ t0p

script.t0p = timer.clock()

◆ t0w

script.t0w = timer.time()

◆ tfp

script.tfp = timer.clock()

END SOLUTION ####.

◆ tfw

script.tfw = timer.time()

◆ threads

script.threads = ProjectParameters["problem_data"]["threads"].GetInt()

◆ time

float script.time = main_model_part.ProcessInfo[KratosMultiphysics.TIME]

◆ write_conditions

script.write_conditions = WriteConditionsFlag.WriteConditions