예제 #1
0
    def ExecuteInitialize(self):

        self.interval = KratosMultiphysics.Vector(2)
        self.interval[0] = self.params["interval"][0].GetDouble()
        self.interval[1] = self.params["interval"][1].GetDouble()
        self.print_drag_to_screen = self.params[
            "print_drag_to_screen"].GetBool()
        self.write_drag_output_file = self.params[
            "write_drag_output_file"].GetBool()

        if (self.write_drag_output_file):
            if (self.model_part.GetCommunicator().MyPID() == 0):

                output_file_name = self.params["model_part_name"].GetString(
                ) + "_drag.dat"

                file_handler_params = KratosMultiphysics.Parameters(
                    self.params["output_file_settings"])

                if file_handler_params.Has("file_name"):
                    warn_msg = 'Unexpected user-specified entry found in "output_file_settings": {"file_name": '
                    warn_msg += '"' + file_handler_params[
                        "file_name"].GetString() + '"}\n'
                    warn_msg += 'Using this specififed file name instead of the default "' + output_file_name + '"'
                    KratosMultiphysics.Logger.PrintWarning(
                        "ComputeDragProcess", warn_msg)
                else:
                    file_handler_params.AddEmptyValue("file_name")
                    file_handler_params["file_name"].SetString(
                        output_file_name)
                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part, file_handler_params, file_header).file
예제 #2
0
    def ExecuteInitialize(self):
        kratos_version = "not_given"
        if (self.output_settings["write_kratos_version"].GetBool()):
            kratos_version = str(Kratos.KratosGlobals.Kernel.Version())

        time_stamp = "not_specified"
        if (self.output_settings["write_time_stamp"].GetBool()):
            time_stamp = str(datetime.now())

        output_control_variable_name = self.output_settings[
            "output_control_variable"].GetString()

        self.output_files = []
        for variable_settings in self.variables_settings_list:
            container_name = variable_settings["container"].GetString()
            norm_type = variable_settings["norm_type"].GetString()
            method_name = variable_settings["method_name"].GetString()

            msg_header = ""
            msg_header += "# Spatial statistics process output\n"
            msg_header += "# Kratos version               : " + kratos_version + "\n"
            msg_header += "# Timestamp                    : " + time_stamp + "\n"
            msg_header += "# Method Name                  : " + method_name + "\n"
            msg_header += "# Norm type                    : " + norm_type + "\n"
            msg_header += "# Container type               : " + container_name + "\n"
            msg_header += "# Modelpart name               : " + self.model_part_name + "\n"
            msg_header += "# Output control variable name : " + output_control_variable_name + "\n"
            msg_header += "# ----------------------------------------------------------------------\n"
            msg_header += "# Headers:\n"

            output_file_settings = self.output_settings["output_file_settings"]
            output_file_name_syntax = output_file_settings[
                "file_name"].GetString()
            output_file_name = output_file_name_syntax.replace(
                "<model_part_name>", self.model_part_name)
            output_file_name = output_file_name.replace(
                "<container>", container_name)
            output_file_name = output_file_name.replace(
                "<norm_type>", norm_type)
            output_file_name = output_file_name.replace(
                "<method_name>", method_name)

            current_output_file_settings = Kratos.Parameters("""{}""")
            current_output_file_settings.AddEmptyValue("file_name")
            current_output_file_settings["file_name"].SetString(
                output_file_name)
            current_output_file_settings.AddEmptyValue("output_path")
            current_output_file_settings["output_path"].SetString(
                output_file_settings["output_path"].GetString())
            # restarting is not supported if STEP is used as the control variable
            if (self.__is_writing_process()):
                self.output_files.append(
                    TimeBasedAsciiFileWriterUtility(
                        self.__get_model_part(), current_output_file_settings,
                        msg_header))
            else:
                self.output_files.append("dummy")
    def __init__(self, model, params):
        '''Constructor of ComputeBoundaryForceProcess.'''

        super().__init__()

        default_settings = KM.Parameters("""
            {
                "model_part_wall_name"   : "",
                "model_part_bottom_name" : "",
                "interval"               : [0.0, 1e30],                
                "print_to_screen"        : false,
                "print_format"           : ".8f",
                "write_output_file"      : true,
                "output_file_settings"   : {}
            }
            """)

        self.interval = KM.IntervalUtility(params)

        params.ValidateAndAssignDefaults(default_settings)

        self.model_part_wall_name = params['model_part_wall_name'].GetString()
        self.model_part_wall = model[self.model_part_wall_name]
        self.model_part_bottom_name = params[
            'model_part_bottom_name'].GetString()
        self.model_part_bottom = model[self.model_part_bottom_name]

        self.print_to_screen = params['print_to_screen'].GetBool()
        self.write_output_file = params['write_output_file'].GetBool()
        self.print_format = params["print_format"].GetString()

        if (self.model_part_wall.GetCommunicator().MyPID() == 0):
            if (self.write_output_file):

                default_file_name = params["model_part_wall_name"].GetString(
                ) + "_global_force.dat"

                file_handler_params = KM.Parameters(
                    params["output_file_settings"])

                if file_handler_params.Has("file_name"):
                    file_name = file_handler_params["file_name"].GetString()
                    msg = 'Unexpected user-specified entry found in "output_file_settings":\n'
                    msg += '\t"file_name" : "{}"\n'
                    msg += 'Using this specified file name instead of the default ("{}")'
                    KM.Logger.PrintWarning(
                        "ComputeBoundaryForceProcess",
                        msg.format(file_name, default_file_name))
                else:
                    file_handler_params.AddString("file_name",
                                                  default_file_name)

                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part_wall, file_handler_params,
                    file_header).file
