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 runtime output for micromaterial #143

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

m-frey
Copy link

@m-frey m-frey commented Dec 10, 2024

Description and Context

This pull request introduces runtime output functionality for the micro-discretization in the MAT_Struct_Multiscale material model. The new RUNTIMEOUTPUT_GP flag allows controlled runtime output with the following options:

  • none: No runtime output.
  • all: Outputs runtime data for all Gauss points of elements using this material.
  • gp1: Outputs runtime data for the first Gauss point of elements using this material only.

Currently, only displacements are output. Additional outputs, including stress and strain, will be introduced in a subsequent merge request.

@m-frey m-frey self-assigned this Dec 10, 2024
@m-frey m-frey force-pushed the Add-runtime-output-micromaterial branch 2 times, most recently from 843154e to 88bc4f2 Compare December 10, 2024 13:24
Copy link
Contributor

@isteinbrecher isteinbrecher left a comment

Choose a reason for hiding this comment

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

@m-frey thanks for the contribution, I left some comments.

Copy link
Contributor

@isteinbrecher isteinbrecher left a comment

Choose a reason for hiding this comment

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

Thanks @m-frey for the changes and adding the test case, this for sure makes your implementation more future proof! I left some comments and some questions.

Comment on lines 7 to 30
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
<DataSet timestep="0.00000000000000e+00" group="" part="0" file="xxx-vtk-files/micro_model_1-00000.pvtu"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong to me. I think this will basically load xxx-vtk-files/micro_model_1-00000.pvtu 24 times in ParaView. Why do you need to reference the same file here multiple times?

@@ -242,6 +242,54 @@ void Mat::MicroMaterial::prepare_output()
actmicromatgp->prepare_output();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

The original method prepare_output() can be renamed to what you have introduced (prepare_runtime_output()). Additionally, add your break statement and you are done here.


if (params_->runtime_output_option_ == PAR::MicroMaterial::RuntimeOutputOption::gp1) break;
}
}

// output for all procs
void Mat::MicroMaterial::output_step_state()
Copy link
Member

Choose a reason for hiding this comment

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

output_step_state() should be obsolete with your implementations?!

@m-frey m-frey force-pushed the Add-runtime-output-micromaterial branch from 0af33f6 to 36565a9 Compare January 29, 2025 14:40
Copy link
Member

@sebproell sebproell left a comment

Choose a reason for hiding this comment

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

A few comments on the input parameters.

@@ -1585,6 +1586,14 @@ std::shared_ptr<std::vector<std::shared_ptr<Mat::MaterialDefinition>>> Global::v
m->add_component(
entry<double>("INITVOL", {.description = "Initial volume of RVE", .default_value = 0.0}));

m->add_component(selection<int>("RUNTIMEOUTPUT_GP",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
m->add_component(selection<int>("RUNTIMEOUTPUT_GP",
m->add_component(selection<Mat::PAR::MicroMaterial>("RUNTIMEOUTPUT_GP",

The new input mechanism allows to store the enum directly. Most cases we have in the code are not using that because this was not possible before.

@@ -29,6 +29,16 @@ Mat::PAR::MicroMaterial::MicroMaterial(const Core::Mat::PAR::Parameter::Data& ma
microdisnum_(matdata.parameters.get<int>("MICRODIS_NUM")),
initvol_(matdata.parameters.get<double>("INITVOL"))
{
int option = matdata.parameters.get<int>("RUNTIMEOUTPUT_GP");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
int option = matdata.parameters.get<int>("RUNTIMEOUTPUT_GP");
int option = matdata.parameters.get<Mat::PAR::MicroMaterial::RuntimeOutputOption>("RUNTIMEOUTPUT_GP");

@@ -33,6 +34,13 @@ namespace Mat
/// standard constructor
MicroMaterial(const Core::Mat::PAR::Parameter::Data& matdata);

//! action parameters recognized by ale3
enum RuntimeOutputOption
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
enum RuntimeOutputOption
enum class RuntimeOutputOption

{{"none", Mat::PAR::MicroMaterial::RuntimeOutputOption::none},
{"gp1", Mat::PAR::MicroMaterial::RuntimeOutputOption::gp1},
{"all", Mat::PAR::MicroMaterial::RuntimeOutputOption::all}},
{.description = "implementation type",
Copy link
Member

Choose a reason for hiding this comment

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

I think a better description is warranted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants