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


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to