Add Command and Icon FemConstraintFluidBoundary for CFD analysis

This commit is contained in:
qingfengxia 2016-08-10 15:34:37 +01:00 committed by wmayer
parent 17829b9727
commit 40243fc89a
5 changed files with 377 additions and 7 deletions

View File

@ -525,6 +525,52 @@ bool CmdFemConstraintForce::isActive(void)
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
}
//=====================================================================================
DEF_STD_CMD_A(CmdFemConstraintFluidBoundary);
CmdFemConstraintFluidBoundary::CmdFemConstraintFluidBoundary()
: Command("Fem_ConstraintFluidBoundary")
{
sAppModule = "Fem";
sGroup = QT_TR_NOOP("Fem");
sMenuText = QT_TR_NOOP("Create fluid condition condition");
sToolTipText = QT_TR_NOOP("Create fluid boundary condition on face entity");
sWhatsThis = "Fem_ConstraintFluidBoundary";
sStatusTip = sToolTipText;
sPixmap = "fem-constraint-fluid-boundary";
}
void CmdFemConstraintFluidBoundary::activated(int iMsg)
{
Fem::FemAnalysis *Analysis;
if(getConstraintPrerequisits(&Analysis))
return;
std::string FeatName = getUniqueObjectName("ConstraintFluidBoundary");
openCommand("Create fluid boundary condition on face geometry");
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintFluidBoundary\",\"%s\")",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Scale = 1",FeatName.c_str()); //OvG: set initial scale to 1
//BoundaryValue is already the default value
doCommand(Doc,"App.activeDocument().%s.Member = App.activeDocument().%s.Member + [App.activeDocument().%s]",
Analysis->getNameInDocument(),Analysis->getNameInDocument(),FeatName.c_str());
doCommand(Doc,"%s",gethideMeshShowPartStr(FeatName).c_str()); //OvG: Hide meshes and show parts
updateActive();
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
}
bool CmdFemConstraintFluidBoundary::isActive(void)
{
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
}
//=====================================================================================
DEF_STD_CMD_A(CmdFemConstraintPressure);
@ -1363,7 +1409,7 @@ void CreateFemCommands(void)
rcCmdMgr.addCommand(new CmdFemConstraintInitialTemperature());
rcCmdMgr.addCommand(new CmdFemConstraintPlaneRotation());
rcCmdMgr.addCommand(new CmdFemConstraintContact());
rcCmdMgr.addCommand(new CmdFemConstraintFluidBoundary());
#ifdef FC_USE_VTK
rcCmdMgr.addCommand(new CmdFemPostCreateClipFilter);
rcCmdMgr.addCommand(new CmdFemPostCreateScalarClipFilter);

View File