예제 #4
0
 def PrintOutput(self):
     """The output file is created, filled and closed. If several output
     timesteps are specified, there will be one file for each timestep.
     """
     time = self.model_part.ProcessInfo.GetValue(KM.TIME)
     file_name = self.settings["file_name"].GetString() + "_{:.4f}.dat".format(time)
     self.out_file_params["file_name"].SetString(file_name)
     file = TimeBasedAsciiFileWriterUtility(self.model_part, self.out_file_params, self._GetHeader()).file
     for node in self.nodes:
         file.write(self._GetData(node, self._DistanceToOrigin(node)))
     file.close()
예제 #5
0
    def __init__(self, Model, settings):
        KratosMultiphysics.Process.__init__(self)

        default_settings = KratosMultiphysics.Parameters("""
            {
                "model_part_name"           : "please_specify_model_part_name",
                "interval"                  : [0.0, 1e30],
                "reference_point"           : [0.0, 0.0, 0.0],
                "print_drag_to_screen"      : false,
                "print_format"              : ".8f",
                "write_drag_output_file"    : true,
                "output_file_settings": {}
            }
            """)

        self.settings = settings

        # Detect "End" as a tag and replace it by a large number
        if (self.settings.Has("interval")):
            if (self.settings["interval"][1].IsString()):
                if (self.settings["interval"][1].GetString() == "End"):
                    self.settings["interval"][1].SetDouble(1e30)
                else:
                    raise Exception(
                        "The second value of interval can be \"End\" or a number, interval currently:"
                        + self.settings["interval"].PrettyPrintJsonString())

        self.settings.ValidateAndAssignDefaults(default_settings)

        self.model_part = Model[self.settings["model_part_name"].GetString()]
        self.interval = KratosMultiphysics.Vector(2)
        self.interval[0] = self.settings["interval"][0].GetDouble()
        self.interval[1] = self.settings["interval"][1].GetDouble()
        self.print_drag_to_screen = self.settings[
            "print_drag_to_screen"].GetBool()
        self.write_drag_output_file = self.settings[
            "write_drag_output_file"].GetBool()

        self.format = self.settings["print_format"].GetString()

        # PMT: added reference point for moment calculation
        self.reference_x = self.settings["reference_point"][0].GetDouble()
        self.reference_y = self.settings["reference_point"][1].GetDouble()
        self.reference_z = self.settings["reference_point"][2].GetDouble()

        if (self.model_part.GetCommunicator().MyPID() == 0):
            if (self.write_drag_output_file):

                file_handler_params = KratosMultiphysics.Parameters(
                    settings["output_file_settings"])

                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part, file_handler_params, file_header).file
