Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for J2 plasticity #243

Merged
merged 5 commits into from
Dec 1, 2023
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
26 changes: 17 additions & 9 deletions application/adamantine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <deal.II/base/index_set.h>
#include <deal.II/base/mpi.h>
#include <deal.II/base/symmetric_tensor.h>
#include <deal.II/base/types.h>
#include <deal.II/distributed/cell_data_transfer.templates.h>
#include <deal.II/distributed/solution_transfer.h>
Expand Down Expand Up @@ -66,8 +67,8 @@ void output_pvtu(
&temperature,
std::unique_ptr<adamantine::MechanicalPhysics<dim, MemorySpaceType>> const
&mechanical_physics,
[[maybe_unused]] dealii::LA::distributed::Vector<
double, dealii::MemorySpace::Host> &displacement,
dealii::LA::distributed::Vector<double, dealii::MemorySpace::Host>
&displacement,
adamantine::MaterialProperty<dim, MemorySpaceType> const
&material_properties,
std::vector<adamantine::Timer> &timers)
Expand All @@ -83,6 +84,7 @@ void output_pvtu(
{
mechanical_physics->get_affine_constraints().distribute(displacement);
post_processor.write_output(n_time_step, time, temperature, displacement,
mechanical_physics->get_stress_tensor(),
material_properties.get_state(),
material_properties.get_dofs_map(),
material_properties.get_dof_handler());
Expand All @@ -99,8 +101,9 @@ void output_pvtu(
{
mechanical_physics->get_affine_constraints().distribute(displacement);
post_processor.write_mechanical_output(
n_time_step, time, displacement, material_properties.get_state(),
material_properties.get_dofs_map(),
n_time_step, time, displacement,
mechanical_physics->get_stress_tensor(),
material_properties.get_state(), material_properties.get_dofs_map(),
material_properties.get_dof_handler());
}
timers[adamantine::output].stop();
Expand Down Expand Up @@ -147,10 +150,11 @@ void output_pvtu(
if (mechanical_physics)
{
mechanical_physics->get_affine_constraints().distribute(displacement);
post_processor.write_output(n_time_step, time, temperature_host,
displacement, state_host_view,
material_properties.get_dofs_map(),
material_properties.get_dof_handler());
post_processor.write_output(
n_time_step, time, temperature_host, displacement,
mechanical_physics->get_stress_tensor(), state_host_view,
material_properties.get_dofs_map(),
material_properties.get_dof_handler());
}
else
{
Expand All @@ -164,7 +168,8 @@ void output_pvtu(
{
mechanical_physics->get_affine_constraints().distribute(displacement);
post_processor.write_mechanical_output(
n_time_step, time, displacement, state_host_view,
n_time_step, time, displacement,
mechanical_physics->get_stress_tensor(), state_host_view,
material_properties.get_dofs_map(),
material_properties.get_dof_handler());
}
Expand Down Expand Up @@ -358,6 +363,9 @@ void refine_and_transfer(
CALI_CXX_MARK_FUNCTION;
#endif

// TODO transfer mechanical data is present, need to be aware that the data
// does not exist on some cells because it's liquid

dealii::parallel::distributed::Triangulation<dim> &triangulation =
dynamic_cast<dealii::parallel::distributed::Triangulation<dim> &>(
const_cast<dealii::Triangulation<dim> &>(
Expand Down
5 changes: 5 additions & 0 deletions source/MaterialProperty.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public:
dealii::parallel::distributed::Triangulation<dim> const &tria,
boost::property_tree::ptree const &database);

/**
* Delete the copy constructor.
*/
MaterialProperty(MaterialProperty const &) = delete;

/**
* Return true if the material properties are given in table format. Return
* false if they are given in polynomial format.
Expand Down
20 changes: 20 additions & 0 deletions source/MaterialProperty.templates.hh
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,26 @@ void MaterialProperty<dim, MemorySpaceType>::fill_properties(
}
}
}
else if (state_property_names[p] == "elastic_limit")
{
// If the elastic limit is not provided, we solve a purely elastic
// problem. We set the elastic limit to infinity.
double infinity = std::numeric_limits<double>::infinity();
if (_use_table)
{
mechanical_property_tables_host_view(
material_id, p - g_n_thermal_state_properties, 0, 0) =
infinity;
mechanical_property_tables_host_view(
material_id, p - g_n_thermal_state_properties, 0, 1) =
infinity;
}
else
{
mechanical_property_polynomials_host_view(
material_id, p - g_n_thermal_state_properties, 0) = infinity;
}
}
}
}
}
Expand Down
Loading