← Back to team overview

yade-dev team mailing list archive

(Anecdotic ?) Changes in Law2_.._Capillarity : H-M / C-S

 

Hi,

I'm reading for the first time capillary code (Law2_ScGeom_CapillaryPhys_Capillarity::action). Depending on the contact law used in the simulation, two different interaction physics are handled :
- either "cundallContactPhysics" (CapillaryPhys type)
- or "mindlinContactPhysics" (MindlinCapillaryPhys type)

And, in the whole code, "herzOn" bool variable is checked, to know if cundallContactPhysics, or mindlinContactPhysics has to be accessed. I have the feeling that, in the end, we always access variables with same name and meaning (give a look at the attached diff, comparing the attributes list of these two classes), either from cundallContactPhysics, or mindlinContactPhysics. E.g. hertzOn? mindlinContactPhysics->meniscus : cundallContactPhysics->meniscus...

My question is : could we get rid of these two different variables, use only one variable "contactPhys", defined once for all with :

if !hertzOn
    contactPhysics = static_cast<CapillaryPhys*>(interaction->phys.get());
else
    contactPhysics = static_cast<MindlinCapillaryPhys*>(interaction->phys.get())

And, after that, use only contactPhysics->meniscus

A second question would be "is it worth ?', but I could do the task without answering this question...

Jerome



Follow ups