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