File tree Expand file tree Collapse file tree 2 files changed +16
-29
lines changed
source/simulator/assemblers Expand file tree Collapse file tree 2 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -464,13 +464,14 @@ namespace aspect
464464 if (enable_prescribed_dilation)
465465 {
466466 const unsigned int index_direction=fe.system_to_component_index (i).first ;
467- data.local_rhs (i) += (
468- - pressure_scaling
469- * (prescribed_dilation->dilation_rhs_term [index_direction][q] -
470- prescribed_dilation->dilation_lhs_term [q] *
471- scratch.material_model_inputs .pressure [q])
472- * scratch.phi_p [i]
473- ) * JxW;
467+ if (index_direction < dim)
468+ data.local_rhs (i) += (
469+ - pressure_scaling
470+ * (prescribed_dilation->dilation_rhs_term [index_direction][q] -
471+ prescribed_dilation->dilation_lhs_term [q] *
472+ scratch.material_model_inputs .pressure [q])
473+ * scratch.phi_p [i]
474+ ) * JxW;
474475 }
475476 }
476477
Original file line number Diff line number Diff line change @@ -458,31 +458,17 @@ namespace aspect
458458 if (introspection.is_stokes_component (index_direction+1 ))
459459 {
460460 const unsigned int index_direction=fe.system_to_component_index (i).first ;
461- data.local_rhs (i) += (
462- - pressure_scaling
463- * (prescribed_dilation->dilation_rhs_term [index_direction][q] -
464- prescribed_dilation->dilation_lhs_term [q] *
465- scratch.material_model_inputs .pressure [q])
466- * scratch.phi_p [i]
467- ) * JxW;
461+ if (index_direction < dim)
462+ data.local_rhs (i) += (
463+ - pressure_scaling
464+ * (prescribed_dilation->dilation_rhs_term [index_direction][q] -
465+ prescribed_dilation->dilation_lhs_term [q] *
466+ scratch.material_model_inputs .pressure [q])
467+ * scratch.phi_p [i]
468+ ) * JxW;
468469 }
469470 }
470471
471- // Only assemble this term if we are running incompressible, otherwise this term
472- // is already included on the LHS of the equation.
473- if (prescribed_dilation != nullptr && !material_model_is_compressible)
474- {
475- const unsigned int index_direction=fe.system_to_component_index (i).first ;
476- // Only want the velocity components and not the pressure one (which is the last one), so add 1
477- if (introspection.is_stokes_component (index_direction+1 ))
478- data.local_rhs (i) += (
479- // RHS of momentum eqn: - \int 2/3 eta R, div v
480- - 2.0 / 3.0 * eta
481- * prescribed_dilation->dilation_rhs_term [index_direction][q]
482- * scratch.div_phi_u [i]
483- ) * JxW;
484- }
485-
486472 if (scratch.rebuild_stokes_matrix )
487473 for (unsigned int j=0 ; j<stokes_dofs_per_cell; ++j)
488474 {
You can’t perform that action at this time.
0 commit comments