← Back to team overview

yade-users team mailing list archive

Re: [Question #703419]: About the modifyication of the macro YADE_CLASS_BASE_DOC_ATTRS_CTOR in the class of NormPhys and NormshearPhys

 

Question #703419 on Yade changed:
https://answers.launchpad.net/yade/+question/703419

xuanshenyu posted a new comment:
Thanks Jan, your reply is conducive to solves my problems, adding Phys
attribute in NormshearPhys.

However, there are some confusions about  the  self-defined geomtric
parameters in Ig2_Sphere_Sphere_ScGeom.cpp or hpp. What should I do with
these self-defined parameters so that they can be called in other code
files (such as CohesiveFrictionContactLaw.cpp) in the same way that yade
usually do?

Firstly, I modified the Ig2_Sphere_Sphere_ScGeom.cpp as below (merely  a portion):
  ############Ig2_Sphere_Sphere_ScGeom.cpp (modified)############
 Vector3r                          normal   = (se32.position + shift2) - se31.position; 
    Real                                norm      = normal.norm();
                                            normal  /= norm;          
    Real                                flatR       = 0.5 * s1->radius;             #######         (Parameters added by myselves)                     
    Real                                flatArea = (Pi * pow(flatR, 2));       #######                                        
    const static int            NR           = 2;                                         #######                           
    double                          delR         = flatR / NR;                        #######                                      
    const static int            NC           = 8;                                         #######                           
    Real                                delC        = 2 * Pi / NC;                        #######                                  
    const static int           TotElem  = NR * NC;                            #######                                     
    const static int           totelem  = TotElem-1;                         #######                                    
    Real             elemradius2=pow(pow(s2,2)+pow(t2,2),0.5);                                            
	if (!c->isReal() && !force) { //don't fast-check distance if geometry will be updated anyway
		Real penetrationDepthSq = pow(interactionDetectionFactor * (s1->radius + s2->radius), 2) - normal.squaredNorm(); 
		if (penetrationDepthSq <= 0.01) {
			TIMING_DELTAS_CHECKPOINT("Ig2_Sphere_Sphere_ScGeom");
			return false; 
		}
	}
	shared_ptr<ScGeom> scm;     
	bool isNew = !c->geom;     
    Vector3r elem11[totelem], elem21[totelem];    #####   (Parameters added by myselves)     
    Vector3r elem12[totelem], elem22[totelem];   #####
    Vector3r elem13[totelem], elem23[totelem];   #####
#######################end#################

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.