yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #11467
[Branch ~yade-pkg/yade/git-trunk] Rev 3462: split resetNetwork and resetLinearSystem + add more getter/setter
------------------------------------------------------------
revno: 3462
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
timestamp: Fri 2014-10-10 13:45:21 +0200
message:
split resetNetwork and resetLinearSystem + add more getter/setter
modified:
lib/triangulation/FlowBoundingSphere.hpp
lib/triangulation/FlowBoundingSphere.ipp
lib/triangulation/FlowBoundingSphereLinSolv.hpp
lib/triangulation/FlowBoundingSphereLinSolv.ipp
pkg/pfv/FlowEngine.hpp
pkg/pfv/FlowEngine.hpp.in
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'lib/triangulation/FlowBoundingSphere.hpp'
--- lib/triangulation/FlowBoundingSphere.hpp 2014-10-07 18:41:54 +0000
+++ lib/triangulation/FlowBoundingSphere.hpp 2014-10-10 11:45:21 +0000
@@ -95,6 +95,7 @@
void computePermeability();
virtual void gaussSeidel (Real dt=0);
virtual void resetNetwork();
+ virtual void resetLinearSystem();
double kFactor; //permeability moltiplicator
=== modified file 'lib/triangulation/FlowBoundingSphere.ipp'
--- lib/triangulation/FlowBoundingSphere.ipp 2014-10-09 20:37:28 +0000
+++ lib/triangulation/FlowBoundingSphere.ipp 2014-10-10 11:45:21 +0000
@@ -88,7 +88,10 @@
}
template <class Tesselation>
-void FlowBoundingSphere<Tesselation>::resetNetwork() {T[currentTes].Clear();noCache=true;}
+void FlowBoundingSphere<Tesselation>::resetNetwork() {T[currentTes].Clear();this->resetLinearSystem();}
+
+template <class Tesselation>
+void FlowBoundingSphere<Tesselation>::resetLinearSystem() {noCache=true;}
template <class Tesselation>
void FlowBoundingSphere<Tesselation>::averageRelativeCellVelocity()
=== modified file 'lib/triangulation/FlowBoundingSphereLinSolv.hpp'
--- lib/triangulation/FlowBoundingSphereLinSolv.hpp 2014-07-02 16:18:24 +0000
+++ lib/triangulation/FlowBoundingSphereLinSolv.hpp 2014-10-10 11:45:21 +0000
@@ -179,7 +179,7 @@
}
computedOnce=true;
}
- virtual void resetNetwork();
+ virtual void resetLinearSystem();
};
} //namespace CGT
=== modified file 'lib/triangulation/FlowBoundingSphereLinSolv.ipp'
--- lib/triangulation/FlowBoundingSphereLinSolv.ipp 2014-10-09 20:34:42 +0000
+++ lib/triangulation/FlowBoundingSphereLinSolv.ipp 2014-10-10 11:45:21 +0000
@@ -116,8 +116,8 @@
};
template<class _Tesselation, class FlowType>
-void FlowBoundingSphereLinSolv<_Tesselation,FlowType>::resetNetwork() {
- FlowType::resetNetwork();
+void FlowBoundingSphereLinSolv<_Tesselation,FlowType>::resetLinearSystem() {
+ FlowType::resetLinearSystem();
isLinearSystemSet=false;
isFullLinearSystemGSSet=false;
areCellsOrdered=false;
@@ -138,6 +138,7 @@
}
#endif
}
+
template<class _Tesselation, class FlowType>
int FlowBoundingSphereLinSolv<_Tesselation,FlowType>::setLinearSystem(Real dt)
{
=== modified file 'pkg/pfv/FlowEngine.hpp'
--- pkg/pfv/FlowEngine.hpp 2014-10-07 18:41:54 +0000
+++ pkg/pfv/FlowEngine.hpp 2014-10-10 11:45:21 +0000
@@ -17,6 +17,11 @@
if (id>=solver->T[solver->currentTes].cellHandles.size()) {LOG_ERROR("id out of range, max value is "<<solver->T[solver->currentTes].cellHandles.size()); return 0;}\
return solver->T[solver->currentTes].cellHandles[id]->info()param;}
+#define CELL_SCALAR_SETTER(type, param, setterName) \
+void setterName(unsigned int id, type value){\
+ if (id>=solver->T[solver->currentTes].cellHandles.size()) {LOG_ERROR("id out of range, max value is "<<solver->T[solver->currentTes].cellHandles.size()); return;}\
+ solver->T[solver->currentTes].cellHandles[id]->info()param=value;}
+
#define CELL_VECTOR_GETTER(param, getterName) \
Vector3r getterName(unsigned int id){\
if (id>=solver->T[solver->currentTes].cellHandles.size()) {LOG_ERROR("id out of range, max value is "<<solver->T[solver->currentTes].cellHandles.size()); return Vector3r(0,0,0);}\
=== modified file 'pkg/pfv/FlowEngine.hpp.in'
--- pkg/pfv/FlowEngine.hpp.in 2014-10-07 18:41:54 +0000
+++ pkg/pfv/FlowEngine.hpp.in 2014-10-10 11:45:21 +0000
@@ -177,7 +177,10 @@
unsigned int nCells(){return solver->T[solver->currentTes].cellHandles.size();}
CELL_VECTOR_GETTER(,cellCenter)
CELL_VECTOR_GETTER(.averageCellVelocity,cellVelocity)
- CELL_SCALAR_GETTER(double,.p(),pressure)
+ CELL_SCALAR_GETTER(double,.p(),cellPressure)
+ CELL_SCALAR_SETTER(double,.p(),setCellPressure)
+ CELL_SCALAR_GETTER(bool,.Pcondition,cellPImposed)
+ CELL_SCALAR_SETTER(bool,.Pcondition,setCellPImposed)
boost::python::list getVertices(unsigned int id){
boost::python::list ids;
if (id>=solver->T[solver->currentTes].cellHandles.size()) {LOG_ERROR("id out of range, max value is "<<solver->T[solver->currentTes].cellHandles.size()); return ids;}
@@ -332,6 +335,10 @@
.def("emulateAction",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::emulateAction,"get scene and run action (may be used to manipulate an engine outside the timestepping loop).")
.def("getCell",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::getCell,(boost::python::arg("pos")),"get id of the cell containing (X,Y,Z).")
.def("getCellCenter",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::cellCenter,(boost::python::arg("id")),"get voronoi center of cell 'id'.")
+ .def("getCellPressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::cellPressure,(boost::python::arg("id")),"get pressure in cell 'id'.")
+ .def("setCellPressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::setCellPressure,(boost::python::arg("id"),boost::python::arg("pressure")),"set pressure in cell 'id'.")
+ .def("getCellPImposed",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::cellPImposed,(boost::python::arg("id")),"get the status of cell 'id' wrt imposed pressure.")
+ .def("setCellPImposed",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::setCellPImposed,(boost::python::arg("id"),boost::python::arg("pImposed")),"make cell 'id' assignable with imposed pressure.")
.def("nCells",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::nCells,"get the total number of finite cells in the triangulation.")
.def("blockCell",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::blockCell,(boost::python::arg("id"),boost::python::arg("blockPressure")),"block cell 'id'. The cell will be excluded from the fluid flow problem and the conductivity of all incident facets will be null. If blockPressure=False, deformation is reflected in the pressure, else it is constantly 0.")
.def("getVertices",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::getVertices,(boost::python::arg("id")),"get the vertices of a cell")