diff --git a/framework/src/transfers/MultiAppProjectionTransfer.C b/framework/src/transfers/MultiAppProjectionTransfer.C index 285bcba918cc..c94bc4d05a4a 100644 --- a/framework/src/transfers/MultiAppProjectionTransfer.C +++ b/framework/src/transfers/MultiAppProjectionTransfer.C @@ -484,10 +484,10 @@ MultiAppProjectionTransfer::projectSolution(unsigned int i_to) for ( ; it != end_it; ++it) { const Node * node = *it; - if (node->n_comp(to_sys.number(), to_var.number()) > 0) + for (unsigned int comp = 0; comp < node->n_comp(to_sys.number(), to_var.number()); comp++) { - const dof_id_type proj_index = node->dof_number(ls.number(), _proj_var_num, 0); - const dof_id_type to_index = node->dof_number(to_sys.number(), to_var.number(), 0); + const dof_id_type proj_index = node->dof_number(ls.number(), _proj_var_num, comp); + const dof_id_type to_index = node->dof_number(to_sys.number(), to_var.number(), comp); to_solution->set(to_index, (*ls.solution)(proj_index)); } } @@ -498,10 +498,10 @@ MultiAppProjectionTransfer::projectSolution(unsigned int i_to) for ( ; it != end_it; ++it) { const Elem * elem = *it; - if (elem->n_comp(to_sys.number(), to_var.number()) > 0) + for (unsigned int comp = 0; comp < elem->n_comp(to_sys.number(), to_var.number()); comp++) { - const dof_id_type proj_index = elem->dof_number(ls.number(), _proj_var_num, 0); - const dof_id_type to_index = elem->dof_number(to_sys.number(), to_var.number(), 0); + const dof_id_type proj_index = elem->dof_number(ls.number(), _proj_var_num, comp); + const dof_id_type to_index = elem->dof_number(to_sys.number(), to_var.number(), comp); to_solution->set(to_index, (*ls.solution)(proj_index)); } } diff --git a/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out.e b/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out.e new file mode 100644 index 000000000000..84f2ea8e808a Binary files /dev/null and b/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out.e differ diff --git a/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out_sub0.e b/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out_sub0.e new file mode 100644 index 000000000000..5bc138969285 Binary files /dev/null and b/test/tests/transfers/multiapp_projection_transfer/gold/high_order_master_out_sub0.e differ diff --git a/test/tests/transfers/multiapp_projection_transfer/high_order_master.i b/test/tests/transfers/multiapp_projection_transfer/high_order_master.i new file mode 100644 index 000000000000..00d69ef01e30 --- /dev/null +++ b/test/tests/transfers/multiapp_projection_transfer/high_order_master.i @@ -0,0 +1,95 @@ +[Mesh] + type = GeneratedMesh + dim = 2 + nx = 4 + ny = 4 +[] + +[Functions] + [./test_function] + type = ParsedFunction + value = '2.5*x^2 + 0.75*y^2 + 0.15*x*y' + [../] +[] + +[AuxVariables] + [./from_sub] + family = monomial + order = first + [../] + [./test_var] + family = monomial + order = first + [./InitialCondition] + type = FunctionIC + function = test_function + [../] + [../] +[] + +[Variables] + [./u] + [../] +[] + +[Kernels] + [./diff] + type = Diffusion + variable = u + [../] +[] + +[BCs] + [./left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [../] + [./right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [../] +[] + +[Executioner] + type = Steady + solve_type = PJFNK +[] + +[Outputs] + exodus = true + print_linear_residuals = true +[] + +[MultiApps] + [./sub] + type = FullSolveMultiApp + app_type = MooseTestApp + execute_on = initial + positions = '0.0 0.0 0.0' + input_files = high_order_sub.i + [../] +[] + +[Transfers] + [./from] + type = MultiAppProjectionTransfer + direction = from_multiapp + execute_on = same_as_multiapp + multi_app = sub + source_variable = test_var + variable = from_sub + [../] + [./to] + type = MultiAppProjectionTransfer + direction = to_multiapp + execute_on = same_as_multiapp + multi_app = sub + source_variable = test_var + variable = from_master + [../] +[] + diff --git a/test/tests/transfers/multiapp_projection_transfer/high_order_sub.i b/test/tests/transfers/multiapp_projection_transfer/high_order_sub.i new file mode 100644 index 000000000000..9d05faf70143 --- /dev/null +++ b/test/tests/transfers/multiapp_projection_transfer/high_order_sub.i @@ -0,0 +1,66 @@ +[Mesh] + type = GeneratedMesh + dim = 2 + nx = 4 + ny = 4 +[] + +[Functions] + [./test_function] + type = ParsedFunction + value = '2.5*x^2 + 0.75*y^2 + 0.15*x*y' + [../] +[] + +[AuxVariables] + [./from_master] + family = monomial + order = first + [../] + [./test_var] + family = monomial + order = first + [./InitialCondition] + type = FunctionIC + function = test_function + [../] + [../] +[] + +[Variables] + [./u] + [../] +[] + +[Kernels] + [./diff] + type = Diffusion + variable = u + [../] +[] + +[BCs] + [./left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [../] + [./right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [../] +[] + +[Executioner] + type = Steady + solve_type = PJFNK +[] + +[Outputs] + exodus = true + print_linear_residuals = true +[] + diff --git a/test/tests/transfers/multiapp_projection_transfer/tests b/test/tests/transfers/multiapp_projection_transfer/tests index c06c12bcd895..ad3b4fb46343 100644 --- a/test/tests/transfers/multiapp_projection_transfer/tests +++ b/test/tests/transfers/multiapp_projection_transfer/tests @@ -3,7 +3,6 @@ type = 'Exodiff' input = 'tosub_master.i' exodiff = 'tosub_master_out_sub0.e tosub_master_out_sub1.e' - #deleted = 'Need to finish implementaiton - refs #1913' [../] [./fromsub] @@ -11,4 +10,10 @@ input = 'fromsub_master.i' exodiff = 'fromsub_master_out.e' [../] + + [./high_order] + type = 'Exodiff' + input = 'high_order_master.i' + exodiff = 'high_order_master_out.e high_order_master_out_sub0.e' + [../] []