Skip to content

Commit

Permalink
FEM: vtk post processing, fix result type names in linearization plot
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 24, 2019
1 parent 499703b commit f445e34
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/Mod/Fem/Gui/Command.cpp
Expand Up @@ -1324,11 +1324,21 @@ void CmdFemPostLinearizedStressesFilter::activated(int)
if (DataAlongLineFilter.match()) {
Fem::FemPostDataAlongLineFilter* DataAlongLine = static_cast<Fem::FemPostDataAlongLineFilter*>(DataAlongLineFilter.Result[0][0].getObject());
std::string FieldName = DataAlongLine->PlotData.getValue();
if ((FieldName == "Max shear stress (Tresca)") || (FieldName == "Maximum Principal stress") || (FieldName == "Minimum Principal stress") || (FieldName == "Von Mises stress")) {
doCommand(Gui::Command::Doc,"t_coords = App.ActiveDocument.DataAlongLine.XAxisData");
doCommand(Gui::Command::Doc,"sValues = App.ActiveDocument.DataAlongLine.YAxisData");
doCommand(Gui::Command::Doc, Plot().c_str());
} else {
if (
(FieldName == "Tresca Stress")
|| (FieldName == "von Mises Stress")
|| (FieldName == "Major Principal Stress")
|| (FieldName == "Intermediate Principal Stress")
|| (FieldName == "Minor Principal Stress")
// names need to match with names in FemVTKTools.cpp, this is not fail save, but ATM there is no better way for test on a stress result in vtk pipeline

This comment has been minimized.

Copy link
@luzpaz

luzpaz Jun 24, 2019

Contributor

@berndhahnebach fail save? perhaps you meant failsafe?

This comment has been minimized.

Copy link
@berndhahnebach

berndhahnebach Jun 25, 2019

Author Contributor

You are right!

This comment has been minimized.

Copy link
@berndhahnebach

berndhahnebach Jun 25, 2019

Author Contributor
){
// TODO FIXME only works if the data along the line object has the name DataAlongLine
// we should get the selected data along the line object
doCommand(Gui::Command::Doc,"t_coords = App.ActiveDocument.DataAlongLine.XAxisData");
doCommand(Gui::Command::Doc,"sValues = App.ActiveDocument.DataAlongLine.YAxisData");
doCommand(Gui::Command::Doc, Plot().c_str());
}
else {
QMessageBox::warning(Gui::getMainWindow(),
qApp->translate("CmdFemPostLinearizedStressesFilter", "Wrong selection"),
qApp->translate("CmdFemPostLinearizedStressesFilter", "Select a Clip filter which clips a STRESS field along a line, please."));
Expand Down

0 comments on commit f445e34

Please sign in to comment.