← Back to team overview

yade-users team mailing list archive

Re: [Question #261724]: Interaction of FrictMat and a new class of material

 

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

    Status: Answered => Open

behzad is still having a problem:
Goo idea

However, I tried it the same way it appears in the examples, but it
didn't work!

I have go function in cpp as:

void Ip2_FrictMat_CohBurgersMat_CohBurgersPhys::go(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction) 
{

  if(interaction->phys) return;
  shared_ptr<CohBurgersPhys> phys (new CohBurgersPhys());
 
//  const shared_ptr<FrictMat>& mat1 = YADE_PTR_CAST<FrictMat>(b1);
//  const shared_ptr<CohBurgersMat>& mat2 = YADE_PTR_CAST<CohBurgersMat>(b2);

  FrictMat* mat1 = static_cast<FrictMat*>(b1.get());
  CohBurgersMat* mat2 = static_cast<CohBurgersMat*>(b2.get());

  ScGeom* geom= YADE_CAST<ScGeom*>(interaction->geom.get());

  Real mass1 = 1.0;
  Real mass2 = 1.0;
  Real Ra = geom->radius1;
  Real Rb = geom->radius2;

  mass1=Body::byId(interaction->getId1())->state->mass;
  mass2=Body::byId(interaction->getId2())->state->mass;

//Load the rheological parameters
  
  Real kn1 = (mat1->young); Real ks1 = (mat1->young)*(mat1->poisson);
  Real kmn2 = (mat2->kmn); Real kkn2 = (mat2->kkn);
  Real cmn2 = (mat2->cmn); Real ckn2 = (mat2->ckn);
  Real kms2 = (mat2->kms); Real kks2 = (mat2->kks);
  Real cms2 = (mat2->cms); Real cks2 = (mat2->cks);

  phys->kmn = contactParameterCalculation(kn1,kmn2);
  phys->kms = contactParameterCalculation(ks1,kms2);
  phys->cmn = cmn2;
  phys->cms = cms2;

  phys->kkn = kkn2;
  phys->kks = kks2;
  phys->ckn = ckn2;
  phys->cks = cks2;
  phys->MaxDef = 0.25*(Ra+Rb);
  phys->normalAdhesion= mat2->normalCohesion*0.5*pow(std::min(Ra,Rb),2);

  interaction->phys = shared_ptr<CohBurgersPhys>(phys);

  
  phys->cohesionBroken = false;
  phys->initCohesion   = true;
  cohesionDefinitionIteration = -1;
  setCohesionNow = true;

}


and th goReverse as:


void Ip2_FrictMat_CohBurgersMat_CohBurgersPhys::goReverse(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction)
{
  interaction->swapOrder();
  go(b1,b2,interaction);

}

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.