diff --git a/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_ibqnls.py b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_ibqnls.py new file mode 100644 index 000000000000..eab85e1a57cc --- /dev/null +++ b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_ibqnls.py @@ -0,0 +1,199 @@ +## @module ibqnls +# This module contains the class IBQNLSConvergenceAccelerator +# Author: Tiba Azzeddine +# Date: Nov. 13, 2023 + +# Importing the Kratos Library +import KratosMultiphysics as KM + +# Importing the base class +from KratosMultiphysics.CoSimulationApplication.base_classes.co_simulation_convergence_accelerator import CoSimulationConvergenceAccelerator + +# CoSimulation imports +import KratosMultiphysics.CoSimulationApplication.co_simulation_tools as cs_tools + +# Other imports +import numpy as np +from copy import deepcopy +from collections import deque +import scipy as sp + + +def Create(settings): + cs_tools.SettingsTypeCheck(settings) + return BLOCKIBQNLSConvergenceAccelerator(settings) + +## Class BLOCKIBQNLSConvergenceAccelerator. +# This class contains the implementation of the IBQNLS method and helper functions. +# Reference: Vierendeels J, Lanoye L, Degroote J, Verdonck PR - Implicit coupling of partitioned fluid–structure interaction +# problems with reduced order models. Comput Struct (2007) +class BLOCKIBQNLSConvergenceAccelerator(CoSimulationConvergenceAccelerator): + def __init__( self, settings): + super().__init__(settings) + + horizon = self.settings["iteration_horizon"].GetInt() + timestep_horizon = self.settings["timestep_horizon"].GetInt() + self.alpha = self.settings["alpha"].GetDouble() + self.gmres_rel_tol = self.settings["gmres_rel_tol"].GetDouble() + self.gmres_abs_tol = self.settings["gmres_abs_tol"].GetDouble() + self.q = timestep_horizon - 1 + + self.X_tilde = {} + self.prevX_tilde = None + self.X = {} + self.v_old_matrices = {} + self.w_old_matrices = {} + self.coupl_data_names = {} + self.V_old = {} + self.W_old = {} + self.W_new = {} + self.V_new = {} + self.previous_V = None + self.previous_Q = None + self.previous_R = None + self.previous_V_is_V_old = False + + for solver_data in settings["solver_sequence"].values(): + self.X_tilde[solver_data["data_name"].GetString()] = deque( maxlen = horizon ) + self.X[solver_data["data_name"].GetString()] = deque( maxlen = horizon ) + self.v_old_matrices[solver_data["data_name"].GetString()] = deque( maxlen = self.q ) + self.w_old_matrices[solver_data["data_name"].GetString()] = deque( maxlen = self.q ) + self.V_old[solver_data["data_name"].GetString()] = None + self.W_old[solver_data["data_name"].GetString()] = None + self.V_new[solver_data["data_name"].GetString()] = None + self.W_new[solver_data["data_name"].GetString()] = None + self.coupl_data_names[solver_data["data_name"].GetString()] = solver_data["coupled_data_name"].GetString() + + ## UpdateSolution(r, x, y, data_name, yResidual) + # @param r residual r_k + # @param x solution x_k + # @param y (coupled solver) solution y_k + # @param data_name coupling variable + # @param yResidual (coupled solver) residual yResidual + # Computes the approximated update in each iteration. + def UpdateSolution( self, r, x, y, data_name, yResidual,): + + coupled_data_name = self.coupl_data_names[data_name] + self.X_tilde[data_name].appendleft( deepcopy(r + x) ) + self.X[coupled_data_name].appendleft( deepcopy(y) ) + + col = len(self.X[coupled_data_name]) - 1 + row = len(r) + rowY = len(y) + k = col + if self.echo_level > 3: + cs_tools.cs_print_info(self._ClassName(), "Number of new modes: ", col ) + + is_first_dt = (self.V_old[data_name] is None and self.W_old [data_name] is None) + is_first_iter = (k == 0) + # ================== First time step ================================================== + if is_first_dt: + # ------------------ First iteration (First time step) --------------------- + if is_first_iter: + return self.alpha * r # Initial acceleration to be a constant relaxation + + # ------------------ First iteration (Other time steps) ------------------------ + if is_first_iter: + V = self.V_old[data_name] + W = self.W_old[data_name] + + else: + ## Construct matrix W(differences of intermediate solutions x) + self.W_new[data_name] = np.empty( shape = (col, rowY) ) # will be transposed later + for i in range(0, col): + self.W_new[data_name][i] = self.X[coupled_data_name][i] - self.X[coupled_data_name][i + 1] + self.W_new[data_name] = self.W_new[data_name].T + W = self._augmented_matrix(self.W_new[data_name], self.W_old[data_name], is_first_dt) + + ## Construct matrix W(differences of intermediate solutions y~) + self.V_new[data_name] = np.empty( shape = (col, row) ) # will be transposed later + for i in range(0, col): + self.V_new[data_name][i] = self.X_tilde[data_name][i] - self.X_tilde[data_name][i + 1] + self.V_new[data_name] = self.V_new[data_name].T + V = self._augmented_matrix(self.V_new[data_name], self.V_old[data_name], is_first_dt) + + Q, R = np.linalg.qr(W) + ##TODO QR Filtering + b = r - self.pinv_product(V, Q, R, yResidual) + + if self.previous_Q is not None: + ## Retrieving previous data for the coupled data jacobian approximation ---------------------------------------- + previous_Q = self.previous_Q + previous_R = self.previous_R + if self.previous_V is not None: + previous_V = self.previous_V + else: + if self.previous_V_is_V_old: + previous_V = self.V_old[coupled_data_name].copy() + self.previous_V_is_V_old = False + else: + previous_V = self._augmented_matrix(self.V_new[coupled_data_name], self.V_old[coupled_data_name], is_first_dt) + + ## Matrix-free implementation of the linear solver (and the pseudoinverse) ------------------------------------- + block_oper = lambda vec: vec - self.pinv_product(V, Q, R, self.pinv_product(previous_V, previous_Q, previous_R, vec)) + block_x = sp.sparse.linalg.LinearOperator((row, row), block_oper) + delta_x, _ = sp.sparse.linalg.gmres( block_x, b, atol=self.gmres_abs_tol, tol=self.gmres_rel_tol ) + else: + ## Using J = 0 if a previous approximate Jacobian is not available + delta_x = b + + ## Saving data for the approximate jacobian for the next iteration + self.previous_Q = Q.copy() + self.previous_R = R.copy() + if is_first_iter: # Indicate that the next iteration V_old is to be used + self.previous_V_is_V_old = True + # Memory is freed + self.previous_V = None + + return delta_x + + def _augmented_matrix(self, mat, old_mat, is_first_dt): + if is_first_dt: + return mat.copy() + else: + return np.hstack( (mat, old_mat) ) + + def pinv_product(self, LHS, Q, R, x): + rhs = Q.T @ x + return LHS @ sp.linalg.solve_triangular(R, rhs, check_finite = False) + + def FinalizeSolutionStep( self ): + + for data_name in self.W_new: + + if data_name == list(self.W_new.keys())[-1]: ## Check if last solver in the sequence + if self.V_new[data_name] is not None: + # Saving the V matrix for the next (first) iteration to recover the approximate jacobian + if self.V_old[data_name] is not None: + self.previous_V = np.hstack((self.V_new[data_name], self.V_old[data_name])) + else: + self.previous_V = self.V_new[data_name].copy() + + if self.V_new[data_name] is not None and self.W_new[data_name] is not None: + self.v_old_matrices[data_name].appendleft( self.V_new[data_name] ) + self.w_old_matrices[data_name].appendleft( self.W_new[data_name] ) + + if self.w_old_matrices[data_name] and self.v_old_matrices[data_name]: + self.V_old[data_name] = np.concatenate( self.v_old_matrices[data_name], 1 ) + self.W_old[data_name] = np.concatenate( self.w_old_matrices[data_name], 1 ) + + ## Clear the buffer + self.X_tilde[data_name].clear() + self.X[data_name].clear() + + for data_name in self.W_new: + self.W_new[data_name] = None + self.V_new[data_name] = None + + @classmethod + def _GetDefaultParameters(cls): + this_defaults = KM.Parameters("""{ + "iteration_horizon" : 15, + "timestep_horizon" : 3, + "alpha" : 1.0, + "gmres_rel_tol" : 1e-5, + "gmres_abs_tol" : 1e-14, + "solver_sequence" : [] + }""") + this_defaults.AddMissingParameters(super()._GetDefaultParameters()) + return this_defaults diff --git a/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_mvqn.py b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_mvqn.py new file mode 100644 index 000000000000..1931e8b7dc12 --- /dev/null +++ b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/block_mvqn.py @@ -0,0 +1,128 @@ +## @module block_mvqn +# This module contains the class MVQNConvergenceAccelerator +# Author: Tiba Azzeddine +# Date: Nov. 06, 2023 + +# Importing the Kratos Library +import KratosMultiphysics as KM + +# Importing the base class +from KratosMultiphysics.CoSimulationApplication.base_classes.co_simulation_convergence_accelerator import CoSimulationConvergenceAccelerator + +# CoSimulation imports +import KratosMultiphysics.CoSimulationApplication.co_simulation_tools as cs_tools + +# Other imports +import numpy as np +from copy import deepcopy +from collections import deque + + +def Create(settings): + cs_tools.SettingsTypeCheck(settings) + return BLOCKMVQNConvergenceAccelerator(settings) + +## Class BLOCKMVQNConvergenceAccelerator. +# This class contains the implementation of the Block MVQN method and helper functions. +# Reference: A.E.J. Bogaers et al. "Quasi-Newton methods for implicit black-box FSI coupling", Computational methods in applied mechanics and engineering. 279(2014) 113-132. +class BLOCKMVQNConvergenceAccelerator(CoSimulationConvergenceAccelerator): + ## The constructor. + # @param horizon Maximum number of vectors to be stored in each time step. + # @param alpha Relaxation factor for computing the update, when no vectors available. + def __init__( self, settings): + super().__init__(settings) + + horizon = self.settings["horizon"].GetInt() + self.alpha = self.settings["alpha"].GetDouble() + self.epsilon = self.settings["epsilon"].GetDouble() + + self.X_tilde = {} + self.X = {} + self.J = {} + self.J_hat = {} + self.coupl_data_names = {} + + for solver_data in settings["solver_sequence"].values(): + self.X_tilde[solver_data["data_name"].GetString()] = deque( maxlen = horizon ) + self.X[solver_data["data_name"].GetString()] = deque( maxlen = horizon ) + self.J[solver_data["data_name"].GetString()] = None # size will be determined when first time get the input vector + self.J_hat[solver_data["data_name"].GetString()] = None + self.coupl_data_names[solver_data["data_name"].GetString()] = solver_data["coupled_data_name"].GetString() + + ## UpdateSolution(r, x, y, data_name, yResidual) + # @param r residual r_k + # @param x solution x_k + # @param y (coupled solver) solution y_k + # @param data_name coupling variable + # @param yResidual (coupled solver) residual yResidual + # Computes the approximated update in each iteration. + def UpdateSolution( self, r, x, y, data_name, yResidual,): + + coupled_data_name = self.coupl_data_names[data_name] + self.X_tilde[data_name].appendleft( deepcopy(r + x) ) + self.X[coupled_data_name].appendleft( deepcopy(y) ) + + col = len(self.X[coupled_data_name]) - 1 + row = len(r) + rowY = len(y) + k = col + if self.echo_level > 3: + cs_tools.cs_print_info(self._ClassName(), "Number of new modes: ", col ) + + ## For the first iteration + if k == 0: + if self.J[data_name] is None or self.J[coupled_data_name] is None: + ## Zero initial Jacobians + self.J_hat[data_name] = np.zeros( (row, rowY) ) + self.J_hat[coupled_data_name] = np.zeros( (rowY, row) ) + self.J[coupled_data_name] = np.zeros( (rowY, row) ) + self.J[data_name] = np.zeros( (row, rowY) ) + return self.alpha * r # Initial acceleration to be a constant relaxation + else: + + blockJacobian = (np.eye(row) - self.J[data_name] @ self.J[coupled_data_name]) + b = r - self.J[data_name] @ yResidual + return np.linalg.solve( blockJacobian, b ) + + ## Construct matrix W(differences of intermediate solutions y) + W = np.empty( shape = (col, rowY) ) # will be transposed later + for i in range(0, col): + W[i] = self.X[coupled_data_name][i] - self.X[coupled_data_name][i + 1] + W = W.T + + ## Construct matrix W(differences of intermediate solutions x~) + V = np.empty( shape = (col, row) ) # will be transposed later + for i in range(0, col): + V[i] = self.X_tilde[data_name][i] - self.X_tilde[data_name][i + 1] + V = V.T + + self.J_hat[data_name] = self.J[data_name] + (V - self.J[data_name] @ W) @ (np.linalg.pinv(W, rcond=self.epsilon)) + + blockJacobian = (np.eye(row) - self.J_hat[data_name] @ self.J_hat[coupled_data_name]) + b = r - self.J_hat[data_name] @ yResidual + + return np.linalg.solve( blockJacobian, b ) + + def FinalizeSolutionStep( self ): + + ## Assign J=J_hat + for data_name in self.J: + self.J[data_name] = self.J_hat[data_name].copy() + + ## Clear the buffer + self.X_tilde[data_name].clear() + self.X[data_name].clear() + + if self.echo_level > 3: + cs_tools.cs_print_info(self._ClassName(), "Jacobian matrix updated!") + + @classmethod + def _GetDefaultParameters(cls): + this_defaults = KM.Parameters("""{ + "horizon" : 15, + "alpha" : 1.0, + "epsilon" : 1e-9, + "solver_sequence" : [] + }""") + this_defaults.AddMissingParameters(super()._GetDefaultParameters()) + return this_defaults diff --git a/applications/CoSimulationApplication/python_scripts/convergence_accelerators/convergence_accelerator_wrapper.py b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/convergence_accelerator_wrapper.py index f442ba891455..70242cc1ee84 100644 --- a/applications/CoSimulationApplication/python_scripts/convergence_accelerators/convergence_accelerator_wrapper.py +++ b/applications/CoSimulationApplication/python_scripts/convergence_accelerators/convergence_accelerator_wrapper.py @@ -91,17 +91,150 @@ def PrintInfo(self): def Check(self): self.conv_acc.Check() +class BlockConvergenceAcceleratorWrapper: + """Similar class for wrapping convergence accelerators for block coupling solvers + """ + def __init__(self, + settings: KratosMultiphysics.Parameters, + interface_data_dict: "dict[str,CouplingInterfaceData]", + parent_coupled_solver_data_communicator: KratosMultiphysics.DataCommunicator): + self.interface_data_dict = interface_data_dict + self.current_solver_id = None + self.coupl_data_names = {} + self.input_data = {} + self.is_block_accelerator = True + for solverData in settings["solver_sequence"].values(): + self.coupl_data_names[solverData["data_name"].GetString()] = solverData["coupled_data_name"].GetString() + self.residual_computation = CreateBlockResidualComputation(settings, interface_data_dict) + + # Remove extra entries from accelerator parameters + for key in ("data_name", "solver", "residual_computation"): + if settings.Has(key): + settings.RemoveValue(key) + + self.conv_acc = CreateConvergenceAccelerator(settings) + self.data_communicator = parent_coupled_solver_data_communicator + + self.executing_rank = {} + self.gather_scatter_required = {} + self.data_comm = {} + self.sizes_from_ranks = {} + for data_name in interface_data_dict: + if self.interface_data_dict[data_name].IsDefinedOnThisRank(): + conv_acc_supports_dist_data = self.conv_acc.SupportsDistributedData() + self.executing_rank[data_name] = conv_acc_supports_dist_data or (self.interface_data_dict[data_name].GetModelPart().GetCommunicator().MyPID() == 0) + self.gather_scatter_required[data_name] = self.interface_data_dict[data_name].IsDistributed() and not conv_acc_supports_dist_data + if self.gather_scatter_required[data_name]: + self.data_comm[data_name] = self.interface_data_dict[data_name].GetModelPart().GetCommunicator().GetDataCommunicator() + self.sizes_from_ranks[data_name] = np.cumsum(self.data_comm[data_name].GatherInts([self.interface_data_dict[data_name].Size()], 0)) + + def Initialize(self): + self.conv_acc.Initialize() + self.current_solver_id = 0 + self.prev_input_data = {} + self.output_data = {} + for data_name in self.interface_data_dict: + if self.interface_data_dict[data_name].IsDefinedOnThisRank(): + self.prev_input_data[data_name] = self.interface_data_dict[data_name].GetData() + self.output_data[data_name] = self.interface_data_dict[data_name].GetData() + + def Finalize(self): + self.conv_acc.Finalize() + + def InitializeSolutionStep(self): + self.conv_acc.InitializeSolutionStep() + + def FinalizeSolutionStep(self): + self.conv_acc.FinalizeSolutionStep() + + def InitializeNonLinearIteration(self): + # Saving the previous data for the computation of the residual + # and the computation of the solution update + for data_name in self.interface_data_dict: + interface_data = self.interface_data_dict[data_name] + if interface_data.IsDefinedOnThisRank(): + self.input_data[data_name] = interface_data.GetData() + + self.conv_acc.InitializeNonLinearIteration() + + def FinalizeNonLinearIteration(self): + self.conv_acc.FinalizeNonLinearIteration() + self.current_solver_id = 0 + + def ComputeAndApplyUpdate(self): + # Retrieving solver and data names + solver_id = self.current_solver_id + data_name, interface_data = list(self.interface_data_dict.items())[solver_id] + interface_data = self.interface_data_dict[data_name] + coupled_data_name = self.coupl_data_names[data_name] + + if not interface_data.IsDefinedOnThisRank(): return + + # Data Comm + executing_rank = self.executing_rank[data_name] + gather_scatter_required = self.gather_scatter_required[data_name] + + # Retrieving data + input_data = self.input_data[data_name] + self.prev_input_data[data_name] = interface_data.GetData() + prev_input_data = self.prev_input_data[coupled_data_name] + + residual = self.residual_computation.ComputeResidual(input_data, data_name) # = x~ - x + yResidual = self.residual_computation.ComputeResidual(prev_input_data, coupled_data_name) # = y - y~ + + input_data_for_acc = input_data + input_other_solver = self.output_data[coupled_data_name] + + if gather_scatter_required: + residual = np.array(np.concatenate(self.data_comm[data_name].GathervDoubles(residual, 0))) + yResidual = np.array(np.concatenate(self.data_comm[coupled_data_name].GathervDoubles(yResidual, 0))) + input_data_for_acc = np.array(np.concatenate(self.data_comm[data_name].GathervDoubles(input_data_for_acc, 0))) + input_other_solver = np.array(np.concatenate(self.data_comm[coupled_data_name].GathervDoubles(input_other_solver, 0))) + + if executing_rank: + updated_data = input_data_for_acc + self.conv_acc.UpdateSolution(residual, input_data_for_acc, input_other_solver, data_name, yResidual) + + if gather_scatter_required: + if executing_rank: + data_to_scatter = np.split(updated_data, self.sizes_from_ranks[data_name][:-1]) + else: + data_to_scatter = [] + + updated_data = self.data_comm[data_name].ScattervDoubles(data_to_scatter, 0) + + interface_data.SetData(updated_data) + self.output_data[data_name] = updated_data + self.current_solver_id += 1 + + def PrintInfo(self): + self.conv_acc.PrintInfo() + + def Check(self): + self.conv_acc.Check() + class ConvergenceAcceleratorResidual(metaclass=ABCMeta): @abstractmethod - def ComputeResidual(self, input_data): pass + def ComputeResidual(self, input_data, data_name=None): pass + +class DataDifferenceBlockResidual(ConvergenceAcceleratorResidual): + def __init__(self, + settings: KratosMultiphysics.Parameters, + interface_data_dict: "dict[str,CouplingInterfaceData]"): + + self.interface_data_dict = interface_data_dict + self.is_block_residual_computer = True + + def ComputeResidual(self, input_data, data_name=None): + return self.interface_data_dict[data_name].GetData() - input_data class DataDifferenceResidual(ConvergenceAcceleratorResidual): def __init__(self, settings: KratosMultiphysics.Parameters, interface_data_dict: "dict[str,CouplingInterfaceData]"): + self.is_block_residual_computer = False self.interface_data = interface_data_dict[settings["data_name"].GetString()] - def ComputeResidual(self, input_data): + def ComputeResidual(self, input_data, data_name=None): return self.interface_data.GetData() - input_data class DifferentDataDifferenceResidual(ConvergenceAcceleratorResidual): @@ -115,6 +248,17 @@ def __init__(self, def ComputeResidual(self, input_data): return self.interface_data1.GetData() - self.interface_data2.GetData() +def CreateBlockResidualComputation(settings: KratosMultiphysics.Parameters, + interface_data_dict: "dict[str,CouplingInterfaceData]"): + residual_computation_type = "data_difference" + if settings.Has("residual_computation"): + residual_computation_type = settings["residual_computation"]["type"].GetString() + + if residual_computation_type == "data_difference": + return DataDifferenceBlockResidual(settings, interface_data_dict) + else: + raise Exception(f'The specified residual computation "{residual_computation_type}" is not available!') + def CreateResidualComputation(settings: KratosMultiphysics.Parameters, interface_data_dict: "dict[str,CouplingInterfaceData]"): residual_computation_type = "data_difference" @@ -126,4 +270,4 @@ def CreateResidualComputation(settings: KratosMultiphysics.Parameters, elif residual_computation_type == "different_data_difference": return DifferentDataDifferenceResidual(settings, interface_data_dict) else: - raise Exception('The specified residual computation "{}" is not available!'.format(residual_computation_type)) + raise Exception(f'The specified residual computation "{residual_computation_type}" is not available!') diff --git a/applications/CoSimulationApplication/python_scripts/coupled_solvers/block_strong.py b/applications/CoSimulationApplication/python_scripts/coupled_solvers/block_strong.py new file mode 100644 index 000000000000..0ce57bbc5937 --- /dev/null +++ b/applications/CoSimulationApplication/python_scripts/coupled_solvers/block_strong.py @@ -0,0 +1,86 @@ +# Importing the Kratos Library +import KratosMultiphysics as KM +import KratosMultiphysics.CoSimulationApplication as KratosCoSim + +# Importing the base class +from KratosMultiphysics.CoSimulationApplication.coupled_solvers.gauss_seidel_strong import GaussSeidelStrongCoupledSolver + +# CoSimulation imports +import KratosMultiphysics.CoSimulationApplication.co_simulation_tools as cs_tools +import KratosMultiphysics.CoSimulationApplication.colors as colors + +def Create(settings, models, solver_name): + return BlockStrongCoupledSolver(settings, models, solver_name) + +class BlockStrongCoupledSolver(GaussSeidelStrongCoupledSolver): + def SolveSolutionStep(self): + for k in range(self.num_coupling_iterations): + self.process_info[KratosCoSim.COUPLING_ITERATION_NUMBER] += 1 + + if self.echo_level > 0: + cs_tools.cs_print_info(self._ClassName(), colors.cyan("Coupling iteration:"), colors.bold(str(k+1)+" / " + str(self.num_coupling_iterations))) + + for coupling_op in self.coupling_operations_dict.values(): + coupling_op.InitializeCouplingIteration() + + for conv_acc in self.convergence_accelerators_list: + conv_acc.InitializeNonLinearIteration() + + for conv_crit in self.convergence_criteria_list: + conv_crit.InitializeNonLinearIteration() + + for solver_name, solver in self.solver_wrappers.items(): + self._SynchronizeInputData(solver_name) + solver.SolveSolutionStep() + self._SynchronizeOutputData(solver_name) + + # Apply relaxation for each solver output + for conv_acc in self.convergence_accelerators_list: + conv_acc.ComputeAndApplyUpdate() + + for coupling_op in self.coupling_operations_dict.values(): + coupling_op.FinalizeCouplingIteration() + + for conv_acc in self.convergence_accelerators_list: + conv_acc.FinalizeNonLinearIteration() + + for conv_crit in self.convergence_criteria_list: + conv_crit.FinalizeNonLinearIteration() + + is_converged = all([conv_crit.IsConverged() for conv_crit in self.convergence_criteria_list]) + + if is_converged: + if self.echo_level > 0: + cs_tools.cs_print_info(self._ClassName(), colors.green("### CONVERGENCE WAS ACHIEVED ###")) + self.__CommunicateIfTimeStepNeedsToBeRepeated(False) + return True + + if k+1 >= self.num_coupling_iterations: + if self.echo_level > 0: + cs_tools.cs_print_info(self._ClassName(), colors.red("XXX CONVERGENCE WAS NOT ACHIEVED XXX")) + self.__CommunicateIfTimeStepNeedsToBeRepeated(False) + return False + + # if it reaches here it means that the coupling has not converged and this was not the last coupling iteration + self.__CommunicateIfTimeStepNeedsToBeRepeated(True) + + @classmethod + def _GetDefaultParameters(cls): + this_defaults = KM.Parameters("""{ + "convergence_accelerators" : [], + "convergence_criteria" : [], + "num_coupling_iterations" : 10 + }""") + this_defaults.AddMissingParameters(super()._GetDefaultParameters()) + + return this_defaults + + def __CommunicateIfTimeStepNeedsToBeRepeated(self, repeat_time_step): + # Communicate if the time step needs to be repeated with external solvers through IO + export_config = { + "type" : "repeat_time_step", + "repeat_time_step" : repeat_time_step + } + + for solver in self.solver_wrappers.values(): + solver.ExportData(export_config) diff --git a/applications/CoSimulationApplication/python_scripts/factories/helpers.py b/applications/CoSimulationApplication/python_scripts/factories/helpers.py index d9c62857a6aa..4ee511fd8417 100644 --- a/applications/CoSimulationApplication/python_scripts/factories/helpers.py +++ b/applications/CoSimulationApplication/python_scripts/factories/helpers.py @@ -4,7 +4,7 @@ # CoSimulation imports from KratosMultiphysics.CoSimulationApplication.factories.coupling_operation_factory import CreateCouplingOperation from KratosMultiphysics.CoSimulationApplication.factories.data_transfer_operator_factory import CreateDataTransferOperator -from KratosMultiphysics.CoSimulationApplication.convergence_accelerators.convergence_accelerator_wrapper import ConvergenceAcceleratorWrapper +from KratosMultiphysics.CoSimulationApplication.convergence_accelerators.convergence_accelerator_wrapper import ConvergenceAcceleratorWrapper, BlockConvergenceAcceleratorWrapper from KratosMultiphysics.CoSimulationApplication.convergence_criteria.convergence_criteria_wrapper import ConvergenceCriteriaWrapper from KratosMultiphysics.CoSimulationApplication.factories.convergence_criterion_factory import CreateConvergenceCriterion from KratosMultiphysics.CoSimulationApplication.factories.predictor_factory import CreatePredictor @@ -34,12 +34,22 @@ def CreateConvergenceAccelerators(convergence_accelerator_settings_list: KM.Para parent_echo_level: int): convergence_accelerators = [] for conv_acc_settings in convergence_accelerator_settings_list.values(): - solver = solvers[conv_acc_settings["solver"].GetString()] - interface_data_dict = solver.data_dict AddEchoLevelToSettings(conv_acc_settings, parent_echo_level) - convergence_accelerators.append(ConvergenceAcceleratorWrapper(conv_acc_settings, - interface_data_dict, - parent_data_communicator)) + if conv_acc_settings["type"].GetString().startswith('block_'): + interface_data_dict = {} + for sequence_data in conv_acc_settings["solver_sequence"].values(): + solver = solvers[sequence_data["solver"].GetString()] + data_name = sequence_data["data_name"].GetString() + interface_data_dict[data_name] = solver.data_dict[data_name] + convergence_accelerators.append(BlockConvergenceAcceleratorWrapper(conv_acc_settings, + interface_data_dict, + parent_data_communicator)) + else: + solver = solvers[conv_acc_settings["solver"].GetString()] + interface_data_dict = solver.data_dict + convergence_accelerators.append(ConvergenceAcceleratorWrapper(conv_acc_settings, + interface_data_dict, + parent_data_communicator)) return convergence_accelerators diff --git a/applications/CoSimulationApplication/tests/fsi_mok/cosim_mok_fsi_block_parameters.json b/applications/CoSimulationApplication/tests/fsi_mok/cosim_mok_fsi_block_parameters.json new file mode 100644 index 000000000000..ed930d057973 --- /dev/null +++ b/applications/CoSimulationApplication/tests/fsi_mok/cosim_mok_fsi_block_parameters.json @@ -0,0 +1,132 @@ +{ + "problem_data" : + { + "start_time" : 0.0, + "end_time" : 15.0, + "echo_level" : 0, + "print_colors" : true, + "parallel_type" : "OpenMP" + }, + "solver_settings" : + { + "type" : "coupled_solvers.block_strong", + "echo_level" : 0, + "num_coupling_iterations" : 12, + "predictors" : [ + { + "type" : "linear", + "solver" : "structure", + "data_name" : "load" + } + ], + "convergence_accelerators" : [ + { + "type" : "block_mvqn", + "solver_sequence" : + [ + { + "solver": "fluid", + "data_name" : "disp", + "coupled_data_name" : "load" + }, + { + "solver": "structure", + "data_name" : "load", + "coupled_data_name" : "disp" + } + ] + } + ], + "convergence_criteria" : [ + { + "type" : "relative_norm_previous_residual", + "solver" : "structure", + "data_name" : "load", + "abs_tolerance" : 1e-5, + "rel_tolerance" : 1e-5 + } + ], + "data_transfer_operators" : { + "mapper" : { + "type" : "kratos_mapping", + "mapper_settings" : { + "mapper_type" : "nearest_neighbor" + } + } + }, + "coupling_sequence": + [ + { + "name": "structure", + "input_data_list": [], + "output_data_list": [ + { + "data" : "disp", + "to_solver" : "fluid", + "to_solver_data" : "disp", + "data_transfer_operator" : "mapper" + } + ] + }, + { + "name": "fluid", + "input_data_list" : [], + "output_data_list" : [ + { + "data" : "load", + "to_solver" : "structure", + "to_solver_data" : "load", + "data_transfer_operator" : "mapper", + "data_transfer_operator_options" : ["swap_sign"] + } + ] + } + ], + "solvers" : + { + "fluid": + { + "type" : "solver_wrappers.kratos.fluid_dynamics_wrapper", + "solver_wrapper_settings" : { + "input_file" : "fsi_mok/ProjectParametersCFD" + }, + "data" : { + "disp" : { + "model_part_name" : "FluidModelPart.NoSlip2D_FSI", + "dimension" : 2, + "variable_name" : "MESH_DISPLACEMENT" + }, + "load" : { + "model_part_name" : "FluidModelPart.NoSlip2D_FSI", + "dimension" : 2, + "variable_name" : "REACTION" + }, + "velocity" : { + "model_part_name" : "FluidModelPart.NoSlip2D_FSI", + "dimension" : 2, + "variable_name" : "VELOCITY" + } + } + }, + "structure" : + { + "type" : "solver_wrappers.kratos.structural_mechanics_wrapper", + "solver_wrapper_settings" : { + "input_file" : "fsi_mok/ProjectParametersCSM" + }, + "data" : { + "disp" : { + "model_part_name" : "Structure.GENERIC_FSI", + "dimension" : 2, + "variable_name" : "DISPLACEMENT" + }, + "load" : { + "model_part_name" : "Structure.GENERIC_FSI", + "dimension" : 2, + "variable_name" : "POINT_LOAD" + } + } + } + } + } +} diff --git a/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_ibqnls.dat b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_ibqnls.dat new file mode 100644 index 000000000000..abbd11a070d3 --- /dev/null +++ b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_ibqnls.dat @@ -0,0 +1,153 @@ +# Results for "node" with Id # 111 for search config "initial" at position: x0: 0.5; y0: 0.25; z0: 0 +# time MESH_DISPLACEMENT_X MESH_DISPLACEMENT_Y MESH_VELOCITY_X MESH_VELOCITY_Y +0.1 5.835438530441426e-07 -9.534621861356258e-09 1.104935106355773e-05 -1.8053721867656817e-07 +0.2 3.848086274752641e-06 -3.144967112624091e-08 5.2676857623284023e-05 -2.656691203407128e-07 +0.30000000000000004 1.3653157606263867e-05 -1.1361002032783369e-07 0.00014117902904527035 -1.32098848070913e-06 +0.4 3.460844025744067e-05 -3.3558335915665154e-07 0.00027588882981771976 -3.092338894838668e-06 +0.5 7.108285060058229e-05 -7.844780090559476e-07 0.00045179171460918 -5.83732210843442e-06 +0.6 0.00012630008879806082 -1.5138074916016102e-06 0.0006516570756597966 -8.751791920020111e-06 +0.7 0.000202650582660208 -2.5658176091212078e-06 0.0008742957936740892 -1.225468076533903e-05 +0.7999999999999999 0.0003018285604866585 -3.972577338296749e-06 0.001108857354901451 -1.5881949846181796e-05 +0.8999999999999999 0.00042561886855409215 -5.786452761555774e-06 0.0013657919265967673 -2.0348017208654534e-05 +0.9999999999999999 0.0005757224275679752 -8.074794729188334e-06 0.0016358313270271611 -2.539786958930995e-05 +1.0999999999999999 0.0007540375026760552 -1.0935395993859173e-05 0.0019292661635193944 -3.174634622825001e-05 +1.2 0.0009617824438701244 -1.4465193634351525e-05 0.0022257615096013253 -3.882546057925738e-05 +1.3 0.001199466566149829 -1.87595880460383e-05 0.0025275888017184476 -4.700648188865356e-05 +1.4000000000000001 0.0014671074594170914 -2.391443458159513e-05 0.0028255306532294676 -5.605560456220533e-05 +1.5000000000000002 0.001763575925353348 -3.000289743837498e-05 0.00310481287241339 -6.568947175902696e-05 +1.6000000000000003 0.002088413376481558 -3.713741698722648e-05 0.003391287997466243 -7.691730389383246e-05 +1.7000000000000004 0.002440260405944627 -4.54064084537047e-05 0.003647516028977957 -8.846541365054231e-05 +1.8000000000000005 0.0028181659046152283 -5.492519088039041e-05 0.0039097881074943415 -0.0001018085429785818 +1.9000000000000006 0.0032200465274615404 -6.577277344096775e-05 0.00413037083467922 -0.00011516763339773688 +2.0000000000000004 0.0036439987343788696 -7.802211616511528e-05 0.0043481920191341065 -0.0001297445850970142 +2.1000000000000005 0.004087241828630625 -9.172086693163619e-05 0.004519411531111189 -0.00014425294738484743 +2.2000000000000006 0.004547395653995424 -0.00010688477721916793 0.004683387035319234 -0.00015900587242320902 +2.3000000000000007 0.005020693969152005 -0.00012349627431544518 0.004786095049351167 -0.00017325713452799382 +2.400000000000001 0.005505820358335568 -0.00014159768543626328 0.004914129194083483 -0.00018869601793377238 +2.500000000000001 0.005997766763527854 -0.00016104707890617426 0.004931594303081433 -0.0002005142789618417 +2.600000000000001 0.0064954664620252185 -0.00018186683433479104 0.005016885595706999 -0.00021563922187983655 +2.700000000000001 0.006993860444092298 -0.00020385201737170664 0.004960350308537749 -0.00022447841425895116 +2.800000000000001 0.007491546792108098 -0.00022695254216378554 0.00498639259740064 -0.0002372096597452293 +2.9000000000000012 0.00798354540976535 -0.0002509063364532366 0.004863692527044845 -0.00024237255140583468 +3.0000000000000013 0.008468572877617138 -0.0002756051282163978 0.004829358071341578 -0.0002512668129603456 +3.1000000000000014 0.00894231823960879 -0.0003007847524000711 0.004655284200268363 -0.00025282257882020464 +3.2000000000000015 0.009403467012129216 -0.0003262738151972907 0.004560781607775764 -0.0002567036515840662 +3.3000000000000016 0.009848339149532445 -0.00035181062523409733 0.004345199285670597 -0.00025444184263353077 +3.4000000000000017 0.010275998013396645 -0.00037719942784023925 0.004201784056301535 -0.00025317587030874246 +3.5000000000000018 0.010683611897353605 -0.0004022137256053271 0.003957704476383989 -0.00024740317306485416 +3.600000000000002 0.01107004107990515 -0.00042659876858387237 0.0037661234193482043 -0.0002402992934939837 +3.700000000000002 0.011433530972155916 -0.00045020769426307194 0.003508574080352052 -0.0002319489329005437 +3.800000000000002 0.011773583931624455 -0.000472790497395517 0.003289117478862742 -0.00021989786626082562 +3.900000000000002 0.012089439509095485 -0.0004942877122504064 0.0030310100851589097 -0.0002098841459763617 +4.000000000000002 0.012380905339543844 -0.000514501896467188 0.0027962398073868577 -0.0001947292980067143 +4.100000000000001 0.01264813386854728 -0.0005334132208947525 0.0025495196334466962 -0.00018321023758324404 +4.200000000000001 0.012891356712051829 -0.0005508783860685574 0.002314009458982565 -0.00016645910802217816 +4.300000000000001 0.013111466103362576 -0.0005669456424848622 0.00208788250546934 -0.0001545236294059412 +4.4 0.013309434991707446 -0.0005815500315065249 0.0018710466051279166 -0.00013791747430412293 +4.5 0.01348681572884238 -0.0005948121622211367 0.0016754836958959131 -0.0001269212505316363 +4.6 0.013645196428380286 -0.0006067497147237113 0.001491736756952225 -0.00011214348368206131 +4.699999999999999 0.013786510006717158 -0.0006174906123445872 0.0013332143162373541 -0.00010231750936495519 +4.799999999999999 0.01391263818594907 -0.0006271718267509415 0.0011888812400340837 -9.145435971711147e-05 +4.899999999999999 0.014026031056097305 -0.0006359178867836745 0.0010772534951363896 -8.327877042859279e-05 +4.999999999999998 0.014128573839239206 -0.0006438599100079569 0.0009735851200957358 -7.558178993933547e-05 +5.099999999999998 0.014223456173193866 -0.0006512469648989938 0.0009211821423037116 -7.19269154484257e-05 +5.1999999999999975 0.014312200469915869 -0.0006581846564955021 0.0008551881413619637 -6.695887989949852e-05 +5.299999999999997 0.01439837600923542 -0.0006649494902144035 0.000863757375736151 -6.796855727224737e-05 +5.399999999999997 0.014482856474272028 -0.0006716064236409593 0.0008294074453377028 -6.546030415074059e-05 +5.4999999999999964 0.014569173472901643 -0.000678422608262752 0.0008906656874646137 -7.03733897586192e-05 +5.599999999999996 0.01465812116379884 -0.0006854918945479708 0.0008931602948793986 -7.135592882058861e-05 +5.699999999999996 0.014753055138565795 -0.0006930581591891874 0.0009985152640130076 -7.948166116301014e-05 +5.799999999999995 0.014854430487627045 -0.0007012148633796086 0.001034637066923701 -8.397847502038167e-05 +5.899999999999995 0.014964504608441143 -0.0007100864997899035 0.001160392140457778 -9.311192908037817e-05 +5.999999999999995 0.015083659643684851 -0.0007197954003026959 0.0012276143407607678 -0.00010120990769552715 +6.099999999999994 0.015213521967601413 -0.0007304072501015618 0.001364487809627662 -0.00011090149136734044 +6.199999999999994 0.015354712063064145 -0.0007420999612184473 0.0014627708909141026 -0.00012285679590052942 +6.299999999999994 0.015507081435305544 -0.000754756937028848 0.0015825435664174054 -0.00013054663642541432 +6.399999999999993 0.015671645901813937 -0.0007686271447629952 0.0017088940111078179 -0.00014633594419550576 +6.499999999999993 0.015847135853192446 -0.0007834854617115362 0.0018026986558690376 -0.00015155534552793875 +6.5999999999999925 0.016034496174097326 -0.0007995836403617717 0.00194152678157383 -0.00016951059815338497 +6.699999999999992 0.016231643425362364 -0.0008166342537975286 0.002006327528923131 -0.00017256429064985504 +6.799999999999992 0.016439301451700215 -0.0008348569107809414 0.0021416394244498853 -0.00019077084548956922 +6.8999999999999915 0.016654861582799545 -0.0008539279275565549 0.0021765113397693822 -0.00019189014880324998 +6.999999999999991 0.016878844763595552 -0.0008740298655739395 0.0022966206378143045 -0.00020894222819491952 +7.099999999999991 0.017108342668050062 -0.0008948325300266458 0.0023014545985818786 -0.0002084022120694288 +7.19999999999999 0.017343362616500147 -0.0009164221781154874 0.0023920888189886474 -0.00022225818738622147 +7.29999999999999 0.017580981974905815 -0.0009384936765373827 0.002368440622909836 -0.00022034210015055885 +7.39999999999999 0.017820848589482997 -0.0009610469471339926 0.002422485845393419 -0.0002297914274398902 +7.499999999999989 0.018060284204672105 -0.000983831857604517 0.0023736168395426605 -0.000226837439535675 +7.599999999999989 0.018298565176121967 -0.0010067571047083503 0.0023866717726024026 -0.00023103269330555616 +7.699999999999989 0.018533250046908974 -0.0010296193866352042 0.0023132241179117685 -0.00022684328479372746 +7.799999999999988 0.01876360024332009 -0.0010522829195014785 0.002289436797797188 -0.0002260772243143826 +7.899999999999988 0.018987259957351073 -0.0010745620154254095 0.002189146526930604 -0.00021989678976028738 +7.999999999999988 0.019203443135194342 -0.001096279227386088 0.0021308098776912352 -0.00021431571174875243 +8.099999999999987 0.019409998425413334 -0.0011172730476011316 0.0020050171208046627 -0.00020576089952754849 +8.199999999999987 0.019606175211945596 -0.0011373479659742408 0.001915308574468143 -0.00019576829216734964 +8.299999999999986 0.019790554894367256 -0.001156438422216452 0.001775884103565038 -0.00018601941669973862 +8.399999999999986 0.019962042511955453 -0.001174284419855873 0.0016520893208389657 -0.0001711915815642829 +8.499999999999986 0.020119518692742203 -0.0011908381288815613 0.0014994987876969373 -0.00015962631793344924 +8.599999999999985 0.020262282237376708 -0.0012059086915967802 0.0013548114282713943 -0.0001421798257320334 +8.699999999999985 0.020389308899904958 -0.001219447292112046 0.0011872487293222572 -0.0001282932186926431 +8.799999999999985 0.02050001234732325 -0.0012312668878076232 0.0010260788937230282 -0.00010850538091792432 +8.899999999999984 0.02059360738910178 -0.0012413424538049124 0.0008470138771097083 -9.268130594547703e-05 +8.999999999999984 0.020669821167556692 -0.0012495599082095225 0.0006764836275275219 -7.202097955934154e-05 +9.099999999999984 0.020727942286904145 -0.0012558688859240887 0.0004871887839490989 -5.3925975971429246e-05 +9.199999999999983 0.020767982601020196 -0.0012602305931110301 0.00031248428533574594 -3.349757127016406e-05 +9.299999999999983 0.02078919556753795 -0.0012625601275260277 0.00011342812902392437 -1.3047012330033735e-05 +9.399999999999983 0.020791723065806893 -0.0012628711019497753 -6.448095733128582e-05 6.84728726812998e-06 +9.499999999999982 0.02077505912997161 -0.0012610906004588143 -0.00026701207186766076 2.86504293103504e-05 +9.599999999999982 0.020739475100666288 -0.0012572866000545005 -0.0004464158488526957 4.7617202816277006e-05 +9.699999999999982 0.02068441635802303 -0.0012513558463175727 -0.0006528042833726721 7.07184043363937e-05 +9.799999999999981 0.020610316243659586 -0.0012434293254375423 -0.0008312580113018782 8.819809040484287e-05 +9.89999999999998 0.02051684482261404 -0.0012334230730289778 -0.0010361672833982412 0.00011150278192465074 +9.99999999999998 0.020404071709208684 -0.0012214277392330385 -0.0012209290627295964 0.0001288453096670644 +10.09999999999998 0.020272481281045144 -0.001207447084274057 -0.0014102164174219752 0.0001504194096554941 +10.19999999999998 0.020124377284187114 -0.0011917774624281162 -0.0015545575173490024 0.00016353586475272263 +10.29999999999998 0.019963128508600943 -0.001174724609470543 -0.0016712970813667347 0.0001773417069992435 +10.399999999999979 0.01979346418132679 -0.0011569351276724768 -0.0017252987017004682 0.00017916672232618498 +10.499999999999979 0.01961921207689793 -0.0011388095837446504 -0.0017600016289658258 0.00018304875089449047 +10.599999999999978 0.019443624539319405 -0.0011207573029418105 -0.0017539755676879716 0.00017854255416904563 +10.699999999999978 0.019268404555976424 -0.0011028803261926888 -0.0017497653468746999 0.00017860364844298973 +10.799999999999978 0.019095825428446647 -0.0010854245673571255 -0.0017043023598921243 0.00017103881953960392 +10.899999999999977 0.018927029743336814 -0.0010684466019034986 -0.0016703429756098368 0.0001681269384032092 +10.999999999999977 0.018764542532241683 -0.0010522236236879376 -0.0015827360141809532 0.00015689880299332772 +11.099999999999977 0.018608949432903 -0.0010367798568558292 -0.0015265261915625664 0.00015150671188552122 +11.199999999999976 0.018462731134455568 -0.0010223821741646721 -0.001402314810316456 0.00013707298915711003 +11.299999999999976 0.018325914537340317 -0.0010090212889408024 -0.001329980299778646 0.00012959684000191907 +11.399999999999975 0.018199655407636534 -0.0009967638577662306 -0.001199483150763827 0.00011603128158981183 +11.499999999999975 0.018083582970301493 -0.0009855883509099403 -0.0011181309769644392 0.00010709839331566001 +11.599999999999975 0.01797755642956446 -0.0009753843744647461 -0.0010051382723762538 9.713425874735421e-05 +11.699999999999974 0.0178819139668624 -0.000966269792996631 -0.0009062339040975541 8.522831650673463e-05 +11.799999999999974 0.01779585143898324 -0.0009580410406582428 -0.0008149568845134042 7.900911464194313e-05 +11.899999999999974 0.01771995359006103 -0.0009508853746268549 -0.0007041155300128752 6.464666744075963e-05 +11.999999999999973 0.01765269304046935 -0.0009445035678853304 -0.0006382847575600365 6.218446335097774e-05 +12.099999999999973 0.017594385859302935 -0.0009390648281528339 -0.0005308990092267347 4.748019824102479e-05 +12.199999999999973 0.0175429894424598 -0.0009342080697148595 -0.0004923947102453141 4.854546747604177e-05 +12.299999999999972 0.01749920313699618 -0.000930158494020778 -0.00038818593042210745 3.362274660941168e-05 +12.399999999999972 0.01746080652206361 -0.0009265456272976242 -0.0003734972308655375 3.729447503028678e-05 +12.499999999999972 0.017428131149962132 -0.0009235394430661124 -0.00028568565717498857 2.4112271479216513e-05 +12.599999999999971 0.017399349320252777 -0.000920843322745554 -0.00028370413510568165 2.8501004291685382e-05 +12.69999999999997 0.01737449113730867 -0.0009185650460847292 -0.00021857336921785937 1.8217144896553992e-05 +12.79999999999997 0.01735222373779923 -0.0009165014753406115 -0.00022165898797432747 2.19762019430245e-05 +12.89999999999997 0.01733207896399526 -0.0009146604583959194 -0.00018476428921455069 1.5679301566552332e-05 +12.99999999999997 0.017313191906626148 -0.0009129323872501448 -0.0001897397134706791 1.8178546993560304e-05 +13.09999999999997 0.017294940160413694 -0.0009112628079479213 -0.000177095596165465 1.5670587894354736e-05 +13.199999999999969 0.017276615753742938 -0.0009095993474000655 -0.0001876381884864195 1.7254091097398113e-05 +13.299999999999969 0.01725767626748867 -0.0009078539372767209 -0.00019194110552442887 1.7798683115015256e-05 +13.399999999999968 0.01723787842507408 -0.0009060703844843661 -0.00020341498395749094 1.7863232210092404e-05 +13.499999999999968 0.017216725860659216 -0.000904120330136493 -0.00021952567342177476 2.096906752784164e-05 +13.599999999999968 0.017193704995165728 -0.0009020515244896207 -0.00024063795464126733 2.0642324733302358e-05 +13.699999999999967 0.017169038114555113 -0.000899784188927746 -0.0002532416840614314 2.441497577024727e-05 +13.799999999999967 0.017142110869384296 -0.0008973808273323895 -0.00028413871454736645 2.3962284334460807e-05 +13.899999999999967 0.01711292036376755 -0.0008946953410037458 -0.00030076523990299757 2.9341869623260798e-05 +13.999999999999966 0.017081181352295926 -0.0008918584930731284 -0.000332870831523255 2.7881244006323508e-05 +14.099999999999966 0.017046888620034336 -0.0008886958498670621 -0.00035389328001129576 3.477987327346303e-05 +14.199999999999966 0.017010568930363797 -0.0008854601378617297 -0.00037241387602546196 3.0699852602585096e-05 +14.299999999999965 0.01697151450208114 -0.0008818690907983877 -0.0004077504501996674 4.016765232479435e-05 +14.399999999999965 0.016931142703305316 -0.0008782928105098639 -0.00040221560264600865 3.255697676515055e-05 +14.499999999999964 0.016888211271039878 -0.0008743736134421181 -0.0004526331983947041 4.443118409723878e-05 +14.599999999999964 0.01684407394978994 -0.000870465358557615 -0.00043489211345956817 3.52663072036497e-05 +14.699999999999964 0.016797600740501767 -0.0008662365496802958 -0.0004893179606575165 4.7711221202337166e-05 +14.799999999999963 0.016750440331002717 -0.0008620590897376781 -0.0004599189078598341 3.751140595519424e-05 +14.899999999999963 0.01670162308518401 -0.000857646542465405 -0.0005104242184401752 4.909581954206169e-05 +14.999999999999963 0.0166526660057703 -0.0008533233339283155 -0.00047504861856564927 3.899885850914312e-05 +15.099999999999962 0.016602709144963142 -0.0008488488018224148 -0.0005180945729666245 4.895610746940042e-05 diff --git a/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_mvqn.dat b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_mvqn.dat new file mode 100644 index 000000000000..1af855f23170 --- /dev/null +++ b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_disp_ref_block_mvqn.dat @@ -0,0 +1,153 @@ +# Results for "node" with Id # 111 for search config "initial" at position: x0: 0.5; y0: 0.25; z0: 0 +# time MESH_DISPLACEMENT_X MESH_DISPLACEMENT_Y MESH_VELOCITY_X MESH_VELOCITY_Y +0.1 5.835428735823507e-07 -9.520201619303315e-09 1.1049332517535633e-05 -1.8026417267319883e-07 +0.2 3.848163396677013e-06 -3.149374756564917e-08 5.267835180223261e-05 -2.6700253785341533e-07 +0.30000000000000004 1.3655325591053932e-05 -1.1324217855728596e-07 0.0001412173853202147 -1.312108932426071e-06 +0.4 3.4604301199663324e-05 -3.3776520730197573e-07 0.0002757375641210837 -3.1478431166861215e-06 +0.5 7.10875866408781e-05 -7.846449620629338e-07 0.00045208168844998285 -5.754040552100986e-06 +0.6 0.0001264128401172988 -1.5173936713774145e-06 0.0006534759262585093 -8.880591600089383e-06 +0.7 0.00020289447538211343 -2.572027917777155e-06 0.0008752474219848854 -1.2205993477287212e-05 +0.7999999999999999 0.00030223522416214374 -3.9801980685951675e-06 0.0011110080066274125 -1.5936166144773854e-05 +0.8999999999999999 0.0004260600925264305 -5.792122602908206e-06 0.0013646248337650505 -2.0273483501303082e-05 +0.9999999999999999 0.0005763130382442425 -8.083030635411251e-06 0.0016394568575055944 -2.5501770373544957e-05 +1.0999999999999999 0.0007547315311391376 -1.0945199435042085e-05 0.0019283654965527124 -3.1697891628828846e-05 +1.2 0.0009625986553531199 -1.4478439372593146e-05 0.002228483345623024 -3.892011724921596e-05 +1.3 0.0012003704894219904 -1.877548799460841e-05 0.0025271579299236523 -4.6985145037395e-05 +1.4000000000000001 0.001467873312508742 -2.392699499998436e-05 0.0028230063547400428 -5.6000468478093266e-05 +1.5000000000000002 0.0017644259411982153 -3.0020910284704626e-05 0.003108596302643597 -6.584246831692461e-05 +1.6000000000000003 0.002089169313456959 -3.715366543916289e-05 0.003386562459858934 -7.676092623038916e-05 +1.7000000000000004 0.0024410426128780695 -4.542655235806543e-05 0.0036515601741460664 -8.86548682993762e-05 +1.8000000000000005 0.002818732838892396 -5.4940862313162315e-05 0.003902851186716332 -0.00010158360932341119 +1.9000000000000006 0.0032205388928761578 -6.578657539645434e-05 0.00413423780499389 -0.0001152983691543295 +2.0000000000000004 0.0036442864419414297 -7.803201781101754e-05 0.00434181071915913 -0.00012958630858166147 +2.1000000000000005 0.0040874839290435255 -9.172381117719685e-05 0.004523330145841782 -0.00014423529262130058 +2.2000000000000006 0.004547334766581086 -0.00010688189445562927 0.004675064248638265 -0.00015892750772987575 +2.3000000000000007 0.0050210134571256095 -0.00012350944049240435 0.004799689996296507 -0.00017362294790026638 +2.400000000000001 0.005505535414423233 -0.00014158173585070605 0.004892257327093336 -0.00018784945313238483 +2.500000000000001 0.005997928916354019 -0.00016105443288583354 0.004956811412231335 -0.0002016233247446281 +2.600000000000001 0.006495052308251845 -0.00018184561632943348 0.0049872743761183065 -0.00021425962331723413 +2.700000000000001 0.006993737674777509 -0.00020384695507805827 0.004987717105014882 -0.00022581323310210522 +2.800000000000001 0.007490784735730824 -0.00022691373230799162 0.004954780655198999 -0.0002356096341275671 +2.9000000000000012 0.007983042655501923 -0.00025087868505979205 0.004891685057030883 -0.00024376017015673135 +3.0000000000000013 0.008467557925515156 -0.0002755543311587913 0.004799906907543508 -0.0002498509270855741 +3.1000000000000014 0.008941465600991533 -0.00030073439680789154 0.004679533447145325 -0.0002538438454974302 +3.2000000000000015 0.009402205842618312 -0.00032620831470245667 0.004536238980690597 -0.0002557296714447518 +3.3000000000000016 0.009847303659049522 -0.0003517453268284037 0.00436693829873066 -0.00025512677210866 +3.4000000000000017 0.010274618217904626 -0.00037712485793870673 0.004180037639399292 -0.0002525460522435403 +3.5000000000000018 0.010682190994149599 -0.00040211372070316127 0.003972412450056342 -0.00024735735143697145 +3.600000000000002 0.011068409125300487 -0.00042650243734378656 0.0037523984049585672 -0.00024048040792959855 +3.700000000000002 0.011432000486140938 -0.0004500884324260199 0.0035200126618635053 -0.00023135037344407318 +3.800000000000002 0.011771988977807181 -0.00047269529747490124 0.0032800380810781727 -0.0002208370193303856 +3.900000000000002 0.012087842099858198 -0.0004941752351139829 0.0030371197201698643 -0.00020883305720281926 +4.000000000000002 0.01237924796811482 -0.0005143984718229517 0.002791145686498597 -0.00019567856344298066 +4.100000000000001 0.012646373785595796 -0.0005332828059474909 0.0025510054988955905 -0.00018202449832035528 +4.200000000000001 0.012889590339269452 -0.0005507569189710424 0.0023132809840417505 -0.00016750248918334762 +4.300000000000001 0.013109715950710909 -0.0005668093425748812 0.0020885135562728166 -0.00015350528107727107 +4.4 0.013307816684939022 -0.0005814367176286329 0.0018731514983635112 -0.0001390766623019494 +4.5 0.013485267489218012 -0.0005946942856950251 0.0016749847580812642 -0.0001259905712645898 +4.6 0.013643769819553106 -0.0006066474236618877 0.001494298527247885 -0.000113083168781794 +4.699999999999999 0.013785105263686584 -0.0006174007501236092 0.001331589943136737 -0.00010188449905767876 +4.799999999999999 0.013911470847087173 -0.0006270837585519331 0.0011944865367020045 -9.174102982963605e-05 +4.899999999999999 0.014024925171918706 -0.0006358286268522815 0.0010739754395734404 -8.30815232009116e-05 +4.999999999999998 0.01412796331904845 -0.0006438183838138412 0.0009851607123055814 -7.66092854026722e-05 +5.099999999999998 0.014222824291499276 -0.0006511976523988249 0.0009116070021759059 -7.095609740275031e-05 +5.1999999999999975 0.01431205382742111 -0.0006581763050586786 0.0008712304355712689 -6.844519921590237e-05 +5.299999999999997 0.014397950801879349 -0.000664913077304359 0.0008462796723268693 -6.631194250906134e-05 +5.399999999999997 0.01448290082854277 -0.0006716034583988189 0.0008511507288938407 -6.731389941176105e-05 +5.4999999999999964 0.01456907521028997 -0.0006784179897012687 0.0008718396823614274 -6.898455720427705e-05 +5.599999999999996 0.014658562995458256 -0.0006855235283540235 0.0009166817161579668 -7.299277070071272e-05 +5.699999999999996 0.014753243011635457 -0.0006930826687770243 0.0009763909060663624 -7.81583000311685e-05 +5.799999999999995 0.014854798013562577 -0.0007012320065836429 0.0010538430184185044 -8.475583993829945e-05 +5.899999999999995 0.014964660447827582 -0.0007101066380649682 0.0011429657244987727 -9.268030423217881e-05 +5.999999999999995 0.015084082644164212 -0.000719816547633407 0.0012448692658457914 -0.00010148262885699 +6.099999999999994 0.015213922859627005 -0.0007304541046880196 0.0013518042583779185 -0.00011122447852167171 +6.199999999999994 0.015354904761015182 -0.0007420967015249041 0.0014673804009537263 -0.0001216026722886612 +6.299999999999994 0.015507450386600244 -0.000754805230082481 0.0015836087653765996 -0.00013254250325239956 +6.399999999999993 0.015671677268758982 -0.0007686107624199979 0.0017008525942647373 -0.00014356958456825298 +6.499999999999993 0.015847484172701883 -0.0007835334193994526 0.0018154532348203455 -0.00015486793581940287 +6.5999999999999925 0.01603439947580408 -0.0007995580182015368 0.0019231966107993148 -0.0001656566141257852 +6.699999999999992 0.01623192867597574 -0.0008166766329651404 0.002027495215144367 -0.000176693571947666 +6.799999999999992 0.016439139257533347 -0.0008348277866797801 0.0021174938345339114 -0.00018640934621947736 +6.8999999999999915 0.01665518053585767 -0.0008539727415390275 0.0022033693044773562 -0.00019645143481611296 +6.999999999999991 0.01687869217111987 -0.000874008882169447 0.002268046415334077 -0.00020439878581925204 +7.099999999999991 0.017108578359604425 -0.0008948633691951559 0.0023295595730778162 -0.00021264243586692835 +7.19999999999999 0.017343116062186668 -0.0009163943210461542 0.0023628135053212515 -0.00021814302787478043 +7.29999999999999 0.017581119746206995 -0.0009385066331037363 0.00239681345492049 -0.00022403934694894704 +7.39999999999999 0.017820597825619584 -0.0009610234689065019 0.0023948810105341952 -0.00022650624085410282 +7.499999999999989 0.018060388957644724 -0.0009838384022974019 0.002400011140841398 -0.000229699358918033 +7.599999999999989 0.01829836181984548 -0.001006742305405916 0.002362099807770537 -0.00022864110967474744 +7.699999999999989 0.018533390766932875 -0.0010296311510066636 0.002337089997188219 -0.00022899099326281834 +7.799999999999988 0.018763423704159066 -0.001052269432383522 0.0022664809865367923 -0.00022410533573165517 +7.899999999999988 0.018987247751823387 -0.0010745488828367868 0.002208558301153047 -0.00022128483301121326 +7.999999999999988 0.01920316648378895 -0.0010962599084164146 0.0021123313684680823 -0.0002132771666185163 +8.099999999999987 0.019409900985477853 -0.0011172485499619043 0.002021430326386099 -0.00020634954004230852 +8.199999999999987 0.019606092063712475 -0.0011373554845732804 0.0019041094393178037 -0.00019601719846620228 +8.299999999999986 0.0197904123406442 -0.0011564068403756653 0.0017821286675767077 -0.0001849918856438518 +8.399999999999986 0.019961961696426625 -0.001174290129875494 0.00164949929008052 -0.0001727470125996145 +8.499999999999986 0.020119408301168006 -0.0011908166074123796 0.0015002097295411018 -0.00015791006525573223 +8.599999999999985 0.02026224869771944 -0.0012059209516616276 0.0013561119335341713 -0.00014408785877620061 +8.699999999999985 0.020389141784260316 -0.001219414418967498 0.0011834766007172543 -0.00012604134487209493 +8.799999999999985 0.0204999937647291 -0.0012312807410364902 0.0010319442642550145 -0.00011104837052494991 +8.899999999999984 0.02059351367004531 -0.001241324655379085 0.0008410714311085595 -9.02174805752897e-05 +8.999999999999984 0.020669883886228722 -0.0012495796884182144 0.0006837890333114237 -7.449873123588565e-05 +9.099999999999984 0.02072793635184244 -0.001255865394291449 0.0004804849628616904 -5.170922835818917e-05 +9.199999999999983 0.020768014399061143 -0.001260236369037437 0.0003179751344244875 -3.5231754402369765e-05 +9.299999999999983 0.02078916591176816 -0.001262555065012243 0.00010847361415346517 -1.1660801333652505e-05 +9.399999999999983 0.02079177113963535 -0.0012628712828714017 -5.955644983497358e-05 5.809277392238593e-06 +9.499999999999982 0.02077513185243372 -0.0012611026789280467 -0.00027004420103560395 2.911626693118808e-05 +9.599999999999982 0.02073946830284366 -0.0012572741523916868 -0.00044596732437337215 4.782457335703971e-05 +9.699999999999982 0.02068444242982791 -0.00125137042355326 -0.000652162215596156 6.996440284878093e-05 +9.799999999999981 0.020610223243662944 -0.0012434049619271252 -0.0008341785325899167 8.955937787810613e-05 +9.89999999999998 0.020516663270008267 -0.0012334130603098346 -0.0010354486575820476 0.00011016799978007286 +9.99999999999998 0.020403822996284637 -0.0012213855666236657 -0.001222547047707226 0.00013042908647084488 +10.09999999999998 0.020272242272220388 -0.0012074383808102587 -0.0014088165034335282 0.000148619312573494 +10.19999999999998 0.02012401173466268 -0.001191724230621522 -0.0015579460974764182 0.00016569993567595187 +10.29999999999998 0.019962727961774444 -0.0011746957254664854 -0.0016693154134885695 0.00017528285229575298 +10.399999999999979 0.019793009763477074 -0.001156876005993818 -0.0017276360285852796 0.00018121378976696366 +10.499999999999979 0.019618697727950208 -0.0011387669466047818 -0.001759448874913657 0.00018127216640810944 +10.599999999999978 0.01944311762881074 -0.0011206945506016626 -0.0017540360061114291 0.00018016511678315713 +10.699999999999978 0.019268047070832083 -0.0011028561227978027 -0.0017469959577528207 0.0001767366767237592 +10.799999999999978 0.019095512295384073 -0.0010853894280039645 -0.0017057201136454739 0.00017260354850456492 +10.899999999999977 0.018926734555622823 -0.0010684230541264965 -0.0016690693785860826 0.0001668154393826833 +10.999999999999977 0.018763982519682604 -0.0010521533660656167 -0.0015886260020497383 0.00015868708315040068 +11.099999999999977 0.018608588375883493 -0.0010367412653208357 -0.0015180387987311366 0.00014958264596969748 +11.199999999999976 0.018462383592598827 -0.001022346276812849 -0.0014085496217794119 0.00013842565195578554 +11.299999999999976 0.01832579460409505 -0.00100901073375706 -0.0013213530031842475 0.0001282053862511625 +11.399999999999975 0.018199524034993943 -0.0009967613302088838 -0.001206105525916229 0.00011686561275295981 +11.499999999999975 0.0180832994673349 -0.0009855526098593286 -0.0011164353190357588 0.0001071942160341534 +11.599999999999975 0.017977373727902094 -0.0009753796783265232 -0.0010038557483894263 9.635854935805182e-05 +11.699999999999974 0.017881496201039168 -0.0009662116137583469 -0.0009120804773253364 8.690165251816323e-05 +11.799999999999974 0.017795704106282548 -0.0009580442504073834 -0.0008050245335339302 7.65227497087218e-05 +11.899999999999974 0.017719587473743113 -0.0009508318495371462 -0.0007159792392862305 6.762279316658348e-05 +11.999999999999973 0.01765263264672529 -0.000944518445256392 -0.0006236350816291539 5.867367634649648e-05 +12.099999999999973 0.017594284279350666 -0.000939040149499115 -0.0005425684593581265 5.082333661340023e-05 +12.199999999999973 0.01754336109885495 -0.0009342687141031124 -0.00047530942534311315 4.453474833380431e-05 +12.299999999999972 0.01749946141523981 -0.0009301655254115861 -0.000403108651148095 3.758393159098938e-05 +12.399999999999972 0.017461304906626576 -0.0009266054393976856 -0.00035837063966680786 3.3445846034238444e-05 +12.499999999999972 0.01742867121061109 -0.0009235691811117207 -0.0002957233953522146 2.7428039645078008e-05 +12.599999999999971 0.01740018323237974 -0.0009209307530919405 -0.0002715187447037546 2.509601550879738e-05 +12.69999999999997 0.017375567427090104 -0.0009186562402283714 -0.00022280533493238702 2.0578312509085685e-05 +12.79999999999997 0.01735342903434428 -0.0009166232484249011 -0.00021704444716074144 1.9823825002222797e-05 +12.89999999999997 0.01733346524869201 -0.0009147864154749844 -0.00018446909756794015 1.7088671119289407e-05 +12.99999999999997 0.017314506324224373 -0.0009130547426470993 -0.0001918996044379556 1.7333217990214308e-05 +13.09999999999997 0.017296282037601803 -0.0009113812886386935 -0.00017467540223548868 1.6262725030427827e-05 +13.199999999999969 0.017277931098156684 -0.000909713279497466 -0.00018999072010721384 1.6965969358546097e-05 +13.299999999999969 0.017259137552883642 -0.0009079932061153624 -0.00018747154237146063 1.7479066189155932e-05 +13.399999999999968 0.01723932041505742 -0.00090619871470264 -0.0002072207767188254 1.83781578781018e-05 +13.499999999999968 0.017218089487364523 -0.0009042598497495845 -0.00021829817715517938 2.0347112443031726e-05 +13.599999999999968 0.017195172779473765 -0.0009021856711615789 -0.00023925515445727188 2.1211593156234776e-05 +13.699999999999967 0.017170162839328682 -0.0008999038885902264 -0.00026108950287008335 2.4281234524196243e-05 +13.799999999999967 0.01714310638281601 -0.0008974545389089669 -0.0002801587033482651 2.488042774587682e-05 +13.899999999999967 0.017113593616966506 -0.0008947670600108669 -0.00030948962294990274 2.8647301050251465e-05 +13.999999999999966 0.017081926712039047 -0.0008919031648574141 -0.00032478947104452855 2.888460271500276e-05 +14.099999999999966 0.01704767699173093 -0.0008887929894422305 -0.00035891096848098973 3.3035278140572855e-05 +14.199999999999966 0.017011352033858614 -0.0008855134297713648 -0.0003692494739241716 3.2869616120106173e-05 +14.299999999999965 0.016972509716244397 -0.000881996349446556 -0.00040571207664840525 3.7143822564101915e-05 +14.399999999999965 0.016931855806516558 -0.0008783347659949731 -0.0004096659351962562 3.644937519739999e-05 +14.499999999999964 0.016888919515488456 -0.0008744597192037269 -0.00044662820775565715 4.068392249518592e-05 +14.599999999999964 0.016844595241399498 -0.0008704805379941017 -0.0004427618063372888 3.930724275148641e-05 +14.699999999999964 0.016798334214473354 -0.0008663225831920775 -0.0004794513284107385 4.3440058882502977e-05 +14.799999999999963 0.01675118795768893 -0.00086210549878008 -0.0004669903726023333 4.135436892646787e-05 +14.899999999999963 0.016702532113621823 -0.0008577532983143871 -0.0005025464114587519 4.524053840210338e-05 +14.999999999999963 0.016653488293552777 -0.0008533830705864665 -0.00048236049900370146 4.264110671787457e-05 +15.099999999999962 0.016603458953452596 -0.0008489307321478783 -0.0005142873337021493 4.595383065954195e-05 diff --git a/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_ibqnls.dat b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_ibqnls.dat new file mode 100644 index 000000000000..fdc7d7637176 --- /dev/null +++ b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_ibqnls.dat @@ -0,0 +1,153 @@ +# Results for "element" with Id # 221 for search config "initial" at position: x0: 0.57; y0: 0.27; z0: 0 +# time VELOCITY_X VELOCITY_Y MESH_DISPLACEMENT_X MESH_DISPLACEMENT_Y MESH_VELOCITY_X MESH_VELOCITY_Y +0.1 1.1546093839754041e-05 2.045795540974083e-06 5.541613540284633e-07 4.3301877897389734e-08 1.0492996052609953e-05 8.19917214625131e-07 +0.2 4.7480018841894495e-05 9.260836857866468e-06 3.705107575967778e-06 5.535077172377476e-08 5.098598646067198e-05 -4.498637307658579e-07 +0.30000000000000004 0.00010926617741538651 2.2293799989381104e-05 1.3320982255160938e-05 -6.953733498399398e-07 0.0001390411219440791 -1.3911117268994221e-05 +0.4 0.00019717354408177963 4.008174289479852e-05 3.409094575441664e-05 -3.4535396683766785e-06 0.0002742768367489792 -4.066772101067491e-05 +0.5 0.0003112523909661735 6.201651189062316e-05 7.046379633402561e-05 -9.431276360022532e-06 0.00045134729816910784 -7.841491418918685e-05 +0.6 0.00045098736967230397 8.726032142091687e-05 0.0001256802485711856 -1.9300364035426334e-05 0.0006521074222196543 -0.0001189292142168863 +0.7 0.0006161789204017853 0.00011499426391468545 0.00020211576294439315 -3.3419603065338274e-05 0.0008755457948504666 -0.00016325081214969115 +0.7999999999999999 0.0008068195640872169 0.00014387527704403367 0.0003014215170155416 -5.18801399971498e-05 0.0011102025217437472 -0.00020609426093405492 +0.8999999999999999 0.0010233541303942381 0.00017271167186780616 0.00042536639948676744 -7.494229467421864e-05 0.001367512569584655 -0.0002547862676138261 +0.9999999999999999 0.0012660786409007985 0.00019973849232845955 0.0005756559376623939 -0.00010296976154516067 0.0016378415201723957 -0.0003057272085040507 +1.0999999999999999 0.0015353242887769076 0.00022386951676938978 0.0007542300671214562 -0.00013657148044458168 0.0019323880013519317 -0.0003658023367697409 +1.2 0.0018308990400317925 0.00024322276939809593 0.0009623309488153628 -0.00017615080423508822 0.002229782687889059 -0.00042590859609684177 +1.3 0.002152613817935386 0.0002564610625502271 0.0012004730722105714 -0.00022189421849745964 0.002532710289690757 -0.0004887734063943849 +1.4000000000000001 0.002500180218856525 0.0002622838016427256 0.0014686683043529563 -0.0002738506794686874 0.0028315137108965425 -0.0005504681973094815 +1.5000000000000002 0.0028735896857812844 0.0002576705481324384 0.0017657455181154065 -0.00033167507494234836 0.0031110353264836126 -0.0006063202690476135 +1.6000000000000003 0.0032726610225138984 0.00024312518780353175 0.002091257370237031 -0.0003954343617292932 0.003398503529853312 -0.0006684378903095954 +1.7000000000000004 0.003697555473048286 0.00021452890075115773 0.002443833037251146 -0.00046491346297170943 0.0036549304302453587 -0.0007217465336426519 +1.8000000000000005 0.004147590298897098 0.000173214940814443 0.0028225474041037642 -0.0005401716239062083 0.0039184763093029675 -0.0007828288179656574 +1.9000000000000006 0.0046228960666828195 0.00011441503610907132 0.003225306285290638 -0.0006208678983120958 0.004139323277543942 -0.0008319182356698194 +2.0000000000000004 0.005122245667857149 4.036460711412308e-05 0.0036502078626489166 -0.0007067429905648899 0.004358165543355913 -0.0008851454660439448 +2.1000000000000005 0.005646064016130488 -5.4192215923760905e-05 0.0040944541192222 -0.0007972821839018023 0.004529563984797034 -0.0009264202610209203 +2.2000000000000006 0.006192614236786648 -0.00016565520547919728 0.00455565410954807 -0.0008920369964765127 0.004694119629845625 -0.0009684386956606046 +2.3000000000000007 0.0067628546151265335 -0.00030182383448210256 0.005030005019263062 -0.0009901802718722374 0.00479647630450717 -0.0009953366622830289 +2.400000000000001 0.007354657736168632 -0.00045427039112695217 0.0055162500986286785 -0.0010918147743128636 0.004926002558930292 -0.0010363328964716125 +2.500000000000001 0.007969097674153668 -0.0006365190804739815 0.006009288840153533 -0.0011955314476510294 0.0049417765190879455 -0.0010403365267747278 +2.600000000000001 0.008603384977226354 -0.0008342789869504875 0.006508144515094077 -0.0013016034822320934 0.005029536693301969 -0.0010785934291705761 +2.700000000000001 0.009259429884424361 -0.0010653465371409368 0.0070076674967092314 -0.0014085788555186205 0.004970623393518676 -0.0010644871494717807 +2.800000000000001 0.009933231594268137 -0.0013117670946394744 0.0075065129807964474 -0.001516451490824485 0.00499895372058592 -0.0010898520258861887 +2.9000000000000012 0.010627971498959696 -0.00159465684256015 0.00799963060133581 -0.0016238393965581353 0.0048738618317554884 -0.0010616950743015843 +3.0000000000000013 0.01133842684064739 -0.0018923940376580138 0.008485777838548383 -0.0017306292536505995 0.0048412643184823426 -0.0010710450561626896 +3.1000000000000014 0.012069122947185953 -0.002228829814772765 0.008960608306870687 -0.0018357247675352545 0.004665360666755151 -0.0010342264570560916 +3.2000000000000015 0.012813323296524782 -0.002579852088517341 0.009422816051411041 -0.0019387984492170644 0.004571666060543785 -0.0010248625417357078 +3.3000000000000016 0.013577078101253293 -0.0029713776082656374 0.009868716344312129 -0.0020390115923067387 0.004355036906661495 -0.000981887125684958 +3.4000000000000017 0.01435230192026377 -0.0033768039101417673 0.010297362813980828 -0.002135994927269559 0.004211601084506912 -0.000956186183035811 +3.5000000000000018 0.015146371698333104 -0.0038237602942802346 0.010705943416681386 -0.0022291970831766804 0.003967259754852521 -0.0009094391266388396 +3.600000000000002 0.015949871049925037 -0.004284771260528507 0.011093260294010338 -0.0023179347864501773 0.0037743713673910667 -0.0008648007762358709 +3.700000000000002 0.01677178906715011 -0.004787556718210038 0.011457616209356291 -0.002402081584260256 0.0035175213853092663 -0.0008183648350935963 +3.800000000000002 0.017601474863304902 -0.005303703645077387 0.01179844641724528 -0.002481026684749071 0.003295907150254889 -0.0007610894780454394 +3.900000000000002 0.01844916749195824 -0.0058614967683707705 0.012115072967555058 -0.0025549977791701536 0.003039381527076551 -0.0007174285243470956 +4.000000000000002 0.01930296844785479 -0.00643169449259893 0.01240721453689721 -0.0026233791432968513 0.002801700436995778 -0.0006516678395674687 +4.100000000000001 0.02017431447126412 -0.007042022645134832 0.012675116821822641 -0.002686627071041053 0.0025571680051782184 -0.0006114847076243543 +4.200000000000001 0.0210503900273197 -0.007663089679056969 0.012918909936705737 -0.00274418586329572 0.002318176906574138 -0.0005418019910287554 +4.300000000000001 0.021943561740719635 -0.008321777816983442 0.013139580647297967 -0.002796690611489773 0.002094504950008206 -0.0005058669525673121 +4.4 0.022840329807594442 -0.008988053210475652 0.013338013330831028 -0.002843839986843048 0.0018741454819879034 -0.0004394421109944588 +4.5 0.023753560420555417 -0.009687861322624995 0.013515850755762268 -0.0028864138456961993 0.0016810691499066313 -0.0004094077144137019 +4.6 0.024669167123478695 -0.010390495048770116 0.01367460702370095 -0.0029243536794060065 0.0014940963517654508 -0.00035160761829516565 +4.699999999999999 0.025600303093438068 -0.01112084232661108 0.013816292310426904 -0.0029584410976046856 0.0013378698669069045 -0.0003276807140096275 +4.799999999999999 0.026532366143863714 -0.01184765330295757 0.01394271482916586 -0.0029887687240259977 0.0011905162859873089 -0.00028077914710608067 +4.899999999999999 0.027478398293170544 -0.01259331080904956 0.014056395316089283 -0.0030161669144741373 0.0010809821634200798 -0.0002649594722563149 +4.999999999999998 0.028423801517005673 -0.01332843184320193 0.014159153114888988 -0.0030407612915591365 0.0009745283665204961 -0.00022863761462522584 +5.099999999999998 0.02938100391686902 -0.014071031261199674 0.01425426645590561 -0.003063690415955729 0.0009244771691044001 -0.00022753632979139566 +5.1999999999999975 0.030335324232982065 -0.014794973130222155 0.014343172684143198 -0.0030849117697583166 0.0008555258487401101 -0.0001990341807507959 +5.299999999999997 0.03129816859422185 -0.015513132583098267 0.014429545758804872 -0.003105719938054555 0.0008669451819562461 -0.00021414035818703372 +5.399999999999997 0.03225528764878146 -0.016203865705438025 0.014514148058454997 -0.0031258095094014904 0.0008291185142333844 -0.00019057362662932474 +5.4999999999999964 0.03321695026584577 -0.016875545639207377 0.01460062069527722 -0.0031464800686498828 0.0008935762961235401 -0.00021917259807516462 +5.599999999999996 0.034169536513998455 -0.017510153758652898 0.01468966673119018 -0.003167536394619128 0.0008927084691558181 -0.00020526136062592765 +5.699999999999996 0.035121494067761425 -0.018112226055064004 0.014784743804589023 -0.0031901932884895526 0.0010013330397056729 -0.00024408340959261278 +5.799999999999995 0.03606026070699331 -0.01866802949510761 0.014886230815742604 -0.003214268901422363 0.0010345252437601578 -0.0002407484571882154 +5.899999999999995 0.03699260587130805 -0.01918002469251615 0.014996439667960167 -0.0032404715592201064 0.0011627752823025908 -0.00028007508296292377 +5.999999999999995 0.03790747433005946 -0.019637196591685935 0.01511571452705624 -0.003268808955735035 0.0012279869382140112 -0.0002891802105591236 +6.099999999999994 0.038809659590680674 -0.02004034314934803 0.015245710001975284 -0.0032997180190414807 0.0013664839966273444 -0.00032677184855400186 +6.199999999999994 0.03968960202575915 -0.020381136674596047 0.015387062348830617 -0.0033335400997755883 0.001464215636175403 -0.0003509798949116934 +6.299999999999994 0.040550465000204344 -0.020661520291506617 0.015539572163629993 -0.003369898276670952 0.0015838362320924095 -0.0003758205278069545 +6.399999999999993 0.041384451631169036 -0.020873026250100776 0.015704336123534286 -0.003409556843403912 0.0017115252255610468 -0.0004165479535516217 +6.499999999999993 0.042193145654893016 -0.021019565245451302 0.015879983336691585 -0.0034516373530842316 0.0018034123290068256 -0.0004269677571269535 +6.5999999999999925 0.042970484658611974 -0.021093358062458212 0.01606757492524671 -0.0034970479260236532 0.0019451187808906191 -0.00047845715756966137 +6.699999999999992 0.04371682399389329 -0.02109956570019416 0.016264902709493573 -0.00354462699214838 0.0020067654330806935 -0.0004768097465903155 +6.799999999999992 0.04442767343959381 -0.021031128821049842 0.016472816376607864 -0.003595252037715081 0.0021458214975082724 -0.0005315954089519208 +6.8999999999999915 0.045102522632642875 -0.02089436543032514 0.016688579816324843 -0.003647643012343614 0.002176940366972201 -0.0005209296642159286 +6.999999999999991 0.04573832436565502 -0.0206830233648363 0.016912842120063717 -0.0037026138696699797 0.0023011936305984545 -0.00057374052793642 +7.099999999999991 0.04633377897851276 -0.020404210908690445 0.017142574368663916 -0.0037588731760139884 0.002302164022255529 -0.0005565688552124856 +7.19999999999999 0.04688717873075676 -0.02005261683584687 0.017377886783708753 -0.003816940789233483 0.0023966460773598296 -0.0006000886973966485 +7.29999999999999 0.04739688297381912 -0.01963577473991747 0.017615758146279352 -0.0038756566805022556 0.002369483249063792 -0.0005790350639294036 +7.39999999999999 0.04786232510705884 -0.01914947925664947 0.01785591453033809 -0.003935286731238531 0.0024267213604982304 -0.0006094683287781955 +7.499999999999989 0.04828154878595088 -0.01860156274711356 0.01809561075824285 -0.003994913035197473 0.002375059584185863 -0.0005870547886832038 +7.599999999999989 0.04865482482440723 -0.01798908627366512 0.018334174933182713 -0.004054535576737404 0.0023904861014505422 -0.000602279623931719 +7.699999999999989 0.048980020932131135 -0.01731961418183254 0.01856912031390639 -0.004113420493637755 0.0023149714093404807 -0.0005783975805444845 +7.799999999999988 0.04925812667976655 -0.016591279457350526 0.018799750190160364 -0.004171480098536698 0.002292978065802576 -0.0005805834790837139 +7.899999999999988 0.04948707177132295 -0.01581172646209124 0.019023665890403923 -0.004228022370936881 0.002190997247034426 -0.0005525164553835661 +7.999999999999988 0.04966857678556286 -0.014979993111486586 0.019240114526113745 -0.004282876563533042 0.002134028226518791 -0.0005429624193665807 +8.099999999999987 0.04980079554961028 -0.014103478808989916 0.019446904772419987 -0.004335417406512591 0.002006720085306103 -0.0005095951773548902 +8.199999999999987 0.04988597160489555 -0.013182320819193384 0.019643316006555223 -0.004385452930128402 0.0019180929446900663 -0.00048991046820522 +8.299999999999986 0.049922308064666375 -0.012222785874987353 0.019827916572332717 -0.004432681623505765 0.0017776840099561887 -0.0004557773301566308 +8.399999999999986 0.04991249921403932 -0.011227371587361522 0.019999614803155874 -0.004476681520837855 0.0016543772020962111 -0.0004238197581894604 +8.499999999999986 0.049855080821853054 -0.010200222890936583 0.02015728195053941 -0.004517224695411907 0.0015011259705117442 -0.0003873952149969208 +8.599999999999985 0.04975307724997113 -0.009145650841530668 0.02030023389647733 -0.004554085617368751 0.001356867073209009 -0.00034980113988414827 +8.699999999999985 0.04960528791841962 -0.008066624335355887 0.020427424544330965 -0.004586982017902553 0.0011885600591884343 -0.00030834938627146054 +8.799999999999985 0.0494151164456469 -0.006968628234550173 0.020538286405577734 -0.004615729769380846 0.001027846490609668 -0.0002665685266381785 +8.899999999999984 0.04918166755051323 -0.005853112270358807 0.020632008516268955 -0.004640074775466035 0.0008478860296930301 -0.00022057768567922375 +8.999999999999984 0.04890863550162502 -0.004727082997724997 0.020708351484726075 -0.004660027414395155 0.000678079598649474 -0.00017820978013282344 +9.099999999999984 0.04859521352690094 -0.0035902392653750564 0.020766567639380555 -0.00467526079081741 0.00048762820858501356 -0.00012702029060389147 +9.199999999999983 0.04824534678844042 -0.0024505786987376638 0.02080671118247604 -0.004685950132897768 0.0003139528244547153 -8.605102768360543e-05 +9.299999999999983 0.04785836736024311 -0.0013066953922294415 0.020827986700674678 -0.00469165995962536 0.00011339228663072228 -2.921679239394215e-05 +9.399999999999983 0.04743852298630369 -0.00016739971086364783 0.02083057760789768 -0.0046926411848206085 -6.337140173108733e-05 1.0805766658726008e-05 +9.499999999999982 0.04698516442137958 0.0009696245819653952 0.020813941598492543 -0.0046885502073377334 -0.00026736764051996326 6.965160404981283e-05 +9.599999999999982 0.04650265688709639 0.002095077831952185 0.020778382444828575 -0.0046796783616309895 -0.0004457514200553257 0.00010921073221620074 +9.699999999999982 0.045990426189852204 0.0032115311538230083 0.020723317319855238 -0.004665669705110424 -0.0006534198225462401 0.00016944316904979196 +9.799999999999981 0.0454528238908791 0.004310678294008503 0.020649200972645256 -0.004646857803851785 -0.0008311253477188325 0.00020837293845230953 +9.89999999999998 0.044889395065510505 0.005394443706104733 0.02055570129201114 -0.004623046704885098 -0.0010367436166127662 0.0002663813468553275 +9.99999999999998 0.04430442890088124 0.006455711419510521 0.020442866064443874 -0.004594287838804412 -0.0012216567601230702 0.00030997379597464574 +10.09999999999998 0.04370916522848076 0.007498454685434228 0.02031118270323224 -0.004560600786445168 -0.0014113193513290922 0.0003629452281114186 +10.19999999999998 0.04311971012719683 0.008521030285474407 0.020162856394500224 -0.004522226159606132 -0.0015578081285434278 0.00040534733877678323 +10.29999999999998 0.042535978573207456 0.009522924502896189 0.020001301941244744 -0.0044801006009594045 -0.001674316981024373 0.0004375382089108024 +10.399999999999979 0.041959627363832505 0.010500909079825467 0.019831265155613682 -0.004435704053837963 -0.0017296034779806526 0.0004513338703205071 +10.499999999999979 0.04138938596194007 0.011450793323388775 0.019656710213952516 -0.004390550199822532 -0.001761987436437352 0.0004522333367548661 +10.599999999999978 0.04082647488672303 0.01237342076029612 0.019480826681681176 -0.0043453089076780265 -0.0017576270576601018 0.0004525052730158023 +10.699999999999978 0.04027127658698894 0.013261976000313182 0.019305375775613906 -0.004300528887532266 -0.0017510308659927714 0.00044363139048623644 +10.799999999999978 0.03972509317169009 0.014122172942842348 0.019132516306129846 -0.004256336163901653 -0.0017082821524661532 0.00043980509046331927 +10.899999999999977 0.03918986099382147 0.014942808224392135 0.01896345474778893 -0.004213183508099542 -0.0016720514680218946 0.00042402492824316436 +10.999999999999977 0.038665876365615456 0.015733588372598827 0.018800644895660173 -0.004171460011211801 -0.0015871099457629317 0.00041014395449412173 +11.099999999999977 0.03815611495275716 0.016478398748190033 0.018644757811650575 -0.00413161244875129 -0.0015284143104839752 0.00038738210758568583 +11.199999999999976 0.03765933767966019 0.017192352409318275 0.018498235405874332 -0.004094156091121268 -0.0014061631588235986 0.0003617621126252826 +11.299999999999976 0.03717958033817154 0.01785520263787211 0.01836119111189699 -0.004059438178127166 -0.001331039462892751 0.00033278094624641013 +11.399999999999975 0.03671429111576526 0.018486095419024087 0.018234689257641698 -0.00402732499701451 -0.0012029005430176265 0.0003091362971615331 +11.499999999999975 0.0362690956118875 0.019062188464302618 0.01811844787786055 -0.003998112936328521 -0.0011184915159346373 0.0002757400392651824 +11.599999999999975 0.03584016729886959 0.01960445058465809 0.01801218418159553 -0.0039710550889792235 -0.0010090494045267063 0.0002640378364459377 +11.699999999999974 0.03543421911388657 0.020089716762819777 0.01791638940566882 -0.00394699753070576 -0.0009059240477682394 0.00021931548045778286 +11.799999999999974 0.0350456156138346 0.02053900867602828 0.01783010739645226 -0.00392494532815652 -0.000819033448039808 0.00021869717956906205 +11.899999999999974 0.03468171531061172 0.02093030853186811 0.017754097919360643 -0.003905962011084776 -0.0007029678590682765 0.00016472799671583317 +11.999999999999973 0.03433532242388817 0.02128421430494188 0.017686672486729595 -0.003888794867119278 -0.0006419892117649211 0.00017411158074452017 +12.099999999999973 0.03401459538528023 0.021580363101955484 0.0176282943442172 -0.0038743325259803533 -0.0005293665118872458 0.00011984158155252919 +12.199999999999973 0.03371122405336667 0.021838236429953372 0.01757676924022248 -0.0038612121166830293 -0.0004957436109648491 0.00013735235126352134 +12.299999999999972 0.03343366861531158 0.022040814056929738 0.017532934432778625 -0.0038504069672055143 -0.00038655130614223684 8.40381085199611e-05 +12.399999999999972 0.03317265653047488 0.022204683036309784 0.017494447790489073 -0.003840641157617476 -0.00037622086761231194 0.00010573674142715401 +12.499999999999972 0.032936910560633546 0.022316024362079058 0.017461728971190398 -0.003832562025014588 -0.0002844752880532319 6.096992747013422e-05 +12.599999999999971 0.032716439067458636 0.022389925610502757 0.01743289138138136 -0.0038253000773072546 -0.00028547939579395707 7.943142968214707e-05 +12.69999999999997 0.03251987209272857 0.02241522632863901 0.017407992034133277 -0.0038191295323228604 -0.0002180558810176636 4.799559448367107e-05 +12.79999999999997 0.03233693877115103 0.022405200549928454 0.017385710973810455 -0.003813662156641224 -0.00022215508930397722 5.801597584792201e-05 +12.89999999999997 0.03217585716341405 0.022351540838537506 0.017365529236719607 -0.003808655796169843 -0.00018514463033008526 4.428143384442023e-05 +12.99999999999997 0.032026631687776974 0.02226552703397452 0.017346657665554495 -0.0038041589364223765 -0.00018906801955662913 4.433748989800595e-05 +13.09999999999997 0.031896779178020154 0.022141954096459873 0.017328369374048424 -0.003799611875066812 -0.0001783273568404442 4.6798051573770104e-05 +13.199999999999969 0.03177706190231086 0.021988975914635556 0.01731006883271936 -0.0037952986128080104 -0.00018622753582615988 3.9942638586915035e-05 +13.299999999999969 0.03167399306405446 0.021805370452573726 0.017291081551353834 -0.0037905230087561994 -0.00019389515637507345 5.425963327162177e-05 +13.399999999999968 0.03157932833175227 0.021596207151581656 0.01727131440567336 -0.003785897876433386 -0.00020136463641539515 4.0168426794417115e-05 +13.499999999999968 0.03149822061337558 0.02136373954081681 0.017250115191632772 -0.0037805937937047318 -0.00022190517742179833 6.333606439675018e-05 +13.599999999999968 0.03142417043401871 0.02110853798916327 0.017227122540761464 -0.0037751877409663123 -0.00023835647660077074 4.761667640669239e-05 +13.699999999999967 0.031360552413603505 0.020838838304072887 0.017202421147491355 -0.003769096796961723 -0.00025552867885435574 7.127905765657964e-05 +13.799999999999967 0.03130264069162704 0.020549750398912606 0.017175529916014676 -0.00376280712370563 -0.0002818187481451628 5.7359195181918565e-05 +13.899999999999967 0.031252159199610594 0.020253539108515357 0.017146296005157248 -0.003755579431578792 -0.0003032519674487158 8.419116013298777e-05 +13.999999999999966 0.03120666400698864 0.019941826811185608 0.01711457781889599 -0.003748063870748821 -0.00033067661530875253 6.922222869383773e-05 +14.099999999999966 0.031165921843087613 0.0196295256949591 0.017080215676439733 -0.003739473469508165 -0.0003567509732417392 9.927763411409763e-05 +14.199999999999966 0.031129479253096795 0.019306370793355267 0.017043916595453835 -0.003730870024274237 -0.00036991089846011006 7.6585367611429e-05 +14.299999999999965 0.031095261965612388 0.018987328913369073 0.017004781360942085 -0.0037210836261701626 -0.0004110499054303477 0.0001147697582444362 +14.399999999999965 0.03106476153202809 0.018662995380291078 0.016964443591054555 -0.0037115923200019387 -0.0003991262392699492 8.023975862796886e-05 +14.499999999999964 0.031034255464883212 0.018346592429410898 0.016921438634492882 -0.0037009278028612 -0.0004562346508530789 0.00012717245893890787 +14.599999999999964 0.031007256384600133 0.01802894724945841 0.016877319140510293 -0.003690462670003083 -0.0004319198450540747 8.841954531902988e-05 +14.699999999999964 0.03097875907528444 0.017722605683641954 0.01683075627335945 -0.003678877448203095 -0.0004930879312256063 0.00013681070006144326 +14.799999999999963 0.030953729134391893 0.017418583465129322 0.016783589176589644 -0.0036675740805191103 -0.00045727176031562093 9.589851418299655e-05 +14.899999999999963 0.030925865262644577 0.017128386257008753 0.01673468332586259 -0.0036554518908455532 -0.0005138913061237759 0.000140097320818067 +14.999999999999963 0.03090138114734864 0.0168432217415019 0.01668571424681534 -0.0036437069348795557 -0.00047272899149614555 0.00010109391269931004 +15.099999999999962 0.030873045065775886 0.016573868190476803 0.016635684905985073 -0.003631418944878486 -0.0005210165884159332 0.00013877912393409273 diff --git a/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_mvqn.dat b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_mvqn.dat new file mode 100644 index 000000000000..21d33207affb --- /dev/null +++ b/applications/CoSimulationApplication/tests/fsi_mok/fsi_mok_cfd_results_fluid_ref_block_mvqn.dat @@ -0,0 +1,153 @@ +# Results for "element" with Id # 221 for search config "initial" at position: x0: 0.57; y0: 0.27; z0: 0 +# time VELOCITY_X VELOCITY_Y MESH_DISPLACEMENT_X MESH_DISPLACEMENT_Y MESH_VELOCITY_X MESH_VELOCITY_Y +0.1 1.1546095859641245e-05 2.0458041926699488e-06 5.541606138287685e-07 4.3313726328011456e-08 1.049298203699443e-05 8.201415636073174e-07 +0.2 4.747993987404075e-05 9.26098084176773e-06 3.7051918193237315e-06 5.5263078801900876e-08 5.098760720659118e-05 -4.519340567909848e-07 +0.30000000000000004 0.00010926056097134386 2.2307470941088598e-05 1.3323252905349265e-05 -6.95949372399426e-07 0.00013908118229742807 -1.3918670415064693e-05 +0.4 0.0001971861880200253 4.004092079893103e-05 3.4086893586526766e-05 -3.45532692785064e-06 0.00027412385276528745 -4.068423286438116e-05 +0.5 0.00031123021968457756 6.208966783479922e-05 7.046836502377114e-05 -9.431368756228974e-06 0.00045163373969389186 -7.836858380778759e-05 +0.6 0.00045095908778593414 8.75011794994241e-05 0.00012579684800479766 -1.9341934680814073e-05 0.0006540054040194853 -0.00011975168495859754 +0.7 0.0006160542468835972 0.00011548312234531364 0.00020236464975141035 -3.3491374844484725e-05 0.0008764539360794964 -0.00016314671002584525 +0.7999999999999999 0.000806676883688043 0.0001445142184203687 0.00030183341641509885 -5.198135101517228e-05 0.0011123870624714226 -0.00020666829638734676 +0.8999999999999999 0.0010231713407826812 0.00017322247452474757 0.0004258058142943371 -7.501194917108916e-05 0.0013661893390936042 -0.00025374009645988497 +0.9999999999999999 0.0012659612329485245 0.00020039803163617132 0.0005762453457165555 -0.00010306940859981768 0.001641603509339372 -0.0003071059444851226 +1.0999999999999999 0.0015352260518097496 0.00022432677930599715 0.0007549209723213532 -0.00013668030258871374 0.001931352153596302 -0.0003649365780155245 +1.2 0.0018308407396845409 0.00024371062105305958 0.0009631452060890582 -0.00017628869626282488 0.0022326235824161995 -0.00042703506786790496 +1.3 0.0021525964569798603 0.0002567302836644283 0.001201376721141058 -0.0002220576347360686 0.002532227737601157 -0.0004884322093428948 +1.4000000000000001 0.0025002235930414556 0.0002620811669983738 0.0014694277442931628 -0.00027395710470618986 0.0028289022624055 -0.0005495507352488086 +1.5000000000000002 0.002873672940938433 0.0002578088351315929 0.001766596324048333 -0.0003318362534512595 0.0031150349280353227 -0.000608174200516181 +1.6000000000000003 0.0032728154746445963 0.00024261284709033024 0.0020920139442055707 -0.00039557800092612777 0.0033936016600414056 -0.0006666344402041262 +1.7000000000000004 0.0036976314863597878 0.00021455311393843213 0.002444622730272685 -0.0004650986506577894 0.003659230757037198 -0.0007238548708802821 +1.8000000000000005 0.004147755353287595 0.0001724241193201215 0.0028231174301083604 -0.0005402955128096603 0.003911263841450012 -0.0007801171869887708 +1.9000000000000006 0.004622896224271353 0.00011445255488631186 0.0032258024671125993 -0.0006209804008668452 0.004143405633392783 -0.0008337213893455505 +2.0000000000000004 0.005122422574992833 3.9530239224688774e-05 0.0036504954075008648 -0.0007067989769048097 0.0043515602682680735 -0.000882865791383991 +2.1000000000000005 0.005645959121400592 -5.389799428256729e-05 0.004094694174413398 -0.0007973142937623645 0.0045336068731933795 -0.0009276328560043101 +2.2000000000000006 0.0061928552039501525 -0.0001668828654225219 0.004555584372896832 -0.000891980615992279 0.004685590204796938 -0.0009660052133205311 +2.3000000000000007 0.006762749621726643 -0.0003007218183145226 0.005030334107647114 -0.0009902913262809366 0.004810574887148714 -0.001000357230408806 +2.400000000000001 0.00735493177308566 -0.00045637211491978796 0.005515950342082056 -0.0010916813916660854 0.004903273304709584 -0.001027795893942563 +2.500000000000001 0.007968908980831971 -0.0006348576691365412 0.006009461893463019 -0.0011956165898308428 0.004968142254672194 -0.0010510552038329258 +2.600000000000001 0.008603839509566582 -0.0008369735585890387 0.006507719879947436 -0.0013014665378450361 0.004998653938306473 -0.0010663547116949474 +2.700000000000001 0.009259115938401462 -0.0010635536815757508 0.007007549737842072 -0.0014085774278321036 0.004999218622483151 -0.0010760742239862482 +2.800000000000001 0.009933884998091518 -0.0013151726824155428 0.007505740196875837 -0.0015162409539088157 0.004966162857720747 -0.0010776041763111398 +2.9000000000000012 0.010627539298318896 -0.0015925976344882986 0.007999129292112214 -0.001623737998146578 0.0049029237832932835 -0.001072602161883163 +3.0000000000000013 0.011339270492841759 -0.0018961220837515817 0.008484757986556301 -0.0017303955104869162 0.004810940768180375 -0.0010608608093331967 +3.1000000000000014 0.01206847028231756 -0.0022265067183567227 0.008959753128520384 -0.00183552711255242 0.004690253992012619 -0.001042088539946545 +3.2000000000000015 0.01281432986861307 -0.002583754471420211 0.009421554849686741 -0.0019385349783947975 0.00454674140305608 -0.0010182731267480032 +3.3000000000000016 0.013576241333889731 -0.0029685883428660826 0.009867680289052522 -0.002038781522807425 0.004377002378335852 -0.0009870247767384173 +3.4000000000000017 0.014353414479793374 -0.0033808111931380768 0.010295986907339736 -0.002135723250888415 0.004189803363342205 -0.0009519341586522166 +3.5000000000000018 0.015145310317174122 -0.0038209817412798003 0.010704508616447615 -0.0022288098117138506 0.003981641627859427 -0.0009101428767532593 +3.600000000000002 0.015951205160236785 -0.004288826309416933 0.011091628891258306 -0.002317586152096268 0.0037612018083214454 -0.000865460121544568 +3.700000000000002 0.01677064838711209 -0.004784546269513348 0.011456073369188559 -0.0024016680781105714 0.003528280357075456 -0.0008164052808856999 +3.800000000000002 0.017602983133797795 -0.005307834608772945 0.011796862265450249 -0.0024807344541247387 0.003287775957314336 -0.0007649978519520506 +3.900000000000002 0.018447809867974774 -0.0058583571112231685 0.012113466012479045 -0.0025545939085249835 0.0030443913951099834 -0.0007122478525055925 +4.000000000000002 0.019304540698083753 -0.006435675409593019 0.012405568024398671 -0.002623069773823041 0.0027978057985054896 -0.0006573747252799519 +4.100000000000001 0.020172800434660458 -0.0070388093309923065 0.012673339728790662 -0.0026861461319818186 0.0025572498810750967 -0.0006040396069397005 +4.200000000000001 0.021052082794882136 -0.007666945563142222 0.012917147359387465 -0.002743808768318459 0.0023188746682895134 -0.0005493192473522417 +4.300000000000001 0.02194200071242336 -0.008318407569902965 0.013137813124103302 -0.002796205298700967 0.0020937048388565034 -0.000498372559379799 +4.4 0.022842093920418166 -0.008991653654690918 0.01333640248047668 -0.0028435116882872674 0.0018777480044343917 -0.0004477942133419248 +4.5 0.02375189242385632 -0.009684330468706433 0.013514292424952777 -0.002886013015042945 0.001679157594740754 -0.0004019559470376734 +4.6 0.024670893961690366 -0.010393781476661226 0.013673189639041353 -0.002924074549559616 0.0014980278473622414 -0.0003591720298418977 +4.699999999999999 0.025598476621652905 -0.011117073285376502 0.013814873482746643 -0.0029580684704076403 0.0013348300637016054 -0.00032050073071563826 +4.799999999999999 0.02653397920034945 -0.011850167309023586 0.01394155130878878 -0.002988518050383398 0.0011974774093764862 -0.0002881847937771829 +4.899999999999999 0.02747657862268947 -0.012589633558738218 0.01405527607677867 -0.003015848083579763 0.001076413945405095 -0.000258352674180252 +4.999999999999998 0.028425313354042178 -0.013330088752077484 0.014158555824278187 -0.0030406859609007244 0.0009875223388591259 -0.00023789344608450303 +5.099999999999998 0.02937910680016455 -0.014067597310945763 0.014253624917296428 -0.0030635024111899663 0.0009134411045016312 -0.00021850328142090008 +5.1999999999999975 0.03033657132485315 -0.014795836759258236 0.014343040074016471 -0.003084944007160159 0.0008730704159487478 -0.0002097153328950525 +5.299999999999997 0.03129631505095513 -0.015510332198103036 0.014429100453284686 -0.003105526865148594 0.0008477391077578156 -0.0002020329642758884 +5.399999999999997 0.03225646387084458 -0.01620436529509853 0.014514197808857933 -0.0031258356671467463 0.0008526087174884778 -0.00020360001168500476 +5.4999999999999964 0.03321528435847401 -0.016873202725273574 0.014600507799769485 -0.003146393801490728 0.0008731115533285674 -0.0002075636338643484 +5.599999999999996 0.03417045411421504 -0.017510126507820613 0.014690121604705205 -0.003167694214652095 0.0009179173885255308 -0.00021807602163126545 +5.699999999999996 0.03511992899546307 -0.018110550262966235 0.014784925259431795 -0.003190217870843408 0.0009776290428930097 -0.00023228151683462917 +5.799999999999995 0.036060971871977654 -0.018668090909395845 0.01488660096887796 -0.003214352759716607 0.0010550222258267836 -0.00025023436818610574 +5.899999999999995 0.03699134371815278 -0.019178855958496915 0.01499658844271166 -0.003240483243265137 0.0011442758320860133 -0.00027219532023127794 +5.999999999999995 0.03790796710969575 -0.01963685346321992 0.01511614021675589 -0.0032689070412578155 0.0012461619260551982 -0.00029621010705434974 +6.099999999999994 0.038808579985986066 -0.020039485275198034 0.01524611806552055 -0.0032998599184937876 0.0013532517690416652 -0.00032272446966880887 +6.199999999999994 0.039689891826114994 -0.020381288438173037 0.015387246031330569 -0.003333525064522053 0.0014688639837958741 -0.0003505362151114873 +6.299999999999994 0.04054969663956361 -0.020660733279798008 0.015539953212843322 -0.0033700574001568505 0.001585341844703765 -0.0003800266313011925 +6.399999999999993 0.041384613101092434 -0.020873452561443958 0.015704352506412306 -0.0034094775480409674 0.0017025854064429764 -0.00040845692485049433 +6.499999999999993 0.042192635980624775 -0.02101891511503819 0.01588034902986104 -0.003451816036195847 0.001817491216142198 -0.00043821784110272775 +6.5999999999999925 0.04297051928809213 -0.021094017574795114 0.016067461668575533 -0.0034969344693176726 0.0019251335881171078 -0.00046437716044601615 +6.699999999999992 0.04371651783212496 -0.02109896548833288 0.016265205921393886 -0.0035447917017315963 0.0020298244814321914 -0.0004925951053657269 +6.799999999999992 0.044427626523271355 -0.021031958635129425 0.01647263885142196 -0.0035951318372791823 0.0021196519343557206 -0.0005146001754141816 +6.8999999999999915 0.04510238944739373 -0.020893815745639532 0.016688920869778565 -0.00364783354812309 0.0022059807758620757 -0.0005391904795874128 +6.999999999999991 0.04573815677812623 -0.02068403697851827 0.016912678001943925 -0.0037025215657006767 0.0022703964001426686 -0.0005551180416757407 +7.099999999999991 0.04633375735354689 -0.020403709165894904 0.017142826548568416 -0.003759010447053482 0.0023324014916417516 -0.0005743373805105242 +7.19999999999999 0.046887013430420635 -0.020053811730956383 0.01737762543090274 -0.0038168125611137364 0.0023652589685422545 -0.0005824123241422012 +7.29999999999999 0.0473970276454717 -0.019635291863776983 0.01761590499293486 -0.0038757267257932015 0.0023998159704444575 -0.000595416825938449 +7.39999999999999 0.047862221789762384 -0.01915093027257147 0.01785565136369838 -0.0039351735669923265 0.0023973244969792856 -0.0005944210495680982 +7.499999999999989 0.048281783167259326 -0.018601144739732386 0.01809572337952487 -0.003994965964683195 0.002403097670139581 -0.0006007875152526699 +7.599999999999989 0.04865473359731139 -0.017990648017579693 0.018333965219387606 -0.004054466983148994 0.0023644900822754897 -0.0005903385682747326 +7.699999999999989 0.04898022685033891 -0.017319101885390403 0.01856927105234256 -0.0041134933083863505 0.002340137020917529 -0.0005893777979810535 +7.799999999999988 0.04925803412328028 -0.016592899420371333 0.018799569167389202 -0.004171426642476931 0.0022688383590220617 -0.0005704992911344993 +7.899999999999988 0.04948732726063293 -0.01581131426734575 0.019023654896366104 -0.0042280079184023505 0.0022113463277895293 -0.0005603335334098008 +7.999999999999988 0.049668622989639324 -0.014981608323371719 0.019239829502255126 -0.004282782306145719 0.002114729057849785 -0.0005361413797215385 +8.099999999999987 0.04980113801846873 -0.014103150359116112 0.019446806060603006 -0.0043353681837159696 0.0020238343954680094 -0.0005151493738053179 +8.199999999999987 0.049886022445161333 -0.013183679093253187 0.019643237343777244 -0.004385473060750393 0.0019065193433494632 -0.0004874331060795038 +8.299999999999986 0.04992259360240463 -0.012222827105198265 0.019827772536596847 -0.004432619472421682 0.0017840428265951743 -0.0004556051736848138 +8.399999999999986 0.049912552098499235 -0.011228321547366688 0.019999540581875287 -0.004476708853928375 0.0016518973780014208 -0.00042602832159712925 +8.499999999999986 0.04985532499542478 -0.010200370571240609 0.020157173329271864 -0.004517192861878597 0.0015016319916708533 -0.00038436995624159824 +8.599999999999985 0.049753098192913923 -0.009146267435329659 0.02030020766289748 -0.004554127969166757 0.001358438292976763 -0.00035354337211871936 +8.699999999999985 0.04960552094265816 -0.008066973271367042 0.020427255562420706 -0.004586916005976615 0.001184408334089827 -0.00030349575171969564 +8.799999999999985 0.04941514466856286 -0.006968804383215898 0.020538272764647893 -0.004615762241129685 0.001034127654351325 -0.0002720623070467944 +8.899999999999984 0.04918190965347455 -0.005853749446379538 0.020631916578840302 -0.004640052919087194 0.0008415782587876423 -0.00021550607023492423 +8.999999999999984 0.0489085596575259 -0.004726794319424444 0.0207084196562221 -0.004660078674277647 0.0006857124308468645 -0.00018320592394916629 +9.099999999999984 0.048595388711616457 -0.003590995945515548 0.02076656514207002 -0.0046752753092781565 0.00048065692026067917 -0.00012276071333569883 +9.199999999999983 0.048245198972279205 -0.0024498856464546873 0.020806739984181193 -0.004685942968284387 0.00031950541322575807 -8.860518769075803e-05 +9.299999999999983 0.047858614304191124 -0.0013076253281805571 0.0208279546553517 -0.00469164373324949 0.00010842986470232396 -2.742695846241182e-05 +9.399999999999983 0.0474383891953261 -0.00016645183286146412 0.020830619534485034 -0.004692615072088326 -5.852455893969124e-05 9.848901660646989e-06 +9.499999999999982 0.04698547053509343 0.0009684652798901683 0.020814014618031645 -0.00468858003489552 -0.00027020960347668365 6.915070300787313e-05 +9.599999999999982 0.04650252620449094 0.002095910589187725 0.020778368374816517 -0.004679625635767112 -0.00044559798952853403 0.00011132593394287973 +9.699999999999982 0.04599082922150502 0.003210278924249457 0.020723344634732577 -0.004665700002477922 -0.0006523896933500707 0.00016612923907187237 +9.799999999999981 0.04545277408029796 0.004311295274613896 0.020649105171326593 -0.004646800316627151 -0.0008344144928384045 0.00021259768686116568 +9.89999999999998 0.04488994866419566 0.005393037765361039 0.02055551737364599 -0.0046230073150129725 -0.0010357514238577823 0.0002628653380043281 +9.99999999999998 0.04430443845881697 0.006456316136638913 0.020442619829737732 -0.004594213139163737 -0.0012233686944361844 0.00031311825938410136 +10.09999999999998 0.043709754886003906 0.007497309132602412 0.020310943973997443 -0.004560566902465539 -0.0014099162801131531 0.00035997262333433073 +10.19999999999998 0.04311971500579767 0.008521402258787622 0.020162496824952962 -0.004522138482004083 -0.001561075340394087 0.0004084622643701271 +10.29999999999998 0.04253662307175904 0.009522033140056726 0.02000089617856576 -0.004479998012263494 -0.0016726519408128034 0.00043558253775328245 +10.399999999999979 0.041959647983626544 0.010501153466376069 0.01983081804803255 -0.004435602667120791 -0.0017314508278627023 0.0004525846593129353 +10.499999999999979 0.041390059080603926 0.011450097547500978 0.019656184221632147 -0.004390387188875964 -0.001762170136905489 0.00045261452161387194 +10.599999999999978 0.040826515671500224 0.012373410499568345 0.019480330164076853 -0.004345210211836259 -0.0017567099989064478 0.00045080602297550214 +10.699999999999978 0.04027178055512134 0.013261972366705189 0.019305012148960146 -0.004300432399198437 -0.001749309691765459 0.0004450045818471754 +10.799999999999978 0.03972494317090117 0.014122054439258038 0.019132219682645866 -0.004256322536096485 -0.0017085038488244806 0.00043723954446462125 +10.899999999999977 0.039190157782785104 0.014943252754851918 0.018963147336353084 -0.004213067833248774 -0.0016721988509216835 0.00042792969225541636 +10.999999999999977 0.03866585168223559 0.01573286289258131 0.01880008249705198 -0.0041712886486396815 -0.001591766173595354 0.00040822018555036846 +11.099999999999977 0.03815645493490323 0.01647938366654715 0.018644377581611866 -0.004131438423031213 -0.0015211148731344999 0.00038863574522894726 +11.199999999999976 0.037659394140133154 0.01719127111802879 0.018497896623028812 -0.0040941033653198 -0.0014110269254509595 0.00035868562390330627 +11.299999999999976 0.03717964210050495 0.017856607079412057 0.0183610652302933 -0.004059387351138059 -0.001323690499434448 0.00033512045256853354 +11.399999999999975 0.03671426519469398 0.01848483796910709 0.01823457886379959 -0.004027395639928202 -0.0012081035309118907 0.0003051998182142079 +11.499999999999975 0.03626895987100302 0.01906375675175118 0.01811814924727358 -0.0039979687683346955 -0.0011185099939641924 0.0002827934258950538 +11.599999999999975 0.03584029171738001 0.019603333142990273 0.01801201873354682 -0.003971100039074075 -0.0010058902084631813 0.000255019149724224 +11.699999999999974 0.035434035539941025 0.020091307963109553 0.017915949503329098 -0.003946776917942298 -0.0009138872191335895 0.00023111602314506823 +11.799999999999974 0.03504588416999472 0.02053808789704261 0.017829976252003055 -0.003925000195960544 -0.0008068265936125368 0.00020464469052157617 +11.899999999999974 0.03468140411482207 0.02093187462625514 0.017753714789792603 -0.003905775590658156 -0.000717114593841746 0.0001797047085444378 +11.999999999999973 0.03433562296966075 0.02128361507783931 0.01768662652965384 -0.0038888687277776677 -0.0006251020298590798 0.0001582709980403961 +12.099999999999973 0.03401400927586929 0.021582361337839473 0.017628186509922678 -0.003874261829998113 -0.0005430265486279452 0.00013406337773334853 +12.199999999999973 0.03371134792439963 0.02183844291148729 0.017577157826452944 -0.003861409970533301 -0.0004768223170100788 0.0001222287269798505 +12.299999999999972 0.03343278190643814 0.022042833170267635 0.017533189789253344 -0.0038504348904383925 -0.00040314025583379205 9.81479884987606e-05 +12.399999999999972 0.03317280374928747 0.02220510343558453 0.017494943029779046 -0.0038407661567833344 -0.0003599304140957329 9.38927233332931e-05 +12.499999999999972 0.03293597257859482 0.02231803950068858 0.017462265186465764 -0.0038326481189533373 -0.00029529762296249894 6.991112956768539e-05 +12.599999999999971 0.03271664201777432 0.02239053025022414 0.01743371564702231 -0.0038254750339380694 -0.000272899663904258 7.173806679411067e-05 +12.69999999999997 0.03251883234969367 0.02241708122086574 0.017409082962643325 -0.003819440683270984 -0.0002220526580578569 5.068885586711771e-05 +12.79999999999997 0.03233703245794583 0.022405969698724146 0.017386907306230524 -0.003813932165504714 -0.00021824012264091877 5.748047541422994e-05 +12.89999999999997 0.03217474882032165 0.022353162612858725 0.01736693795437147 -0.0038090823055957554 -0.00018368147049547143 4.130867135386752e-05 +12.99999999999997 0.032026729826590404 0.022266415272396155 0.017347953124468473 -0.0038044010599440543 -0.0001929180090961501 5.0444689532012915e-05 +13.09999999999997 0.03189589239920363 0.022142894652834005 0.01732972510429941 -0.003799983237350692 -0.00017400034765452973 3.950870076305387e-05 +13.199999999999969 0.03177733134621928 0.021989935869363167 0.017311358939996697 -0.0037955042377714418 -0.00019072837979349356 4.8548422499082313e-05 +13.299999999999969 0.03167338140179486 0.0218056611067549 0.01729256410897468 -0.003790966791012068 -0.0001869692813913122 4.338041456314624e-05 +13.399999999999968 0.031579638450596643 0.02159702999314437 0.017272742100870753 -0.0037861881692519755 -0.00020764610016030168 5.116827743697389e-05 +13.499999999999968 0.03149791800319962 0.02136287932984358 0.01725150774056275 -0.0037810584948138604 -0.00021807381332188515 5.2068572798328426e-05 +13.599999999999968 0.03142442935298236 0.021109772871116882 0.017228589253012516 -0.003775548821728221 -0.00023942340517585657 5.769803302267601e-05 +13.699999999999967 0.031360483045895116 0.020837072361436962 0.017203567519028854 -0.003769473123854735 -0.0002612051017344771 6.389094429836288e-05 +13.799999999999967 0.03130294066704422 0.020550888226060937 0.017176508000134736 -0.0037629606216580047 -0.00028009924425334803 6.653970324208062e-05 +13.899999999999967 0.031252617514342745 0.020250970672713548 0.017146974724822107 -0.0037557656244741867 -0.0003099229803349546 7.688231056167348e-05 +13.999999999999966 0.03120706356530703 0.019942888567181793 0.017115303183853188 -0.003748138583149825 -0.0003245248873447378 7.638759765636826e-05 +14.099999999999966 0.03116664201272899 0.019626672605119314 0.017081024662790965 -0.0037397732930072197 -0.0003596375422550155 8.99454764783829e-05 +14.199999999999966 0.031129623385218994 0.019307244483607922 0.01704469159071345 -0.0037310139639160364 -0.000368833700162853 8.644388284995426e-05 +14.299999999999965 0.03109594487352814 0.018984837865367227 0.017005810286340788 -0.00372150581928444 -0.0004067257908544082 0.00010232787614154737 +14.399999999999965 0.031064600718918332 0.018663626855883842 0.016965143117414167 -0.003711688610013958 -0.0004091304072179543 9.563409262373327e-05 +14.499999999999964 0.031035085219302556 0.018344010919223858 0.016922157072119776 -0.0037011572712972616 -0.00044791587111138714 0.0001132223699488663 +14.599999999999964 0.03100713298917668 0.018029308865624163 0.01687781571373349 -0.0036904505648549723 -0.00044208937618740957 0.00010292301609127514 +14.699999999999964 0.030979747961290303 0.0177201114893263 0.016831495394934698 -0.0036790908938752935 -0.00048100569653604776 0.00012210903687986268 +14.799999999999963 0.030953457217832922 0.017418742023245327 0.016784329030369652 -0.0036677046072939056 -0.000466172813280742 0.00010802829197383612 +14.899999999999963 0.030926721242414756 0.01712608805746583 0.016735606319480806 -0.0036557526015951855 -0.0005043374872720266 0.0001284671926311442 +14.999999999999963 0.03090086929834275 0.016843306280414503 0.01668653714446696 -0.0036438995530066257 -0.0004814653149178704 0.00011134286790995208 +15.099999999999962 0.030873830540385498 0.016571745445948402 0.0166364371231215 -0.0036316188460480733 -0.000516190438610499 0.00013148761384425948 diff --git a/applications/CoSimulationApplication/tests/test_block_convergence_accelerators.py b/applications/CoSimulationApplication/tests/test_block_convergence_accelerators.py new file mode 100644 index 000000000000..3746f7e7d49d --- /dev/null +++ b/applications/CoSimulationApplication/tests/test_block_convergence_accelerators.py @@ -0,0 +1,252 @@ +import KratosMultiphysics as KM +import KratosMultiphysics.KratosUnittest as KratosUnittest + +from KratosMultiphysics.CoSimulationApplication.coupling_interface_data import CouplingInterfaceData +from KratosMultiphysics.CoSimulationApplication.convergence_accelerators.convergence_accelerator_wrapper import BlockConvergenceAcceleratorWrapper +from testing_utilities import DummySolverWrapper + +from unittest.mock import Mock, patch +import numpy as np +from random import uniform + +if KM.IsDistributedRun(): + import KratosMultiphysics.mpi as KratosMPI + +class TestBlockConvergenceAcceleratorWrapper(KratosUnittest.TestCase): + + def setUp(self): + self.dimension = 3 + + self.model = KM.Model() + self.model_part = self.model.CreateModelPart("default") + self.model_part.AddNodalSolutionStepVariable(KM.PRESSURE) + self.model_part.AddNodalSolutionStepVariable(KM.PARTITION_INDEX) + self.model_part.ProcessInfo[KM.DOMAIN_SIZE] = self.dimension + + self.model2 = KM.Model() + self.model_part2 = self.model2.CreateModelPart("default2") + self.model_part2.AddNodalSolutionStepVariable(KM.MESH_DISPLACEMENT_X) + self.model_part2.AddNodalSolutionStepVariable(KM.PARTITION_INDEX) + self.model_part2.ProcessInfo[KM.DOMAIN_SIZE] = self.dimension + + self.my_pid = KM.Testing.GetDefaultDataCommunicator().Rank() + self.num_nodes = self.my_pid % 5 + 3 # num_nodes in range (3 ... 7) + self.num_nodes2 = self.my_pid % 5 + 3 # num_nodes in range (3 ... 7) + + # in order to emulate one partition not having local nodes + if self.my_pid == 4: + self.num_nodes = 0 + if self.my_pid == 3: + self.num_nodes2 = 0 + + for i in range(self.num_nodes): + node = self.model_part.CreateNewNode(i, 0.1*i, 0.0, 0.0) # this creates the same coords in different ranks, which does not matter for this test + node.SetSolutionStepValue(KM.PARTITION_INDEX, self.my_pid) + node.SetSolutionStepValue(KM.PRESSURE, uniform(-10, 50)) + + for i in range(self.num_nodes2): + node = self.model_part2.CreateNewNode(i, 0.1*i, 0.0, 0.0) # this creates the same coords in different ranks, which does not matter for this test + node.SetSolutionStepValue(KM.PARTITION_INDEX, self.my_pid) + node.SetSolutionStepValue(KM.MESH_DISPLACEMENT_X, uniform(-10, 50)) + + if KM.IsDistributedRun(): + KratosMPI.ParallelFillCommunicator(self.model_part, KM.Testing.GetDefaultDataCommunicator()).Execute() + KratosMPI.ParallelFillCommunicator(self.model_part2, KM.Testing.GetDefaultDataCommunicator()).Execute() + + data_settings = KM.Parameters("""{ + "model_part_name" : "default", + "variable_name" : "PRESSURE" + }""") + self.interface_data = CouplingInterfaceData(data_settings, self.model) + self.dummy_solver_wrapper = DummySolverWrapper({"data_4_testing" : self.interface_data}) + + data_settings2 = KM.Parameters("""{ + "model_part_name" : "default2", + "variable_name" : "MESH_DISPLACEMENT_X" + }""") + self.interface_data2 = CouplingInterfaceData(data_settings2, self.model2) + self.dummy_solver_wrapper2 = DummySolverWrapper({"data_4_testing2" : self.interface_data2}) + + self.interface_data_dict = {} + self.interface_data_dict["data_4_testing"] = self.dummy_solver_wrapper.interface_data_dict["data_4_testing"] + self.interface_data_dict["data_4_testing2"] = self.dummy_solver_wrapper2.interface_data_dict["data_4_testing2"] + + def test_accelerator_without_support_for_distributed_data(self): + conv_acc_settings = KM.Parameters("""{ + "type" : "patched_mock_testing", + "solver_sequence" : + [ + { + "solver": "fluid", + "data_name" : "data_4_testing", + "coupled_data_name" : "data_4_testing2" + }, + { + "solver": "structure", + "data_name" : "data_4_testing2", + "coupled_data_name" : "data_4_testing" + } + ] + }""") + + exp_inp = {} + exp_res = {} + + exp_inp["data_4_testing"] = self.interface_data.GetData() + exp_inp["data_4_testing2"] = self.interface_data2.GetData() + + update_solution_return_value = [uniform(-10, 50) for _ in range(self.num_nodes)] + global_update_solution_return_value = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(update_solution_return_value, 0))) + conv_acc_mock = Mock() + attrs = { + 'SupportsDistributedData.return_value': False, + 'UpdateSolution.return_value' : global_update_solution_return_value + } + conv_acc_mock.configure_mock(**attrs) + + with patch('KratosMultiphysics.CoSimulationApplication.convergence_accelerators.convergence_accelerator_wrapper.CreateConvergenceAccelerator') as p: + p.return_value = conv_acc_mock + conv_acc_wrapper = BlockConvergenceAcceleratorWrapper(conv_acc_settings, self.interface_data_dict, KM.Testing.GetDefaultDataCommunicator()) + + conv_acc_wrapper.Initialize() + conv_acc_wrapper.InitializeSolutionStep() + + self.assertEqual(conv_acc_mock.SupportsDistributedData.call_count, 2) + self.assertEqual(conv_acc_wrapper.gather_scatter_required["data_4_testing"], self.interface_data_dict["data_4_testing"].IsDistributed()) # gather-scatter is only required in case of distributed data + self.assertEqual(conv_acc_wrapper.gather_scatter_required["data_4_testing2"], self.interface_data_dict["data_4_testing2"].IsDistributed()) # gather-scatter is only required in case of distributed data + self.assertEqual(conv_acc_wrapper.executing_rank["data_4_testing"], self.my_pid == 0) + self.assertEqual(conv_acc_wrapper.executing_rank["data_4_testing2"], self.my_pid == 0) + + conv_acc_wrapper.InitializeNonLinearIteration() + + # setting new solution for computing the residual + rand_data1 = [uniform(-10, 50) for _ in range(self.num_nodes)] + self.interface_data_dict["data_4_testing"].SetData(rand_data1) + exp_res["data_4_testing"] = rand_data1 - exp_inp["data_4_testing"] + exp_res_y = self.num_nodes2 * [0.] + conv_acc_wrapper.ComputeAndApplyUpdate() + + + global_exp_res = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_res["data_4_testing"], 0))) + global_exp_inp = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_inp["data_4_testing"], 0))) + global_exp_inp_y = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_inp["data_4_testing2"], 0))) + global_exp_res_y = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_res_y, 0))) + if self.my_pid == 0: + np.testing.assert_array_equal(global_exp_res, conv_acc_mock.UpdateSolution.call_args[0][0]) + np.testing.assert_array_equal(global_exp_inp, conv_acc_mock.UpdateSolution.call_args[0][1]) + np.testing.assert_array_equal(global_exp_inp_y, conv_acc_mock.UpdateSolution.call_args[0][2]) + np.testing.assert_array_equal(global_exp_res_y, conv_acc_mock.UpdateSolution.call_args[0][4]) + + solver_1_output = exp_inp["data_4_testing"] + update_solution_return_value + np.testing.assert_array_equal(solver_1_output, self.interface_data_dict["data_4_testing"].GetData()) + + + update_solution_return_value2 = [uniform(-10, 50) for _ in range(self.num_nodes2)] + global_update_solution_return_value2 = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(update_solution_return_value2, 0))) + conv_acc_mock.UpdateSolution.return_value = global_update_solution_return_value2.copy() + + # setting new solution (other solver) for computing the residual + rand_data2 = [uniform(-10, 50) for _ in range(self.num_nodes2)] + self.interface_data_dict["data_4_testing2"].SetData(rand_data2) + exp_res["data_4_testing2"] = rand_data2 - exp_inp["data_4_testing2"] + exp_res_y = solver_1_output - rand_data1 + conv_acc_wrapper.ComputeAndApplyUpdate() + + self.assertEqual(conv_acc_mock.UpdateSolution.call_count, 2*int(self.my_pid == 0)) # only one rank calls "UpdateSolution" + global_exp_res2 = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_res["data_4_testing2"], 0))) + global_exp_inp2 = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_inp["data_4_testing2"], 0))) + global_exp_inp2_y = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(solver_1_output, 0))) + global_exp_res2_y = np.array(np.concatenate(KM.Testing.GetDefaultDataCommunicator().GathervDoubles(exp_res_y, 0))) + if self.my_pid == 0: + np.testing.assert_array_equal(global_exp_res2, conv_acc_mock.UpdateSolution.call_args[0][0]) + np.testing.assert_array_equal(global_exp_inp2, conv_acc_mock.UpdateSolution.call_args[0][1]) + np.testing.assert_array_equal(global_exp_inp2_y, conv_acc_mock.UpdateSolution.call_args[0][2]) + np.testing.assert_array_equal(global_exp_res2_y, conv_acc_mock.UpdateSolution.call_args[0][4]) + + np.testing.assert_array_equal(exp_inp["data_4_testing2"] + update_solution_return_value2, self.interface_data_dict["data_4_testing2"].GetData()) + + def test_accelerator_with_support_for_distributed_data(self): + conv_acc_settings = KM.Parameters("""{ + "type" : "patched_mock_testing", + "solver_sequence" : + [ + { + "solver": "fluid", + "data_name" : "data_4_testing", + "coupled_data_name" : "data_4_testing2" + }, + { + "solver": "structure", + "data_name" : "data_4_testing2", + "coupled_data_name" : "data_4_testing" + } + ] + }""") + + exp_inp = {} + exp_res = {} + + exp_inp["data_4_testing"] = self.interface_data.GetData() + exp_inp["data_4_testing2"] = self.interface_data2.GetData() + + update_solution_return_value = [uniform(-10, 50) for _ in range(self.num_nodes)] + conv_acc_mock = Mock() + attrs = { + 'SupportsDistributedData.return_value': True, + 'UpdateSolution.return_value' : update_solution_return_value + } + conv_acc_mock.configure_mock(**attrs) + + with patch('KratosMultiphysics.CoSimulationApplication.convergence_accelerators.convergence_accelerator_wrapper.CreateConvergenceAccelerator') as p: + p.return_value = conv_acc_mock + conv_acc_wrapper = BlockConvergenceAcceleratorWrapper(conv_acc_settings, self.interface_data_dict, KM.Testing.GetDefaultDataCommunicator()) + + conv_acc_wrapper.Initialize() + conv_acc_wrapper.InitializeSolutionStep() + + self.assertEqual(conv_acc_mock.SupportsDistributedData.call_count, 2) + self.assertFalse(conv_acc_wrapper.gather_scatter_required["data_4_testing"]) + self.assertFalse(conv_acc_wrapper.gather_scatter_required["data_4_testing2"]) + self.assertTrue(conv_acc_wrapper.executing_rank["data_4_testing"]) + self.assertTrue(conv_acc_wrapper.executing_rank["data_4_testing2"]) + + conv_acc_wrapper.InitializeNonLinearIteration() + + # setting new solution for computing the residual + rand_data1 = [uniform(-10, 50) for _ in range(self.num_nodes)] + self.interface_data_dict["data_4_testing"].SetData(rand_data1) + exp_res["data_4_testing"] = rand_data1 - exp_inp["data_4_testing"] + exp_res_y = self.num_nodes2 * [0.] + conv_acc_wrapper.ComputeAndApplyUpdate() + + + np.testing.assert_array_equal(exp_res["data_4_testing"], conv_acc_mock.UpdateSolution.call_args[0][0]) + np.testing.assert_array_equal(exp_inp["data_4_testing"], conv_acc_mock.UpdateSolution.call_args[0][1]) + np.testing.assert_array_equal(exp_inp["data_4_testing2"], conv_acc_mock.UpdateSolution.call_args[0][2]) + np.testing.assert_array_equal(exp_res_y, conv_acc_mock.UpdateSolution.call_args[0][4]) + + solver_1_output = exp_inp["data_4_testing"] + update_solution_return_value + np.testing.assert_array_equal(solver_1_output, self.interface_data_dict["data_4_testing"].GetData()) + + + update_solution_return_value2 = [uniform(-10, 50) for _ in range(self.num_nodes2)] + conv_acc_mock.UpdateSolution.return_value = update_solution_return_value2.copy() + + # setting new solution (other solver) for computing the residual + rand_data2 = [uniform(-10, 50) for _ in range(self.num_nodes2)] + self.interface_data_dict["data_4_testing2"].SetData(rand_data2) + exp_res["data_4_testing2"] = rand_data2 - exp_inp["data_4_testing2"] + exp_res_y = solver_1_output - rand_data1 + conv_acc_wrapper.ComputeAndApplyUpdate() + + self.assertEqual(conv_acc_mock.UpdateSolution.call_count, 2) # only one rank calls "UpdateSolution" + np.testing.assert_array_equal(exp_res["data_4_testing2"], conv_acc_mock.UpdateSolution.call_args[0][0]) + np.testing.assert_array_equal(exp_inp["data_4_testing2"], conv_acc_mock.UpdateSolution.call_args[0][1]) + np.testing.assert_array_equal(solver_1_output, conv_acc_mock.UpdateSolution.call_args[0][2]) + np.testing.assert_array_equal(exp_res_y, conv_acc_mock.UpdateSolution.call_args[0][4]) + + np.testing.assert_array_equal(exp_inp["data_4_testing2"] + update_solution_return_value2, self.interface_data_dict["data_4_testing2"].GetData()) + + +if __name__ == '__main__': + KratosUnittest.main() diff --git a/applications/CoSimulationApplication/tests/test_mok_fsi.py b/applications/CoSimulationApplication/tests/test_mok_fsi.py index 6d0797012d6c..dc4cf97f4f80 100644 --- a/applications/CoSimulationApplication/tests/test_mok_fsi.py +++ b/applications/CoSimulationApplication/tests/test_mok_fsi.py @@ -16,6 +16,7 @@ class TestMokFSI(co_simulation_test_case.CoSimulationTestCase): cfd_tes_file_name = "fsi_mok/ProjectParametersCFD_for_test.json" def setUp(self): + self.err_tol = "1e-6" if not have_fsi_dependencies: self.skipTest("FSI dependencies are not available!") @@ -42,6 +43,32 @@ def test_mok_fsi_aitken(self): self.__DumpUpdatedCFDSettings() self._runTest() + def test_mok_fsi_block_mvqn(self): + self.accelerator_type = "block_mvqn" + + with KratosUnittest.WorkFolderScope(".", __file__): + self._createTest("fsi_mok", "cosim_mok_fsi_block") + self.__ManipulateCFDSettings() + self.__RemoveOutputFromCFD() # comment to get output + self.__AddTestingToCFD() + self.__DumpUpdatedCFDSettings() + self._runTest() + + + def test_mok_fsi_block_ibqnls(self): + self.accelerator_type = "block_ibqnls" + self.err_tol = "6e-5" + + with KratosUnittest.WorkFolderScope(".", __file__): + self._createTest("fsi_mok", "cosim_mok_fsi_block") + self.__ManipulateCFDSettings() + additional_accel_settings = KM.Parameters("""2""") + self.cosim_parameters["solver_settings"]["convergence_accelerators"][0].AddValue("timestep_horizon", additional_accel_settings) + self.__RemoveOutputFromCFD() # comment to get output + self.__AddTestingToCFD() + self.__DumpUpdatedCFDSettings() + self._runTest() + def test_mok_fsi_mvqn_external_structure(self): self.accelerator_type = "mvqn" @@ -141,7 +168,7 @@ def __AddTestingToCFD(self): "output_file_name" : "fsi_mok/fsi_mok_cfd_results_disp.dat", "reference_file_name" : \""""+disp_ref_file_name.replace("\\", "\\\\")+"""\", "comparison_type" : "dat_file_variables_time_history", - "tolerance" : 1e-6 + "tolerance" : """+self.err_tol+""" } },{ "kratos_module" : "KratosMultiphysics", @@ -171,7 +198,7 @@ def __AddTestingToCFD(self): "output_file_name" : "fsi_mok/fsi_mok_cfd_results_fluid.dat", "reference_file_name" : \""""+fluid_ref_file_name.replace("\\", "\\\\")+"""\", "comparison_type" : "dat_file_variables_time_history", - "tolerance" : 1e-6 + "tolerance" : """+self.err_tol+""" } }]"""))