예제 #6
0
    def __init__(self, model, params):
        KratosMultiphysics.Process.__init__(self)

        default_settings = KratosMultiphysics.Parameters("""
            {
                "model_part_name"      : "",
                "interval"             : [0.0, 1e30],
                "cfl_output_limit"     : 2.5,
                "print_to_screen"      : false,
                "print_format"         : ".8f",
                "write_output_file"    : true,
                "output_step"          : 8,
                "output_file_settings": {}
            }
            """)

        # Detect "End" as a tag and replace it by a large number
        if (params.Has("interval")):
            if (params["interval"][1].IsString()):
                if (params["interval"][1].GetString() == "End"):
                    params["interval"][1].SetDouble(1e30)
                else:
                    raise Exception(
                        "The second value of interval can be \"End\" or a number, interval currently:"
                        + params["interval"].PrettyPrintJsonString())

        params.ValidateAndAssignDefaults(default_settings)

        # getting the ModelPart from the Model
        self.model_part_name = params["model_part_name"].GetString()
        if self.model_part_name == "":
            raise Exception('No "model_part_name" was specified!')
        else:
            self.model_part = model[self.model_part_name]

        self.interval = params["interval"].GetVector()

        # getting output limit for summarization
        self.cfl_output_limit = params["cfl_output_limit"].GetDouble()

        self.format = params["print_format"].GetString()
        self.output_step = params["output_step"].GetInt()
        self.print_to_screen = params["print_to_screen"].GetBool()
        self.write_output_file = params["write_output_file"].GetBool()

        if (self.model_part.GetCommunicator().MyPID() == 0):
            if (self.write_output_file):
                file_handler_params = KratosMultiphysics.Parameters(
                    params["output_file_settings"])

                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part, file_handler_params, file_header).file
예제 #7
0
 def ExecuteInitialize(self):
     self.response.Initialize()
     # Only rank 0 writes in MPI
     my_rank = 0
     comm = self.main_model_part.GetCommunicator().GetDataCommunicator()
     self.is_writing_rank = my_rank == comm.Rank()
     if self.is_writing_rank:
         file_handler_params = Kratos.Parameters(
             self.params["output_file_settings"])
         file_header = self.GetFileHeader()
         self.output_file = TimeBasedAsciiFileWriterUtility(
             self.main_model_part, file_handler_params, file_header).file
예제 #8
0
    def __SearchPoint(self):
        # retrieving the entity type
        entity_type = self.params["entity_type"].GetString()

        if entity_type == "node":
            found_id = KratosMultiphysics.BruteForcePointLocator(self.model_part).FindNode(self.point, self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Nodes[found_id]) # note that this is a find!
                self.area_coordinates.append("dummy") # needed for looping later
        elif entity_type == "element":
            self.sf_values = KratosMultiphysics.Vector()
            found_id = KratosMultiphysics.BruteForcePointLocator(self.model_part).FindElement(self.point, self.sf_values, self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Elements[found_id]) # note that this is a find!
                self.area_coordinates.append(self.sf_values)
        elif entity_type == "condition":
            self.sf_values = KratosMultiphysics.Vector()
            found_id = KratosMultiphysics.BruteForcePointLocator(self.model_part).FindCondition(self.point, self.sf_values, self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Conditions[found_id]) # note that this is a find!
                self.area_coordinates.append(self.sf_values)
        else:
            err_msg  = 'Invalid "entity_type" specified, it can only be:\n'
            err_msg += '"node", "element", "condition"'
            raise Exception(err_msg)

        # Check if a point was found, and initalize output
        # NOTE: If the search was not successful (i.e. found_id = -1), we fail silently and
        # do nothing. This is BY DESIGN, as we are supposed to work on MPI too, and the point
        # in question might lie on a different partition.
        # Here we also check if the point has been found in more than one partition
        # In such a case only one rank (the one with the larger PID) writes the output!
        my_rank = -1 # dummy to indicate that the point is not in my partition
        comm = self.model_part.GetCommunicator().GetDataCommunicator()
        if found_id > -1: # the point lies in my partition
            my_rank = comm.Rank()
        writing_rank = comm.MaxAll(my_rank) # The partition with the larger rank writes

        if my_rank == writing_rank:

            file_handler_params = KratosMultiphysics.Parameters(self.params["output_file_settings"])
            file_header = GetFileHeader(entity_type, found_id, self.point, self.output_variables[0])

            self.output_file.append(TimeBasedAsciiFileWriterUtility(
                self.model_part, file_handler_params, file_header).file)
예제 #9
0
    def ExecuteInitialize(self):
        # getting the ModelPart from the Model
        model_part_name_list = self.params["model_part_name_list"]
        if model_part_name_list.size() == 0:
            raise Exception('No model parts are specified!')

        self.model_part_for_time = self.model[
            model_part_name_list[0].GetString()]

        # Only rank 0 writes in MPI
        my_rank = 0
        comm = self.model_part_for_time.GetCommunicator().GetDataCommunicator()
        self.is_writing_rank = my_rank == comm.Rank()
        if self.is_writing_rank:
            file_handler_params = KratosMultiphysics.Parameters(
                self.params["output_file_settings"])
            file_header = self.GetFileHeader()
            self.output_file = TimeBasedAsciiFileWriterUtility(
                self.model_part_for_time, file_handler_params,
                file_header).file
