Commit 8d230823 authored by clang-formatter's avatar clang-formatter Committed by Anton Gladky

scripts/clang-formatter.sh ./pkg (5/9)

parent 473f5f3d
This diff is collapsed.
#pragma once
#include<core/IGeom.hpp>
#include<core/IPhys.hpp>
#include<core/Shape.hpp>
#include<core/State.hpp>
#include<pkg/common/Sphere.hpp>
#include<pkg/common/Facet.hpp>
#include<pkg/common/Wall.hpp>
#include<pkg/common/Dispatching.hpp>
#include<pkg/dem/DemXDofGeom.hpp>
#include<pkg/dem/FrictPhys.hpp>
#include <core/IGeom.hpp>
#include <core/IPhys.hpp>
#include <core/Shape.hpp>
#include <core/State.hpp>
#include <pkg/common/Dispatching.hpp>
#include <pkg/common/Facet.hpp>
#include <pkg/common/Sphere.hpp>
#include <pkg/common/Wall.hpp>
#include <pkg/dem/DemXDofGeom.hpp>
#include <pkg/dem/FrictPhys.hpp>
#ifdef YADE_OPENGL
#include<pkg/common/GLDrawFunctors.hpp>
#include <pkg/common/GLDrawFunctors.hpp>
#endif
namespace yade { // Cannot have #include directive inside.
......@@ -33,17 +33,17 @@ Note that:
#define L3GEOM_SPHERESLIKE
struct L3Geom: public GenericSpheresContact{
struct L3Geom : public GenericSpheresContact {
virtual ~L3Geom();
// utility function
// TODO: currently supposes body's centroids are conencted with distance*normal
// that will not be true for sphere+facet and others, watch out!
// the force is oriented as applied to particle #1
void applyLocalForce(const Vector3r& f, const Interaction* I, Scene* scene, NormShearPhys* nsp=NULL) const;
void applyLocalForceTorque(const Vector3r& f, const Vector3r& t, const Interaction* I, Scene* scene, NormShearPhys* nsp=NULL) const;
void applyLocalForce(const Vector3r& f, const Interaction* I, Scene* scene, NormShearPhys* nsp = NULL) const;
void applyLocalForceTorque(const Vector3r& f, const Vector3r& t, const Interaction* I, Scene* scene, NormShearPhys* nsp = NULL) const;
Vector3r relU() const{ return u-u0; }
Vector3r relU() const { return u - u0; }
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(L3Geom,GenericSpheresContact,"Geometry of contact given in local coordinates with 3 degress of freedom: normal and two in shear plane. [experimental]",
......@@ -63,13 +63,13 @@ struct L3Geom: public GenericSpheresContact{
, /*py*/
);
// clang-format on
REGISTER_CLASS_INDEX(L3Geom,GenericSpheresContact);
REGISTER_CLASS_INDEX(L3Geom, GenericSpheresContact);
};
REGISTER_SERIALIZABLE(L3Geom);
struct L6Geom: public L3Geom{
struct L6Geom : public L3Geom {
virtual ~L6Geom();
Vector3r relPhi() const{ return phi-phi0; }
Vector3r relPhi() const { return phi - phi0; }
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS_CTOR(L6Geom,L3Geom,"Geometric of contact in local coordinates with 6 degrees of freedom. [experimental]",
((Vector3r,phi,Vector3r::Zero(),,"Rotation components, in local coordinates. |yupdate|"))
......@@ -78,15 +78,15 @@ struct L6Geom: public L3Geom{
/* ctor */ createIndex();
);
// clang-format on
REGISTER_CLASS_INDEX(L6Geom,L3Geom);
REGISTER_CLASS_INDEX(L6Geom, L3Geom);
};
REGISTER_SERIALIZABLE(L6Geom);
#ifdef YADE_OPENGL
struct Gl1_L3Geom: public GlIGeomFunctor{
struct Gl1_L3Geom : public GlIGeomFunctor {
RENDERS(L3Geom);
void go(const shared_ptr<IGeom>&, const shared_ptr<Interaction>&, const shared_ptr<Body>&, const shared_ptr<Body>&, bool);
void draw(const shared_ptr<IGeom>&, bool isL6Geom=false, const Real& phiScale=0);
void draw(const shared_ptr<IGeom>&, bool isL6Geom = false, const Real& phiScale = 0);
// clang-format off
YADE_CLASS_BASE_DOC_STATICATTRS(Gl1_L3Geom,GlIGeomFunctor,"Render :yref:`L3Geom` geometry.",
((bool,axesLabels,false,,"Whether to display labels for local axes (x,y,z)"))
......@@ -99,7 +99,7 @@ struct Gl1_L3Geom: public GlIGeomFunctor{
};
REGISTER_SERIALIZABLE(Gl1_L3Geom);
struct Gl1_L6Geom: public Gl1_L3Geom{
struct Gl1_L6Geom : public Gl1_L3Geom {
RENDERS(L6Geom);
void go(const shared_ptr<IGeom>&, const shared_ptr<Interaction>&, const shared_ptr<Body>&, const shared_ptr<Body>&, bool);
// clang-format off
......@@ -111,14 +111,39 @@ struct Gl1_L6Geom: public Gl1_L3Geom{
REGISTER_SERIALIZABLE(Gl1_L6Geom);
#endif
struct Ig2_Sphere_Sphere_L3Geom: public IGeomFunctor{
virtual bool go(const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
virtual bool genericGo(bool is6Dof, const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
// common code for {sphere,facet,wall}+sphere contacts
// facet&wall will get separated if L3Geom subclass with exact branch vector is created
void handleSpheresLikeContact(const shared_ptr<Interaction>& I, const State& state1, const State& state2, const Vector3r& shift2, bool is6Dof, const Vector3r& normal, const Vector3r& contPt, Real uN, Real r1, Real r2);
struct Ig2_Sphere_Sphere_L3Geom : public IGeomFunctor {
virtual bool
go(const shared_ptr<Shape>& s1,
const shared_ptr<Shape>& s2,
const State& state1,
const State& state2,
const Vector3r& shift2,
const bool& force,
const shared_ptr<Interaction>& I);
virtual bool genericGo(
bool is6Dof,
const shared_ptr<Shape>& s1,
const shared_ptr<Shape>& s2,
const State& state1,
const State& state2,
const Vector3r& shift2,
const bool& force,
const shared_ptr<Interaction>& I);
// common code for {sphere,facet,wall}+sphere contacts
// facet&wall will get separated if L3Geom subclass with exact branch vector is created
void handleSpheresLikeContact(
const shared_ptr<Interaction>& I,
const State& state1,
const State& state2,
const Vector3r& shift2,
bool is6Dof,
const Vector3r& normal,
const Vector3r& contPt,
Real uN,
Real r1,
Real r2);
enum { APPROX_NO_MID_TRSF=1, APPROX_NO_MID_NORMAL=2, APPROX_NO_RENORM_MID_NORMAL=4 };
enum { APPROX_NO_MID_TRSF = 1, APPROX_NO_MID_NORMAL = 2, APPROX_NO_RENORM_MID_NORMAL = 4 };
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS(Ig2_Sphere_Sphere_L3Geom,IGeomFunctor,"Incrementally compute :yref:`L3Geom` for contact of 2 spheres. Detailed documentation in py/\\_extraDocs.py",
......@@ -135,57 +160,81 @@ struct Ig2_Sphere_Sphere_L3Geom: public IGeomFunctor{
))
);
// clang-format on
FUNCTOR2D(Sphere,Sphere);
DEFINE_FUNCTOR_ORDER_2D(Sphere,Sphere);
FUNCTOR2D(Sphere, Sphere);
DEFINE_FUNCTOR_ORDER_2D(Sphere, Sphere);
DECLARE_LOGGER;
};
REGISTER_SERIALIZABLE(Ig2_Sphere_Sphere_L3Geom);
struct Ig2_Wall_Sphere_L3Geom: public Ig2_Sphere_Sphere_L3Geom{
virtual bool go(const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
struct Ig2_Wall_Sphere_L3Geom : public Ig2_Sphere_Sphere_L3Geom {
virtual bool
go(const shared_ptr<Shape>& s1,
const shared_ptr<Shape>& s2,
const State& state1,
const State& state2,
const Vector3r& shift2,
const bool& force,
const shared_ptr<Interaction>& I);
//virtual bool genericGo(bool is6Dof, const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
// clang-format off
YADE_CLASS_BASE_DOC(Ig2_Wall_Sphere_L3Geom,Ig2_Sphere_Sphere_L3Geom,"Incrementally compute :yref:`L3Geom` for contact between :yref:`Wall` and :yref:`Sphere`. Uses attributes of :yref:`Ig2_Sphere_Sphere_L3Geom`.");
// clang-format on
FUNCTOR2D(Wall,Sphere);
DEFINE_FUNCTOR_ORDER_2D(Wall,Sphere);
FUNCTOR2D(Wall, Sphere);
DEFINE_FUNCTOR_ORDER_2D(Wall, Sphere);
DECLARE_LOGGER;
};
REGISTER_SERIALIZABLE(Ig2_Wall_Sphere_L3Geom);
#ifdef L3GEOM_SPHERESLIKE
struct Ig2_Facet_Sphere_L3Geom: public Ig2_Sphere_Sphere_L3Geom{
struct Ig2_Facet_Sphere_L3Geom : public Ig2_Sphere_Sphere_L3Geom {
// get point on segment A..B closest to P; algo: http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/
static Vector3r getClosestSegmentPt(const Vector3r& P, const Vector3r& A, const Vector3r& B){
using math::min;
static Vector3r getClosestSegmentPt(const Vector3r& P, const Vector3r& A, const Vector3r& B)
{
using math::max;
Vector3r BA=B-A; Real u=(P.dot(BA)-A.dot(BA))/(BA.squaredNorm()); return A+min((Real)1.,max((Real)0.,u))*BA;
using math::min;
Vector3r BA = B - A;
Real u = (P.dot(BA) - A.dot(BA)) / (BA.squaredNorm());
return A + min((Real)1., max((Real)0., u)) * BA;
}
virtual bool go(const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
virtual bool
go(const shared_ptr<Shape>& s1,
const shared_ptr<Shape>& s2,
const State& state1,
const State& state2,
const Vector3r& shift2,
const bool& force,
const shared_ptr<Interaction>& I);
// clang-format off
YADE_CLASS_BASE_DOC(Ig2_Facet_Sphere_L3Geom,Ig2_Sphere_Sphere_L3Geom,"Incrementally compute :yref:`L3Geom` for contact between :yref:`Facet` and :yref:`Sphere`. Uses attributes of :yref:`Ig2_Sphere_Sphere_L3Geom`.");
// clang-format on
FUNCTOR2D(Facet,Sphere);
DEFINE_FUNCTOR_ORDER_2D(Facet,Sphere);
FUNCTOR2D(Facet, Sphere);
DEFINE_FUNCTOR_ORDER_2D(Facet, Sphere);
DECLARE_LOGGER;
};
REGISTER_SERIALIZABLE(Ig2_Facet_Sphere_L3Geom);
#endif
struct Ig2_Sphere_Sphere_L6Geom: public Ig2_Sphere_Sphere_L3Geom{
virtual bool go(const shared_ptr<Shape>& s1, const shared_ptr<Shape>& s2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& I);
struct Ig2_Sphere_Sphere_L6Geom : public Ig2_Sphere_Sphere_L3Geom {
virtual bool
go(const shared_ptr<Shape>& s1,
const shared_ptr<Shape>& s2,
const State& state1,
const State& state2,
const Vector3r& shift2,
const bool& force,
const shared_ptr<Interaction>& I);
// clang-format off
YADE_CLASS_BASE_DOC(Ig2_Sphere_Sphere_L6Geom,Ig2_Sphere_Sphere_L3Geom,"Incrementally compute :yref:`L6Geom` for contact of 2 spheres.");
// clang-format on
FUNCTOR2D(Sphere,Sphere);
DEFINE_FUNCTOR_ORDER_2D(Sphere,Sphere);
FUNCTOR2D(Sphere, Sphere);
DEFINE_FUNCTOR_ORDER_2D(Sphere, Sphere);
};
REGISTER_SERIALIZABLE(Ig2_Sphere_Sphere_L6Geom);
struct Law2_L3Geom_FrictPhys_ElPerfPl: public LawFunctor{
struct Law2_L3Geom_FrictPhys_ElPerfPl : public LawFunctor {
virtual bool go(shared_ptr<IGeom>&, shared_ptr<IPhys>&, Interaction*);
FUNCTOR2D(L3Geom,FrictPhys);
FUNCTOR2D(L3Geom, FrictPhys);
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS(Law2_L3Geom_FrictPhys_ElPerfPl,LawFunctor,"Basic law for testing :yref:`L3Geom`; it bears no cohesion (unless *noBreak* is ``True``), and plastic slip obeys the Mohr-Coulomb criterion (unless *noSlip* is ``True``).",
((bool,noBreak,false,,"Do not break contacts when particles separate."))
......@@ -197,9 +246,9 @@ struct Law2_L3Geom_FrictPhys_ElPerfPl: public LawFunctor{
};
REGISTER_SERIALIZABLE(Law2_L3Geom_FrictPhys_ElPerfPl);
struct Law2_L6Geom_FrictPhys_Linear: public Law2_L3Geom_FrictPhys_ElPerfPl{
struct Law2_L6Geom_FrictPhys_Linear : public Law2_L3Geom_FrictPhys_ElPerfPl {
virtual bool go(shared_ptr<IGeom>&, shared_ptr<IPhys>&, Interaction*);
FUNCTOR2D(L6Geom,FrictPhys);
FUNCTOR2D(L6Geom, FrictPhys);
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS(Law2_L6Geom_FrictPhys_Linear,Law2_L3Geom_FrictPhys_ElPerfPl,"Basic law for testing :yref:`L6Geom` -- linear in both normal and shear sense, without slip or breakage.",
((Real,charLen,1,,"Characteristic length with the meaning of the stiffness ratios bending/shear and torsion/normal."))
......@@ -209,4 +258,3 @@ struct Law2_L6Geom_FrictPhys_Linear: public Law2_L3Geom_FrictPhys_ElPerfPl{
REGISTER_SERIALIZABLE(Law2_L6Geom_FrictPhys_Linear);
} // namespace yade
......@@ -32,20 +32,19 @@ Rk: - the formulation is valid only for pendular menisci involving two grains (p
/// !!! This version is deprecated. It should be updated to the new formalism -> ToDo !!!
/// a class to store meniscus parameters -> Rk: is it really needed since CapillaryPhys exist?
class MeniscusParameters
{
public :
Real V; // adimentionnal volume of the meniscus : true volume / Rmax^3, see Annexe 1 of Scholtes2009d
Real F; // adimentionnal capillary force for this meniscus : true force / ( 2 * pi * Rmax * superficial tension), (30) of Annexe1 of Scholtes2009d
class MeniscusParameters {
public:
Real V; // adimentionnal volume of the meniscus : true volume / Rmax^3, see Annexe 1 of Scholtes2009d
Real F; // adimentionnal capillary force for this meniscus : true force / ( 2 * pi * Rmax * superficial tension), (30) of Annexe1 of Scholtes2009d
Real delta1; // angle defined Fig 2.5 Scholtes2009d
Real delta2; // angle defined Fig 2.5 Scholtes2009d
Real nn11; // CapillaryPhys.nn11 / R2^2
Real nn33; // CapillaryPhys.nn33 / R2^2
int index1;
int index2;
Real nn11; // CapillaryPhys.nn11 / R2^2
Real nn33; // CapillaryPhys.nn33 / R2^2
int index1;
int index2;
MeniscusParameters();
MeniscusParameters(const MeniscusParameters &source);
MeniscusParameters(const MeniscusParameters& source);
~MeniscusParameters();
};
......@@ -56,42 +55,41 @@ class capillarylaw; // the class defined below (end of file)
class Interaction;
///This container class is used to check if meniscii overlap. Wet interactions are put in a series of lists, with one list per body.
class BodiesMenisciiList
{
private:
std::vector< std::list< shared_ptr<Interaction> > > interactionsOnBody; // would require use of OpenMPVector (lib/base/openmp-accu.hpp) for parallel coding, see http://www.mail-archive.com/[email protected]/msg10842.html and msg11238.html
//shared_ptr<Interaction> empty;
public:
BodiesMenisciiList();
BodiesMenisciiList(Scene*,bool);//TODO: remove?
bool prepare(Scene*,bool);
bool insert(const shared_ptr<Interaction>&);
bool remove(const shared_ptr<Interaction>&);
std::list< shared_ptr<Interaction> >& operator[] (int);
int size();
void display();
void checkLengthBuffer(const shared_ptr<Interaction>&);
bool initialized;
class BodiesMenisciiList {
private:
std::vector<std::list<shared_ptr<Interaction>>>
interactionsOnBody; // would require use of OpenMPVector (lib/base/openmp-accu.hpp) for parallel coding, see http://www.mail-archive.com/[email protected]et/msg10842.html and msg11238.html
//shared_ptr<Interaction> empty;
public:
BodiesMenisciiList();
BodiesMenisciiList(Scene*, bool); //TODO: remove?
bool prepare(Scene*, bool);
bool insert(const shared_ptr<Interaction>&);
bool remove(const shared_ptr<Interaction>&);
std::list<shared_ptr<Interaction>>& operator[](int);
int size();
void display();
void checkLengthBuffer(const shared_ptr<Interaction>&);
bool initialized;
};
/// This is the constitutive law
class Law2_ScGeom_CapillaryPhys_Capillarity : public GlobalEngine
{
public :
void checkFusion();
shared_ptr<capillarylaw> capillary;
BodiesMenisciiList bodiesMenisciiList;
void action();
void postLoad(Law2_ScGeom_CapillaryPhys_Capillarity&);
bool hertzInitialized;
bool hertzOn;
bool showError;
class Law2_ScGeom_CapillaryPhys_Capillarity : public GlobalEngine {
public:
void checkFusion();
shared_ptr<capillarylaw> capillary;
BodiesMenisciiList bodiesMenisciiList;
void action();
void postLoad(Law2_ScGeom_CapillaryPhys_Capillarity&);
bool hertzInitialized;
bool hertzOn;
bool showError;
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(Law2_ScGeom_CapillaryPhys_Capillarity,GlobalEngine,"This law allows one to take into account capillary forces/effects between spheres coming from the presence of interparticular liquid bridges (menisci).\n\nThe control parameter is the :yref:`capillary pressure<Law2_ScGeom_CapillaryPhys_Capillarity::capillaryPressure>` (or suction) Uc = Ugas - Uliquid. Liquid bridges properties (volume V, extent over interacting grains delta1 and delta2) are computed as a result of the defined capillary pressure and of the interacting geometry (spheres radii and interparticular distance).\n\nReferences: in english [Scholtes2009b]_; more detailed, but in french [Scholtes2009d]_.\n\nThe law needs ascii files M(r=i) with i=R1/R2 to work (see https://yade-dem.org/wiki/CapillaryTriaxialTest). These ASCII files contain a set of results from the resolution of the Laplace-Young equation for different configurations of the interacting geometry, assuming a null wetting angle.\n\nIn order to allow capillary forces between distant spheres, it is necessary to enlarge the bounding boxes using :yref:`Bo1_Sphere_Aabb::aabbEnlargeFactor` and make the Ig2 define define distant interactions via :yref:`interactionDetectionFactor<Ig2_Sphere_Sphere_ScGeom::interactionDetectionFactor>`. It is also necessary to disable interactions removal by the constitutive law (:yref:`Law2<Law2_ScGeom_FrictPhys_CundallStrack::neverErase>=True`). The only combinations of laws supported are currently capillary law + :yref:`Law2_ScGeom_FrictPhys_CundallStrack` and capillary law + :yref:`Law2_ScGeom_MindlinPhys_Mindlin` (and the other variants of Hertz-Mindlin).\n\nSee CapillaryPhys-example.py for an example script.",
((Real,capillaryPressure,0.,,"Value of the capillary pressure Uc defined as Uc=Ugas-Uliquid"))
......@@ -111,13 +109,13 @@ class Law2_ScGeom_CapillaryPhys_Capillarity : public GlobalEngine
class TableauD // Laplace solutions for a given r, and a given D (and a given contact angle): pieces of one capillary file
{
public:
Real D; // one cst D value in each TableauD (the one appearing last line of corresponding group D=cst in the capillary file)
std::vector<std::vector<Real> > data;
MeniscusParameters Interpolate3(Real P, int& index); // does the interpolation on uc*
TableauD();
TableauD(std::ifstream& file);
~TableauD();
public:
Real D; // one cst D value in each TableauD (the one appearing last line of corresponding group D=cst in the capillary file)
std::vector<std::vector<Real>> data;
MeniscusParameters Interpolate3(Real P, int& index); // does the interpolation on uc*
TableauD();
TableauD(std::ifstream& file);
~TableauD();
};
// Fonction d'ecriture de tableau, utilisee dans le constructeur pour test //TODO: translate this in english
......@@ -125,27 +123,28 @@ class Tableau;
std::ostream& operator<<(std::ostream& os, Tableau& T);
class Tableau // Laplace solutions for a given r (and a given contact angle): one capillary file
{
public:
Real R;
std::vector<TableauD> full_data; // members of full_data are the different TableauD, for different D.
MeniscusParameters Interpolate2(Real D, Real P, int& index1, int& index2); // does the interpolation on d* (returning no meniscus when d* > the greatest D of the file)
std::ifstream& operator<< (std::ifstream& file);
Tableau();
Tableau(const char* filename);
~Tableau();
{
public:
Real R;
std::vector<TableauD> full_data; // members of full_data are the different TableauD, for different D.
MeniscusParameters
Interpolate2(Real D, Real P, int& index1, int& index2); // does the interpolation on d* (returning no meniscus when d* > the greatest D of the file)
std::ifstream& operator<<(std::ifstream& file);
Tableau();
Tableau(const char* filename);
~Tableau();
};
class capillarylaw // class for a whole set of capillary files M(r=..)
{
public:
capillarylaw();
std::vector<Tableau> data_complete; // data_complete includes, in ascending order of r, all capillary files: each Tableau of data_complete is one capillary file
MeniscusParameters interpolate(Real R1, Real R2, Real D, Real P, int* index);
void fill (const char* filename);
public:
capillarylaw();
std::vector<Tableau>
data_complete; // data_complete includes, in ascending order of r, all capillary files: each Tableau of data_complete is one capillary file
MeniscusParameters interpolate(Real R1, Real R2, Real D, Real P, int* index);
void fill(const char* filename);
};
REGISTER_SERIALIZABLE(Law2_ScGeom_CapillaryPhys_Capillarity);
} // namespace yade
......@@ -10,17 +10,17 @@
#pragma once
#include <core/GlobalEngine.hpp>
#include <set>
#include <boost/tuple/tuple.hpp>
#include <set>
#include <vector>
#include <list>
#include <utility>
#include <pkg/common/Dispatching.hpp>
#include <pkg/dem/CapillaryPhys1.hpp>
#include<pkg/common/Dispatching.hpp>
#include <string>
#include <iostream>
#include <fstream>
#include <iostream>
#include <list>
#include <string>
#include <utility>
#include <vector>
namespace yade { // Cannot have #include directive inside.
......@@ -42,7 +42,6 @@ Rk: - the formulation is valid only for pendular menisci involving two grains (p
/// !!! This version is deprecated. It should be updated to the new formalism -> ToDo !!!
/// R = ratio(RadiusParticle1 on RadiusParticle2). Here, 10 R values from interpolation files (yade/extra/capillaryFiles), R = 1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9
//const int NB_R_VALUES = 10;
......@@ -51,48 +50,46 @@ class Interaction;
///This container class is used to check if meniscii overlap. Wet interactions are put in a series of lists, with one list per body.
class BodiesMenisciiList1
{
class BodiesMenisciiList1 {
private:
vector< list< shared_ptr<Interaction> > > interactionsOnBody;
vector<list<shared_ptr<Interaction>>> interactionsOnBody;
//shared_ptr<Interaction> empty;
//shared_ptr<Interaction> empty;
public:
BodiesMenisciiList1();
BodiesMenisciiList1(Scene* body);
bool prepare(Scene* scene);
bool insert(const shared_ptr<Interaction>& interaction);
bool remove(const shared_ptr<Interaction>& interaction);
list< shared_ptr<Interaction> >& operator[] (int index);
int size();
void display();
BodiesMenisciiList1();
BodiesMenisciiList1(Scene* body);
bool prepare(Scene* scene);
bool insert(const shared_ptr<Interaction>& interaction);
bool remove(const shared_ptr<Interaction>& interaction);
list<shared_ptr<Interaction>>& operator[](int index);
int size();
void display();
bool initialized;
bool initialized;
};
/// This is the constitutive law
class Law2_ScGeom_CapillaryPhys_Capillarity1 : public GlobalEngine
{
public :
void checkFusion();
class Law2_ScGeom_CapillaryPhys_Capillarity1 : public GlobalEngine {
public:
void checkFusion();
static DT dtVbased;
static DT dtPbased;
std::vector<MeniscusPhysicalData> solutions;
int switchTriangulation;//to detect switches between P-based and V-based data
static DT dtVbased;
static DT dtPbased;
std::vector<MeniscusPhysicalData> solutions;
int switchTriangulation; //to detect switches between P-based and V-based data
BodiesMenisciiList1 bodiesMenisciiList;
BodiesMenisciiList1 bodiesMenisciiList;
void action();
Real intEnergy();
Real swInterface();
Real wnInterface();
Real waterVolume();
void solver(Real suction, bool reset);
void triangulateData();
void action();
Real intEnergy();
Real swInterface();
Real wnInterface();
Real waterVolume();
void solver(Real suction, bool reset);
void triangulateData();
// clang-format off
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Law2_ScGeom_CapillaryPhys_Capillarity1,GlobalEngine,"This law allows one to take into account capillary forces/effects between spheres coming from the presence of interparticular liquid bridges (menisci).\n\nThe control parameter is the capillary pressure (or suction) Uc = ugas - Uliquid. Liquid bridges properties (volume V, extent over interacting grains delta1 and delta2) are computed as a result of the defined capillary pressure and of the interacting geometry (spheres radii and interparticular distance).\n\nReferences: in english [Scholtes2009b]_; more detailed, but in french [Scholtes2009d]_.\n\nThe law needs ascii files M(r=i) with i=R1/R2 to work (see https://yade-dem.org/wiki/CapillaryTriaxialTest). These ASCII files contain a set of results from the resolution of the Laplace-Young equation for different configurations of the interacting geometry."
......@@ -122,8 +119,6 @@ public :
};
REGISTER_SERIALIZABLE(Law2_ScGeom_CapillaryPhys_Capillarity1);
} // namespace yade
This diff is collapsed.
......@@ -2,27 +2,26 @@
#pragma once
#include<pkg/common/ElastMat.hpp>
#include<pkg/common/Dispatching.hpp>
#include<pkg/common/Sphere.hpp>
#include<pkg/common/PeriodicEngines.hpp>
#include<pkg/common/NormShearPhys.hpp>
#include<pkg/dem/DemXDofGeom.hpp>
#include<pkg/dem/ScGeom.hpp>
#include<pkg/dem/FrictPhys.hpp>
#include<pkg/dem/ElasticContactLaw.hpp>
#include<pkg/dem/ViscoelasticPM.hpp>
#include<pkg/dem/PDFEngine.hpp>
#include<lib/base/AliasNamespaces.hpp>
#include <lib/base/AliasNamespaces.hpp>
#include <pkg/common/Dispatching.hpp>
#include <pkg/common/ElastMat.hpp>
#include <pkg/common/NormShearPhys.hpp>
#include <pkg/common/PeriodicEngines.hpp>
#include <pkg/common/Sphere.hpp>
#include <pkg/dem/DemXDofGeom.hpp>
#include <pkg/dem/ElasticContactLaw.hpp>
#include <pkg/dem/FrictPhys.hpp>
#include <pkg/dem/PDFEngine.hpp>