@ -3,6 +3,8 @@
<file>icons/fem-fem-mesh-from-shape.svg</file>
<file>icons/fem-fem-mesh-create-node-by-poly.svg</file>
<file>icons/fem-analysis.svg</file>
<file>icons/fem-cfd-analysis.svg</file>
<file>icons/fem-constraint-fluid-boundary.svg</file>
<file>icons/fem-solver.svg</file>
<file>icons/fem-constraint-displacement.svg</file>
<file>icons/fem-constraint-selfweight.svg</file>

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg2860"
sodipodi:version="0.32"
inkscape:version="0.48.4 r9939"
sodipodi:docname="fem-cfd-analysis.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs2862">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3692"
cx="45.883327"
cy="28.869568"
fx="45.883327"
fy="28.869568"
r="19.467436"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3703"
gradientUnits="userSpaceOnUse"
cx="135.38333"
cy="97.369568"
fx="135.38333"
fy="97.369568"
r="19.467436"
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)" />
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
offset="0"
style="stop-color:#faff2b;stop-opacity:1;" />
<stop
id="stop3381"
offset="1"
style="stop-color:#ffaa00;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3705"
gradientUnits="userSpaceOnUse"
cx="148.88333"
cy="81.869568"
fx="148.88333"
fy="81.869568"
r="19.467436"
gradientTransform="matrix(1.3852588,-5.1367833e-2,3.7056289e-2,0.9993132,-60.392403,7.7040438)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective2868" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="1.1818182"
inkscape:cy="29.272727"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="716"
inkscape:window-x="86"
inkscape:window-y="24"
inkscape:window-maximized="0" />
<metadata
id="metadata2865">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<text
xml:space="preserve"
style="font-size:53.45185852px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffff00;fill-opacity:1;stroke:#241c1c;stroke-width:2.22716069;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4.1;font-family:DejaVu Serif;-inkscape-font-specification:DejaVu Serif"
x="11.120363"
y="42.796223"
id="text3014"
sodipodi:linespacing="125%"
transform="scale(1.0443878,0.95749872)"><tspan
sodipodi:role="line"
id="tspan3016"
x="11.120363"
y="42.796223"
style="stroke-width:2.22716069">A</tspan></text>
<text
xml:space="preserve"
style="font-size:21.82932663000000062px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#d40000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="11.969317"
y="57.515423"
id="text2991"
sodipodi:linespacing="125%"
transform="scale(0.94671686,1.056282)"><tspan
sodipodi:role="line"
id="tspan2993"
x="11.969317"
y="57.515423">CFD</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg2860"
sodipodi:version="0.32"
inkscape:version="0.48.4 r9939"
sodipodi:docname="fem-constraint-fluid-boundary.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs2862">
<inkscape:path-effect
effect="spiro"
id="path-effect3038"
is_visible="true" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3692"
cx="45.883327"
cy="28.869568"
fx="45.883327"
fy="28.869568"
r="19.467436"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3703"
gradientUnits="userSpaceOnUse"
cx="135.38333"
cy="97.369568"
fx="135.38333"
fy="97.369568"
r="19.467436"
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)" />
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
offset="0"
style="stop-color:#faff2b;stop-opacity:1;" />
<stop
id="stop3381"
offset="1"
style="stop-color:#ffaa00;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3705"
gradientUnits="userSpaceOnUse"
cx="148.88333"
cy="81.869568"
fx="148.88333"
fy="81.869568"
r="19.467436"
gradientTransform="matrix(1.3852588,-5.1367833e-2,3.7056289e-2,0.9993132,-60.392403,7.7040438)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective2868" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="29.130684"
inkscape:cy="35.583452"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1301"
inkscape:window-height="744"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata2865">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<rect
style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect3014"
width="35.636364"
height="15.636364"
x="23.454546"
y="6.7272725" />
<rect
style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect3014-5"
width="35.636364"
height="15.636364"
x="23.454546"
y="41.454544" />
<path
style="fill:none;stroke:#000000;stroke-width:1.05047488px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.843419,7.479783 c 7.441571,14.872945 3.217977,8.161982 7.240447,15.054323 4.022471,6.89234 16.291005,5.622698 16.291005,5.622698 l 19.508983,0"
id="path3040"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.05261374px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5.2990341,16.208125 C 20.66121,31.248256 28.342297,31.429462 28.342297,31.429462 l 27.085941,0.362413"
id="path3042"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.05078399px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5.4799375,50.156427 C 20.786956,35.11453 28.440465,34.933303 28.440465,34.933303 l 26.988689,-0.362456"
id="path3042-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.05047488px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 12.388873,58.384527 c 7.441571,-14.872946 3.217977,-8.161982 7.240447,-15.054324 4.022471,-6.892341 16.291005,-5.622699 16.291005,-5.622699 l 19.508983,0"
id="path3040-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 17.090909,12 -0.181818,5.636364"
id="path3080"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.636364,15.272727 4.545454,2.363637"
id="path3082"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3.2727273,32.363636 13.6363637,0"
id="path3084"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 12.909091,28.363636 3.636364,4"
id="path3086"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 12.727273,36.909091 3.818182,-4.181818"
id="path3088"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 12,49.636364 4.727273,-1.090909"
id="path3090"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 18.545455,53.090909 17.272727,48.181818"
id="path3092"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -78,6 +78,8 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
<< "Fem_ConstraintGear"
<< "Fem_ConstraintPulley"
<< "Separator"
<< "Fem_ConstraintFluidBoundary"
<< "Separator"
<< "Fem_ConstraintTemperature"
<< "Fem_ConstraintHeatflux"
<< "Fem_ConstraintInitialTemperature"
@ -135,6 +137,8 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "Fem_ConstraintGear"
<< "Fem_ConstraintPulley"
<< "Separator"
<< "Fem_ConstraintFluidBoundary"
<< "Separator"
<< "Fem_ConstraintTemperature"
<< "Fem_ConstraintHeatflux"
<< "Fem_ConstraintInitialTemperature"