예제 #10
0
    def ExecuteInitialize(self):
        # getting the ModelPart from the Model
        model_part_name = self.params["model_part_name"].GetString()
        if model_part_name == "":
            raise Exception('No "model_part_name" was specified!')
        self.model_part = self.model[model_part_name]

        # retrieving the position of the entity
        point_position = self.params["position"].GetVector()
        if point_position.Size() != 3:
            raise Exception(
                'The position has to be provided with 3 coordinates!')
        point = KratosMultiphysics.Point(point_position[0], point_position[1],
                                         point_position[2])

        # retrieving the output variables
        output_var_names = self.params["output_variables"]
        variable_names = [
            output_var_names[i].GetString()
            for i in range(output_var_names.size())
        ]
        output_vars = [
            KratosMultiphysics.KratosGlobals.GetVariable(var)
            for var in variable_names
        ]
        if len(output_vars) == 0:
            raise Exception('No variables specified for output!')
        self.output_variables.append(output_vars)
        # validate types of variables
        for var in self.output_variables[0]:
            if self.historical_value:
                self.__CheckVariableIsSolutionStepVariable(var)
            if type(var) == KratosMultiphysics.DoubleVariable:
                continue
            elif type(var) == KratosMultiphysics.Array1DVariable3:
                continue
            else:
                err_msg = 'Type of variable "' + var.Name(
                ) + '" is not valid\n'
                err_msg += 'It can only be double, component or array3d!'
                raise Exception(err_msg)

        # retrieving the entity type
        entity_type = self.params["entity_type"].GetString()

        if entity_type == "node":
            found_id = KratosMultiphysics.BruteForcePointLocator(
                self.model_part).FindNode(point, self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Nodes[found_id]
                                   )  # note that this is a find!
                self.area_coordinates.append(
                    "dummy")  # needed for looping later
        elif entity_type == "element":
            self.sf_values = KratosMultiphysics.Vector()
            found_id = KratosMultiphysics.BruteForcePointLocator(
                self.model_part).FindElement(point, self.sf_values,
                                             self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Elements[found_id]
                                   )  # note that this is a find!
                self.area_coordinates.append(self.sf_values)
        elif entity_type == "condition":
            self.sf_values = KratosMultiphysics.Vector()
            found_id = KratosMultiphysics.BruteForcePointLocator(
                self.model_part).FindCondition(point, self.sf_values,
                                               self.search_tolerance)
            if found_id > -1:
                self.entity.append(self.model_part.Conditions[found_id]
                                   )  # note that this is a find!
                self.area_coordinates.append(self.sf_values)
        else:
            err_msg = 'Invalid "entity_type" specified, it can only be:\n'
            err_msg += '"node", "element", "condition"'
            raise Exception(err_msg)

        # Check if a point was found, and initalize output
        # NOTE: If the search was not successful (i.e. found_id = -1), we fail silently and
        # do nothing. This is BY DESIGN, as we are supposed to work on MPI too, and the point
        # in question might lie on a different partition.
        # Here we also check if the point has been found in more than one partition
        # In sich a case only one rank (the one with the larger PID) writes the output!
        my_rank = -1  # dummy to indicate that the point is not in my partition
        comm = self.model_part.GetCommunicator().GetDataCommunicator()
        if found_id > -1:  # the point lies in my partition
            my_rank = comm.Rank()
        writing_rank = comm.MaxAll(
            my_rank)  # The partition with the larger rank writes

        if my_rank == writing_rank:

            file_handler_params = KratosMultiphysics.Parameters(
                self.params["output_file_settings"])
            file_header = GetFileHeader(entity_type, found_id, point,
                                        self.output_variables[0])
            self.output_file.append(
                TimeBasedAsciiFileWriterUtility(self.model_part,
                                                file_handler_params,
                                                file_header).file)
