FEM: code formating, white spaces
This commit is contained in:
parent
e38d0ada6c
commit
2cdaba4b89
|
@ -249,7 +249,7 @@ private:
|
|||
#ifdef FC_USE_VTK
|
||||
Py::Object readResult(const Py::Tuple& args)
|
||||
{
|
||||
char* fileName = NULL;
|
||||
char* fileName = NULL;
|
||||
char* objName = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args.ptr(), "et|et","utf-8", &fileName, "utf-8", &objName))
|
||||
|
|
|
@ -42,7 +42,7 @@ using namespace Fem;
|
|||
|
||||
PROPERTY_SOURCE(Fem::ConstraintFluidBoundary, Fem::Constraint);
|
||||
|
||||
// also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py,
|
||||
// also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py,
|
||||
// update simultaneously
|
||||
// the second (index 1) item is the default enum, as index 0 causes compiling error
|
||||
static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", NULL};
|
||||
|
@ -56,8 +56,8 @@ static const char* FreestreamSubtypes[] = {"unspecific", "freestream",NULL};
|
|||
static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",NULL};
|
||||
/* only used in TaskPanel
|
||||
static const char* TurbulenceSpecificationHelpTexts[] = {
|
||||
* "see Ansys fluet manual: Turbulence Specification method",
|
||||
* "not specified, solver will guess a value based e.g. 0.05 for inlet",
|
||||
* "see Ansys fluet manual: Turbulence Specification method",
|
||||
* "not specified, solver will guess a value based e.g. 0.05 for inlet",
|
||||
* "or fully devloped internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL};
|
||||
*/
|
||||
|
||||
|
@ -65,7 +65,7 @@ static const char* TurbulenceSpecificationHelpTexts[] = {
|
|||
// also defined in FoamCaseBuilder/HeatTransferBuilder.py, update simultaneously
|
||||
static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "HTC","coupled", NULL};
|
||||
/* only used in TaskPanel
|
||||
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [W/m2]",
|
||||
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [W/m2]",
|
||||
"mixed fixedGradient and fixedValue", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL};
|
||||
*/
|
||||
|
||||
|
@ -126,7 +126,7 @@ void ConstraintFluidBoundary::onChanged(const App::Property* prop)
|
|||
// Note: If we call this at the end, then the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
Constraint::onChanged(prop);
|
||||
|
||||
|
||||
if (prop == &BoundaryType) {
|
||||
std::string boundaryType = BoundaryType.getValueAsString();
|
||||
if (boundaryType == "wall") {
|
||||
|
|
|
@ -45,12 +45,12 @@ public:
|
|||
App::PropertyEnumeration BoundaryType;
|
||||
App::PropertyEnumeration Subtype;
|
||||
App::PropertyFloat BoundaryValue;
|
||||
App::PropertyLinkSub Direction;
|
||||
|
||||
App::PropertyLinkSub Direction;
|
||||
|
||||
App::PropertyEnumeration TurbulenceSpecification;
|
||||
App::PropertyFloat TurbulentIntensityValue;
|
||||
App::PropertyFloat TurbulentLengthValue;
|
||||
|
||||
|
||||
App::PropertyEnumeration ThermalBoundaryType;
|
||||
App::PropertyFloat TemperatureValue;
|
||||
App::PropertyFloat HeatFluxValue;
|
||||
|
|
|
@ -35,7 +35,7 @@ class AppFemExport ConstraintTransform : public Fem::Constraint
|
|||
public:
|
||||
/// Constructor
|
||||
ConstraintTransform(void);
|
||||
|
||||
|
||||
// Read-only (calculated values). These trigger changes in the ViewProvider
|
||||
App::PropertyLinkSubList RefDispl;
|
||||
App::PropertyLinkList NameDispl;
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
/// User defined results
|
||||
App::PropertyFloatList Stats;
|
||||
/// Displacement vectors of analysis
|
||||
|
||||
|
||||
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
|
|
|
@ -534,7 +534,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
|
|||
else
|
||||
{
|
||||
Base::Console().Log("the active object is not the correct type, do nothing\n");
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -546,8 +546,8 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
|
|||
// PropertyLink is the property type to store DocumentObject pointer
|
||||
|
||||
vtkSmartPointer<vtkPointData> pd = dataset->GetPointData();
|
||||
vtkSmartPointer<vtkDataArray> displ = pd->GetArray("Displacement"); // name in vtk file, not the property name
|
||||
vtkSmartPointer<vtkDataArray> vel = pd->GetArray("U"); // name in vtk file, not the property name
|
||||
vtkSmartPointer<vtkDataArray> displ = pd->GetArray("Displacement"); // name in vtk file, not the property name
|
||||
vtkSmartPointer<vtkDataArray> vel = pd->GetArray("U"); // name in vtk file, not the property name
|
||||
if(vel)
|
||||
{
|
||||
importFluidicResult(dataset, result);
|
||||
|
@ -568,7 +568,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
|
|||
|
||||
|
||||
void FemVTKTools::writeResult(const char* filename, const App::DocumentObject* res) {
|
||||
if (!res)
|
||||
if (!res)
|
||||
{
|
||||
App::Document* pcDoc = App::GetApplication().getActiveDocument();
|
||||
if(!pcDoc)
|
||||
|
@ -631,7 +631,7 @@ void _calcStat(const std::vector<Base::Vector3d>& vel, std::vector<double>& stat
|
|||
double vmin=1.0e100, vmean=0.0, vmax=-1.0e100;
|
||||
//stat of Vx, Vy, Vz is not necessary
|
||||
double vmins[3] = {1.0e100, 1.0e100, 1.0e100}; // set up a very big positive float then reduce it
|
||||
double vmeans[3] = {0.0, 0.0, 0.0};
|
||||
double vmeans[3] = {0.0, 0.0, 0.0};
|
||||
double vmaxs[3] = {-1.0e100, -1.0e100, -1.0e100};
|
||||
for(std::vector<Base::Vector3d>::const_iterator it=vel.begin(); it!=vel.end(); ++it) {
|
||||
double p[] = {it->x, it->y, it->z};
|
||||
|
@ -734,7 +734,7 @@ void _importResult(const vtkSmartPointer<vtkDataSet> dataset, App::DocumentObjec
|
|||
vtkDataArray* vec = vtkDataArray::SafeDownCast(pd->GetArray(kv.second.c_str())); // name from OpenFOAM/Fem solver export
|
||||
if(!vec)
|
||||
vec = vtkDataArray::SafeDownCast(pd->GetArray(kv.first.c_str())); // name from FreeCAD export
|
||||
if(nPoints && vec && vec->GetNumberOfComponents() == 1) {
|
||||
if(nPoints && vec && vec->GetNumberOfComponents() == 1) {
|
||||
App::PropertyFloatList* field = static_cast<App::PropertyFloatList*>(res->getPropertyByName(kv.first.c_str()));
|
||||
if (!field) {
|
||||
Base::Console().Error("static_cast<App::PropertyFloatList*>((res->getPropertyByName(\"%s\")) failed \n", kv.first.c_str());
|
||||
|
@ -766,7 +766,7 @@ void _importResult(const vtkSmartPointer<vtkDataSet> dataset, App::DocumentObjec
|
|||
|
||||
}
|
||||
|
||||
void _exportResult(const App::DocumentObject* result, vtkSmartPointer<vtkDataSet> grid,
|
||||
void _exportResult(const App::DocumentObject* result, vtkSmartPointer<vtkDataSet> grid,
|
||||
const std::map<std::string, std::string>& vectors, const std::map<std::string, std::string> scalers,
|
||||
const std::string& essential_property){
|
||||
|
||||
|
@ -788,7 +788,7 @@ void _exportResult(const App::DocumentObject* result, vtkSmartPointer<vtkDataSet
|
|||
field = static_cast<App::PropertyVectorList*>(res->getPropertyByName(kv.first.c_str()));
|
||||
else
|
||||
Base::Console().Error("PropertyVectorList %s not found \n", kv.first.c_str());
|
||||
if(field && field->getValues().size()>1) { // FreeCAD property list
|
||||
if(field && field->getValues().size()>1) { // FreeCAD property list
|
||||
const std::vector<Base::Vector3d>& vel = field->getValues();
|
||||
vtkSmartPointer<vtkDoubleArray> data = vtkSmartPointer<vtkDoubleArray>::New();
|
||||
if(nPoints != field->getSize())
|
||||
|
@ -905,7 +905,7 @@ void FemVTKTools::importMechanicalResult(vtkSmartPointer<vtkDataSet> dataset, Ap
|
|||
vectors["DisplacementVectors"] = "Displacement";
|
||||
vectors["StrainVectors"] = "Strain vectors";
|
||||
vectors["StressVectors"] = "Stress vectors";
|
||||
std::map<std::string, std::string> scalers; // App::FloatListProperty name -> vtk name
|
||||
std::map<std::string, std::string> scalers; // App::FloatListProperty name -> vtk name
|
||||
scalers["UserDefined"] = "User Defined Results";
|
||||
scalers["Temperature"] = "Temperature";
|
||||
scalers["PrincipalMax"] = "Maximum Principal stress";
|
||||
|
@ -943,7 +943,7 @@ void FemVTKTools::exportMechanicalResult(const App::DocumentObject* res, vtkSmar
|
|||
vectors["DisplacementVectors"] = "Displacement";
|
||||
vectors["StrainVectors"] = "Strain vectors";
|
||||
vectors["StressVectors"] = "Stress vectors";
|
||||
std::map<std::string, std::string> scalers; // App::FloatListProperty name -> vtk name
|
||||
std::map<std::string, std::string> scalers; // App::FloatListProperty name -> vtk name
|
||||
scalers["UserDefined"] = "User Defined Results";
|
||||
scalers["Temperature"] = "Temperature";
|
||||
scalers["PrincipalMax"] = "Maximum Principal stress";
|
||||
|
|
|
@ -49,15 +49,15 @@ namespace Fem
|
|||
static void importVTKMesh(vtkSmartPointer<vtkDataSet> grid, FemMesh* mesh, float scale = 1.0);
|
||||
/*!
|
||||
FemMesh read from vtkUnstructuredGrid data file
|
||||
*/
|
||||
*/
|
||||
static FemMesh* readVTKMesh(const char* filename, FemMesh* mesh);
|
||||
/*!
|
||||
FemMesh export to vtkUnstructuredGrid instance
|
||||
*/
|
||||
*/
|
||||
static void exportVTKMesh(const FemMesh* mesh, vtkSmartPointer<vtkUnstructuredGrid> grid, float scale = 1.0);
|
||||
/*!
|
||||
FemMesh write to vtkUnstructuredGrid data file
|
||||
*/
|
||||
*/
|
||||
static void writeVTKMesh(const char* Filename, const FemMesh* mesh);
|
||||
|
||||
/*!
|
||||
|
@ -65,7 +65,7 @@ namespace Fem
|
|||
*/
|
||||
static void importFluidicResult(vtkSmartPointer<vtkDataSet> dataset, App::DocumentObject* res);
|
||||
static void importMechanicalResult(vtkSmartPointer<vtkDataSet> dataset, App::DocumentObject* res);
|
||||
|
||||
|
||||
/*!
|
||||
* FemResult export to vtkUnstructuredGrid object
|
||||
*/
|
||||
|
@ -76,14 +76,14 @@ namespace Fem
|
|||
* FemResult (activeObject or created if res= NULL) read from vtkUnstructuredGrid dataset file
|
||||
*/
|
||||
static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = NULL);
|
||||
|
||||
|
||||
/*!
|
||||
* write FemResult (activeObject if res= NULL) to vtkUnstructuredGrid dataset file
|
||||
*/
|
||||
*/
|
||||
static void writeResult(const char* filename, const App::DocumentObject* res = NULL);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif //FEM_VTK_TOOLS_H
|
||||
|
||||
|
||||
|
|
|
@ -1532,7 +1532,7 @@ void CmdFemPostPipelineFromResult::activated(int)
|
|||
Fem::FemResultObject* result = static_cast<Fem::FemResultObject*>(ResultFilter.Result[0][0].getObject());
|
||||
//static_cast failed here
|
||||
Base::Console().Message("Debug: FemResultObject pointer = %p", result );
|
||||
|
||||
|
||||
*/
|
||||
App::Document* pcDoc = App::GetApplication().getActiveDocument();
|
||||
if(!pcDoc)
|
||||
|
|
|
@ -85,19 +85,19 @@ static const char* InterfaceSubtypeHelpTexts[] = {
|
|||
"front and back for single layer 2D mesh, also axis-sym axis line",
|
||||
"exchange boundary vale with external program, need extra manual setup like file name", NULL};
|
||||
|
||||
// defined in file FemConstraintFluidBoundary:
|
||||
// defined in file FemConstraintFluidBoundary:
|
||||
// see Ansys fluet manual: Turbulence Specification method
|
||||
//static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio", "intensity&HydraulicDiameter",NULL};
|
||||
//activate the heat transfer and radiation model in Solver object explorer
|
||||
static const char* TurbulenceSpecificationHelpTexts[] = {
|
||||
"explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []",
|
||||
"explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []",
|
||||
"intensity (0.05 ~ 0.15) and characteristic length scale of max eddy [m]",
|
||||
"intensity (0.05 ~ 0.15) and turbulent viscosity ratio",
|
||||
"for fully devloped internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL};
|
||||
|
||||
//static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL};
|
||||
//const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "coupled",NULL};
|
||||
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer on boundary()", "fixed value gradient [W/m]",
|
||||
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer on boundary()", "fixed value gradient [W/m]",
|
||||
"mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL};
|
||||
// enable & disable quantityUI once valueType is selected
|
||||
|
||||
|
@ -105,7 +105,7 @@ static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no he
|
|||
void initComboBox(QComboBox* combo, const std::vector<std::string>& textItems, const char* sItem)
|
||||
{
|
||||
combo->blockSignals(true);
|
||||
|
||||
|
||||
int iItem = 1; // the first one is "unspecific" (index 0)
|
||||
combo->clear();
|
||||
for (unsigned int it = 0; it < textItems.size(); it++)
|
||||
|
@ -143,12 +143,12 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
this, SLOT(onSubtypeChanged(void)));
|
||||
connect(ui->spinBoundaryValue, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onBoundaryValueChanged(double)));
|
||||
|
||||
|
||||
connect(ui->comboTurbulenceSpecification, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onTurbulenceSpecificationChanged(void)));
|
||||
connect(ui->comboThermalBoundaryType, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onThermalBoundaryTypeChanged(void)));
|
||||
|
||||
|
||||
connect(ui->buttonReference, SIGNAL(pressed()),
|
||||
this, SLOT(onButtonReference()));
|
||||
connect(ui->buttonDirection, SIGNAL(pressed()),
|
||||
|
@ -161,14 +161,14 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
// Temporarily prevent unnecessary feature recomputes
|
||||
ui->spinBoundaryValue->blockSignals(true);
|
||||
ui->listReferences->blockSignals(true);
|
||||
|
||||
|
||||
ui->buttonReference->blockSignals(true);
|
||||
ui->buttonDirection->blockSignals(true);
|
||||
ui->checkReverse->blockSignals(true);
|
||||
|
||||
// Get the feature data
|
||||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
|
||||
|
||||
Fem::FemSolverObject* pcSolver = NULL;
|
||||
if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) {
|
||||
Fem::FemAnalysis* pcAnalysis = FemGui::ActiveAnalysisObserver::instance()->getActiveObject();
|
||||
|
@ -187,14 +187,14 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
pHeatTransfering = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransfering"));
|
||||
if (pHeatTransfering->getValue()) {
|
||||
ui->tabThermalBoundary->setEnabled(true);
|
||||
initComboBox(ui->comboThermalBoundaryType, pcConstraint->ThermalBoundaryType.getEnumVector(),
|
||||
initComboBox(ui->comboThermalBoundaryType, pcConstraint->ThermalBoundaryType.getEnumVector(),
|
||||
pcConstraint->ThermalBoundaryType.getValueAsString());
|
||||
updateThermalBoundaryUI();
|
||||
updateThermalBoundaryUI();
|
||||
}
|
||||
else {
|
||||
ui->tabThermalBoundary->setEnabled(false);
|
||||
//Base::Console().Message("retrieve solver property HeatTransfering as false\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->tabThermalBoundary->setEnabled(false);
|
||||
|
@ -208,9 +208,9 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
ui->tabTurbulenceBoundary->setEnabled(true);
|
||||
ui->labelTurbulenceSpecification->setText(Base::Tools::fromStdString(
|
||||
pTurbulenceModel->getValueAsString()));
|
||||
initComboBox(ui->comboTurbulenceSpecification, pcConstraint->TurbulenceSpecification.getEnumVector(),
|
||||
initComboBox(ui->comboTurbulenceSpecification, pcConstraint->TurbulenceSpecification.getEnumVector(),
|
||||
pcConstraint->TurbulenceSpecification.getValueAsString());
|
||||
updateTurbulenceUI();
|
||||
updateTurbulenceUI();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -226,11 +226,11 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
ui->tabWidget->setCurrentIndex(0);
|
||||
ui->labelHelpText->setText(tr("select boundary type, faces and set value"));
|
||||
|
||||
initComboBox(ui->comboBoundaryType, pcConstraint->BoundaryType.getEnumVector(),
|
||||
initComboBox(ui->comboBoundaryType, pcConstraint->BoundaryType.getEnumVector(),
|
||||
pcConstraint->BoundaryType.getValueAsString());
|
||||
updateBoundaryTypeUI();
|
||||
//updateSubtypeUI(); // already called inside updateBoundaryTypeUI();
|
||||
|
||||
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
std::vector<std::string> dirStrings = pcConstraint->Direction.getSubValues();
|
||||
|
@ -264,7 +264,7 @@ void TaskFemConstraintFluidBoundary::updateBoundaryTypeUI()
|
|||
{
|
||||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
|
||||
|
||||
|
||||
// Update subtypes, any change here should be written back to FemConstraintFluidBoundary.cpp
|
||||
if (boundaryType == "wall") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("velocity (m/s)"));
|
||||
|
@ -300,7 +300,7 @@ void TaskFemConstraintFluidBoundary::updateBoundaryTypeUI()
|
|||
}
|
||||
//std::string subtypeLabel = boundaryType + std::string(" type");
|
||||
//ui->labelSubtype->setText(QString::fromUtf8(subtypeLabel)); // too long to show in UI
|
||||
|
||||
|
||||
//set subType to default one, the second one as in ConstraintFluidBoundary
|
||||
ui->comboSubtype->setCurrentIndex(1); // each boundary type must have at least 2 subtypes
|
||||
std::vector<std::string> subtypes = pcConstraint->Subtype.getEnumVector();
|
||||
|
@ -315,9 +315,9 @@ void TaskFemConstraintFluidBoundary::updateSubtypeUI()
|
|||
|
||||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
//* Subtype PropertyEnumeration is updated if BoundaryType is changed
|
||||
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
|
||||
std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText());
|
||||
|
||||
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
|
||||
std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText());
|
||||
|
||||
if (boundaryType == "inlet" || boundaryType == "outlet") {
|
||||
ui->tabBasicBoundary->setEnabled(true);
|
||||
if (subtype == "totalPressure" || subtype == "staticPressure"){
|
||||
|
@ -373,7 +373,7 @@ void TaskFemConstraintFluidBoundary::updateSubtypeUI()
|
|||
int iInterface = ui->comboSubtype->currentIndex();
|
||||
ui->labelHelpText->setText(tr(InterfaceSubtypeHelpTexts[iInterface]));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// hide/disable UI only happend in constructor, update helptext and valuetext here
|
||||
|
@ -398,7 +398,7 @@ void TaskFemConstraintFluidBoundary::updateSelectionUI()
|
|||
onButtonReference(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/** not needed for fluid boundary, as it must be Face for 3D part,
|
||||
* Edge type boundary is needed for 2D CFD, but it is not supported yet
|
||||
std::string ref = ui->listReferences->item(0)->text().toStdString();
|
||||
|
@ -498,10 +498,10 @@ void TaskFemConstraintFluidBoundary::onSelectionChanged(const Gui::SelectionChan
|
|||
void TaskFemConstraintFluidBoundary::onBoundaryTypeChanged(void)
|
||||
{
|
||||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex());
|
||||
pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex());
|
||||
updateBoundaryTypeUI();
|
||||
ConstraintView->updateData(&pcConstraint->BoundaryType); //force a 3D redraw
|
||||
// bug: cube normal is not correct in redraw, redraw is correct only after close task panel
|
||||
// bug: cube normal is not correct in redraw, redraw is correct only after close task panel
|
||||
// see note of If ConstraintView->updateData(): the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ void TaskFemConstraintFluidBoundary::changeEvent(QEvent *e)
|
|||
ui->spinBoundaryValue->blockSignals(true);
|
||||
//more ui widget? those UI are does not support tr yet!
|
||||
ui->retranslateUi(proxy);
|
||||
|
||||
|
||||
ui->spinBoundaryValue->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
|
|||
name.c_str(), boundary->getSubtype().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.BoundaryValue = %f",
|
||||
name.c_str(), boundary->getBoundaryValue());
|
||||
|
||||
|
||||
std::string dirname = boundary->getDirectionName().data();
|
||||
std::string dirobj = boundary->getDirectionObject().data();
|
||||
|
||||
|
@ -726,7 +726,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
|
|||
}
|
||||
//Reverse control is done at BoundaryType selection, this UI is hiden from user
|
||||
//Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), boundary->getReverse() ? "True" : "False");
|
||||
|
||||
|
||||
std::string scale = "1";
|
||||
scale = boundary->getScale(); //OvG: determine modified scale
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Scale = %s", name.c_str(), scale.c_str()); //OvG: implement modified scale
|
||||
|
@ -747,7 +747,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
|
|||
App::PropertyEnumeration* pTurbulenceModel = NULL;
|
||||
pHeatTransfering = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransfering"));
|
||||
pTurbulenceModel = static_cast<App::PropertyEnumeration*>(pcSolver->getPropertyByName("TurbulenceModel"));
|
||||
|
||||
|
||||
if (pHeatTransfering && pHeatTransfering->getValue()) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.ThermalBoundaryType = '%s'",name.c_str(), boundary->getThermalBoundaryType().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TemperatureValue = %f",name.c_str(), boundary->getTemperatureValue());
|
||||
|
|
|
@ -55,18 +55,18 @@ public:
|
|||
std::string getBoundaryType(void) const;
|
||||
std::string getSubtype(void) const;
|
||||
double getBoundaryValue(void) const;
|
||||
|
||||
|
||||
std::string getTurbulenceModel(void) const;
|
||||
std::string getTurbulenceSpecification(void) const;
|
||||
double getTurbulentIntensityValue(void) const;
|
||||
double getTurbulentLengthValue(void) const;
|
||||
|
||||
|
||||
bool getHeatTransfering(void) const;
|
||||
std::string getThermalBoundaryType(void) const;
|
||||
double getTemperatureValue(void) const;
|
||||
double getHeatFluxValue(void) const;
|
||||
double getHTCoeffValue(void) const;
|
||||
|
||||
|
||||
virtual const std::string getReferences() const;
|
||||
const std::string getDirectionName(void) const;
|
||||
const std::string getDirectionObject(void) const;
|
||||
|
|
|
@ -243,8 +243,8 @@ void TaskFemConstraintTransform::addToSelection()
|
|||
QMessageBox::warning(this, tr("Selection error"), tr("Only one face for rectangular transform constraint!"));
|
||||
Gui::Selection().clearSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((rows==0) && (selection.size()>=2)){
|
||||
QMessageBox::warning(this, tr("Selection error"), tr("Only one face for rectangular transform constraint!"));
|
||||
Gui::Selection().clearSelection();
|
||||
|
@ -254,7 +254,7 @@ void TaskFemConstraintTransform::addToSelection()
|
|||
Fem::ConstraintTransform* pcConstraint = static_cast<Fem::ConstraintTransform*>(ConstraintView->getObject());
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
|
||||
|
||||
std::vector<App::DocumentObject*> ObjDispl = pcConstraint->RefDispl.getValues();
|
||||
std::vector<std::string> SubElemDispl = pcConstraint->RefDispl.getSubValues();
|
||||
for (std::vector<Gui::SelectionObject>::iterator it = selection.begin(); it != selection.end(); ++it){//for every selected object
|
||||
|
@ -300,7 +300,7 @@ void TaskFemConstraintTransform::addToSelection()
|
|||
this, SLOT(setSelection(QListWidgetItem*)));
|
||||
for (std::size_t i = 0; i < ObjDispl.size(); i++) {
|
||||
if ((makeRefText(ObjDispl[i], SubElemDispl[i]))==(makeRefText(obj, subNames[subIt]))){
|
||||
Objects.push_back(obj);
|
||||
Objects.push_back(obj);
|
||||
SubElements.push_back(subNames[subIt]);
|
||||
ui->lw_Rect->addItem(makeRefText(obj, subNames[subIt]));
|
||||
connect(ui->lw_Rect, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
||||
|
@ -310,7 +310,7 @@ void TaskFemConstraintTransform::addToSelection()
|
|||
if (Objects.size() == 0){
|
||||
QMessageBox::warning(this, tr("Selection error"), tr("Only transformable faces can be selected! Apply displacement constraint to surface first then apply constraint to surface"));
|
||||
Gui::Selection().clearSelection();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ bool TaskDlgFemConstraintTransform::accept()
|
|||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y_rot = %f",
|
||||
name.c_str(), parameters->get_Y_rot());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Z_rot = %f",
|
||||
name.c_str(), parameters->get_Z_rot());
|
||||
name.c_str(), parameters->get_Z_rot());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TransformType = %s",
|
||||
name.c_str(), parameters->get_transform_type().c_str());
|
||||
std::string scale = parameters->getScale(); //OvG: determine modified scale
|
||||
|
|
|
@ -145,7 +145,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
|
|||
FaceColor.setValue(0.0,0.0,1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (boundaryType == "inlet" || boundaryType == "outlet"){
|
||||
#ifdef USE_MULTIPLE_COPY
|
||||
//OvG: need access to cp for scaling
|
||||
|
|
|
@ -45,7 +45,7 @@ ViewProviderResult::~ViewProviderResult()
|
|||
|
||||
}
|
||||
|
||||
/* not needed since _ViewProviderFemResult.py is made
|
||||
/* not needed since _ViewProviderFemResult.py is made
|
||||
bool ViewProviderResult::doubleClicked(void)
|
||||
{
|
||||
Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Fem_ShowResult')");
|
||||
|
|
|
@ -53,7 +53,7 @@ Workbench::~Workbench()
|
|||
void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) const
|
||||
{
|
||||
StdWorkbench::setupContextMenu( recipient, item );
|
||||
*item << "Separator"
|
||||
*item << "Separator"
|
||||
<< "Fem_ClearMesh"
|
||||
<< "Fem_PrintMeshInfo";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user