-
Notifications
You must be signed in to change notification settings - Fork 34
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
base: main
Are you sure you want to change the base?
Add runtime output for micromaterial #143
Conversation
843154e
to
88bc4f2
Compare
There was a problem hiding this 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.
src/core/io/src/4C_io_discretization_visualization_writer_mesh.hpp
Outdated
Show resolved
Hide resolved
src/core/io/src/4C_io_discretization_visualization_writer_mesh.hpp
Outdated
Show resolved
Hide resolved
src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_multiscale.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_multiscale.hpp
Outdated
Show resolved
Hide resolved
<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"/> |
There was a problem hiding this comment.
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?
tests/input_files/ref/sohex8_multiscale_macro/xxx-vtk-files/structure-00000-0.vtu
Outdated
Show resolved
Hide resolved
src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_multiscale.cpp
Show resolved
Hide resolved
@@ -242,6 +242,54 @@ void Mat::MicroMaterial::prepare_output() | |||
actmicromatgp->prepare_output(); | |||
} | |||
} |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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?!
src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_multiscale.cpp
Outdated
Show resolved
Hide resolved
0af33f6
to
36565a9
Compare
There was a problem hiding this 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
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.
Description and Context
This pull request introduces runtime output functionality for the micro-discretization in the
MAT_Struct_Multiscale
material model. The newRUNTIMEOUTPUT_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.