예제 #11
0
    def __init__(self, model, params):
        KratosMultiphysics.Process.__init__(self)

        default_settings = KratosMultiphysics.Parameters("""
            {
                "model_part_name"      : "",
                "interval"             : [0.0, 1e30],
                "cfl_output_limit"     : 2.5,
                "print_to_screen"      : false,
                "print_format"         : ".8f",
                "write_output_file"    : true,
                "output_step"          : 8,
                "output_file_settings": {}
            }
            """)

        # Detect "End" as a tag and replace it by a large number
        if (params.Has("interval")):
            if (params["interval"][1].IsString()):
                if (params["interval"][1].GetString() == "End"):
                    params["interval"][1].SetDouble(1e30)
                else:
                    raise Exception(
                        "The second value of interval can be \"End\" or a number, interval currently:"
                        + params["interval"].PrettyPrintJsonString())

        params.ValidateAndAssignDefaults(default_settings)

        # getting the ModelPart from the Model
        self.model_part_name = params["model_part_name"].GetString()
        if self.model_part_name == "":
            raise Exception('No "model_part_name" was specified!')
        else:
            self.model_part = model[self.model_part_name]

        self.interval = params["interval"].GetVector()

        # getting output limit for summarization
        self.cfl_output_limit = params["cfl_output_limit"].GetDouble()

        # TODO: Is it ok to do this check? If not, distribution calculation is going to be messy with if conditions for
        #       case with cfl_output_limit <= 1.0
        if (self.cfl_output_limit <= 1.0):
            raise Exception("Please provide cfl_output_limit greater than 1.0")

        self.format = params["print_format"].GetString()
        self.output_step = params["output_step"].GetInt()
        self.print_to_screen = params["print_to_screen"].GetBool()
        self.write_output_file = params["write_output_file"].GetBool()

        if (self.model_part.GetCommunicator().MyPID() == 0):
            if (self.write_output_file):
                file_handler_params = KratosMultiphysics.Parameters(
                    params["output_file_settings"])

                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part, file_handler_params, file_header).file

        self.distribution_params = KratosMultiphysics.Parameters('''{
            "number_of_value_groups" : 1,
            "min_value"              : "min",
            "max_value"              : "max"
        }''')
        self.distribution_params["min_value"].SetDouble(
            min(self.cfl_output_limit, 1.0))
        self.distribution_params["max_value"].SetDouble(
            max(self.cfl_output_limit, 1.0))
예제 #12
0
    def __init__(self, Model, params):
        KratosMultiphysics.Process.__init__(self)

        default_settings = KratosMultiphysics.Parameters("""
            {
                "model_part_name"       : "",
                "interval"              : [0.0, 1e30],
                "reference_point"       : [0.0,0.0,0.0],
                "z_rotation_angle"      : 0.0,
                "print_to_screen"       : false,
                "print_format"          : ".8f",
                "write_output_file"     : true,
                "output_file_settings"  : {}
            }
            """)

        # Detect 'End' as a tag and replace it by a large number
        if (params.Has('interval')):
            if (params['interval'][1].IsString()):
                if (params['interval'][1].GetString() == 'End'):
                    params['interval'][1].SetDouble(1e30)
                else:
                    raise Exception(
                        'The second value of interval can be \'End\' or a number, interval currently:'
                        + params['interval'].PrettyPrintJsonString())

        params.ValidateAndAssignDefaults(default_settings)

        self.model_part_name = params['model_part_name'].GetString()
        self.model_part = Model[self.model_part_name]
        self.interval = params["interval"].GetVector()
        self.print_to_screen = params['print_to_screen'].GetBool()
        self.write_output_file = params['write_output_file'].GetBool()
        self.format = params["print_format"].GetString()

        # added reference point for moment calculation
        self.reference = params['reference_point'].GetVector()
        if self.reference.Size() != 3:
            raise Exception(
                'The reference point position has to be provided with 3 coordinates!'
            )

        # user inpput expected in degrees, here changing to radians
        self.theta = math.radians(params['z_rotation_angle'].GetDouble())

        if (self.model_part.GetCommunicator().MyPID() == 0):
            if (self.write_output_file):

                output_file_name = params["model_part_name"].GetString(
                ) + "_global_force.dat"

                file_handler_params = KratosMultiphysics.Parameters(
                    params["output_file_settings"])

                if file_handler_params.Has("file_name"):
                    warn_msg = 'Unexpected user-specified entry found in "output_file_settings": {"file_name": '
                    warn_msg += '"' + \
                        file_handler_params["file_name"].GetString() + '"}\n'
                    warn_msg += 'Using this specififed file name instead of the default "' + \
                        output_file_name + '"'
                    KratosMultiphysics.Logger.PrintWarning(
                        "ComputeGlobalForceProcess", warn_msg)
                else:
                    file_handler_params.AddEmptyValue("file_name")
                    file_handler_params["file_name"].SetString(
                        output_file_name)

                file_header = self._GetFileHeader()
                self.output_file = TimeBasedAsciiFileWriterUtility(
                    self.model_part, file_handler_params, file_header).file
