Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions ALE_Finite_Strain_Plasticity/src/NewtonStepSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,33 @@ namespace PlasticityLab {
dof_system.locally_owned_dofs,
mpi_communicator);
current_increment.reinit(
dof_system.locally_owned_dofs,
dof_system.locally_relevant_dofs,
mpi_communicator);
Newton_step_residual.reinit(
dof_system.locally_owned_dofs,
mpi_communicator);
previous_deformation.reinit(
dof_system.locally_owned_dofs,
dof_system.locally_relevant_dofs,
mpi_communicator);

previous_time_derivative.reinit(
dof_system.locally_owned_dofs,
dof_system.locally_relevant_dofs,
mpi_communicator);
previous_second_time_derivative.reinit(
dof_system.locally_owned_dofs,
dof_system.locally_relevant_dofs,
mpi_communicator);
Comment on lines 43 to 62

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly necessary, but we have been using the two-indexset form of these functions.


_locally_owned_current_increment.reinit(
dof_system.locally_owned_dofs,
mpi_communicator);
_locally_owned_previous_deformation.reinit(
dof_system.locally_owned_dofs,
mpi_communicator);

_locally_owned_previous_time_derivative.reinit(
dof_system.locally_owned_dofs,
mpi_communicator);
Expand Down Expand Up @@ -110,7 +121,19 @@ namespace PlasticityLab {
previous_second_time_derivative = _locally_owned_previous_second_time_derivative;

}
previous_deformation += current_increment;

// Update the deformation vector with the computed
// increment. Because 'previous_deformation' is a vector with
// ghost entries, it is a read-only vector and we cannot write
// into it -- so we have to create a temporary vector first and
// only copy it at the end:
{
_locally_owned_previous_deformation = previous_deformation;
_locally_owned_current_increment = current_increment;
_locally_owned_previous_deformation += _locally_owned_current_increment;
previous_deformation = _locally_owned_previous_deformation;
}

if(reset_increment) {
current_increment = 0;
}
Expand All @@ -125,9 +148,10 @@ namespace PlasticityLab {
TrilinosWrappers::MPI::Vector previous_time_derivative;
TrilinosWrappers::MPI::Vector previous_second_time_derivative;

TrilinosWrappers::MPI::Vector _locally_owned_previous_deformation;
TrilinosWrappers::MPI::Vector _locally_owned_current_increment;
TrilinosWrappers::MPI::Vector _locally_owned_previous_time_derivative;
TrilinosWrappers::MPI::Vector _locally_owned_previous_second_time_derivative;

};

} /* namespace PlasticityLab */
Expand Down
14 changes: 13 additions & 1 deletion ALE_Finite_Strain_Plasticity/src/PlasticityLabProgDrivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@ namespace PlasticityLab {
therm_lbc_system.apply_constraints(therm_dof_system);
therm_nonlinear_system.setup(therm_dof_system);

therm_nonlinear_system.previous_deformation = ambient_temperature;
// Initialize the temperature solution vector. Because we are
// initializing with a possibly non-zero value, we can't just
// assign that value to the vector in a parallel setting because
// the solution vector has ghost entries and so is
// read-only. Rather, we create a completely distributed vector,
// assign the value to it, and then copy that into the solution
// vector.
{
TrilinosWrappers::MPI::Vector tmp (therm_dof_system.locally_owned_dofs,
mpi_communicator);
tmp = ambient_temperature;
therm_nonlinear_system.previous_deformation = tmp;
}

mixed_fe_dof_system.setup_dof_system(mixed_var_fe);

Expand Down