예제 #13
0
    def __init__(self, Model, params):
        KratosMultiphysics.Process.__init__(self)

        default_settings = KratosMultiphysics.Parameters("""
            {
                "model_part_name"       : "",
                "interval"              : [0.0, 1e30],
                "rampup_time"           : 0.0,
                "reference_point"       : [0.0,0.0,0.0],
                "z_rotation_angle"      : 0.0,
                "imposed_motion":{
                    "pitch": {"amplitude": [0.1], "frequency" : [1.2]},
                    "heave": {"amplitude": [0.02, 0.03], "frequency" : [0.9, 1.1]}
                },
                "print_to_screen"       : false,
                "print_format"          : ".8f",
                "write_output_file"     : true,
                "output_file_settings"  : {}
            }
            """)

        # Detect 'End' as a tag and replace it by a large number
        if (params.Has('interval')):
            if (params['interval'][1].IsString()):
                if (params['interval'][1].GetString() == 'End'):
                    params['interval'][1].SetDouble(1e30)
                else:
                    raise Exception(
                        'The second value of interval can be \'End\' or a number, interval currently:'
                        + params['interval'].PrettyPrintJsonString())

        params.ValidateAndAssignDefaults(default_settings)

        # modal part params
        self.model_part_name = params['model_part_name'].GetString()
        self.model_part = Model[self.model_part_name]
        self.interval = params["interval"].GetVector()
        self.print_to_screen = params['print_to_screen'].GetBool()
        self.write_output_file = params['write_output_file'].GetBool()
        self.format = params["print_format"].GetString()
        self.rampup_time = params['rampup_time'].GetDouble()

        # added reference point for moment calculation
        reference = params['reference_point'].GetVector()
        if reference.Size() != 3:
            raise Exception(
                'The reference point position has to be provided with 3 coordinates!'
            )
        self.reference_center = reference
        self.updated_center = reference

        # user inpput expected in degrees, here changing to radians
        self.reference_theta = math.radians(
            params['z_rotation_angle'].GetDouble())
        self.updated_theta = self.reference_theta

        self.motion_increment = {"pitch": 0.0, "heave": 0.0}
        self.prescribed_motion = {
            "pitch": {
                "amplitude":
                params['imposed_motion']['pitch']['amplitude'].GetVector(),
                "frequency":
                params['imposed_motion']['pitch']['frequency'].GetVector()
            },
            "heave": {
                "amplitude":
                params['imposed_motion']['heave']['amplitude'].GetVector(),
                "frequency":
                params['imposed_motion']['heave']['frequency'].GetVector()
            }
        }

        self.prescribed_motion['pitch']['amplitude'] = [
            math.radians(a)
            for a in self.prescribed_motion['pitch']['amplitude']
        ]

        if (self.model_part.GetCommunicator().MyPID() == 0):
            if (self.write_output_file):

                # default name as fallback
                output_file_name = params["model_part_name"].GetString()

                file_handler_params = KratosMultiphysics.Parameters(
                    params["output_file_settings"])

                self.output_file = {}
                for case in ['motion', 'force']:
                    case_file_handler_params = file_handler_params.Clone()

                    if file_handler_params.Has("file_name"):
                        output_file_name = file_handler_params[
                            "file_name"].GetString()
                        warn_msg = 'Unexpected user-specified entry found in "output_file_settings": {"file_name": '
                        warn_msg += '"' + \
                            file_handler_params["file_name"].GetString(
                            ) + '"}\n'
                        warn_msg += 'Using this specififed file name instead of the default "' + \
                            output_file_name + '"'
                        KratosMultiphysics.Logger.PrintWarning(
                            "SetMeshMotionAndGetForcesProcess", warn_msg)
                    else:
                        case_file_handler_params.AddEmptyValue("file_name")

                    case_file_handler_params["file_name"].SetString(
                        output_file_name + '_' + case + '.dat')

                    file_header = self._GetFileHeader(case)
                    self.output_file[case] = TimeBasedAsciiFileWriterUtility(
                        self.model_part, case_file_handler_params,
                        file_header).file