ScaleCoupling< M, O >::CoupledParticle Struct Reference

For all particles, stores coupling properties: coupling force, pointer to coupled element and location in coupled element. More...

Public Member Functions

void removeCoupledElement (BaseParticle *particle)
 Removes particle from coupledParticle.coupledElement.particles and sets coupledParticle.coupledElement vector to null. More...
 
void setCoupledElement (CoupledElement *coupledElementNew, BaseParticle *particle)
 Remove particle from coupledParticle.coupledElement.particles and set coupledParticle.coupledElement vector to null. More...
 

Public Attributes

Vec3D couplingForce
 Coupling force. More...
 
CoupledElementcoupledElement_pt = nullptr
 Element in which this particle resides (null if particle is not coupled) More...
 
Vector< doubles
 Location of particle in coupled element, returned by locate zeta. More...
 

Detailed Description

template<class M, class O>
struct ScaleCoupling< M, O >::CoupledParticle

For all particles, stores coupling properties: coupling force, pointer to coupled element and location in coupled element.

Member Function Documentation

◆ removeCoupledElement()

template<class M , class O >
void ScaleCoupling< M, O >::CoupledParticle::removeCoupledElement ( BaseParticle particle)
inline

Removes particle from coupledParticle.coupledElement.particles and sets coupledParticle.coupledElement vector to null.

71  {
72  if (coupledElement_pt != nullptr) {
73  remove(coupledElement_pt->coupledParticles.begin(), coupledElement_pt->coupledParticles.end(), particle);
74  coupledElement_pt = nullptr;
75  logger(VERBOSE, "Removed particle % from element %", particle->getIndex(), coupledElement_pt);
76  }
77  }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ VERBOSE
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
std::vector< BaseParticle * > coupledParticles
Definition: ScaleCoupling.h:55
CoupledElement * coupledElement_pt
Element in which this particle resides (null if particle is not coupled)
Definition: ScaleCoupling.h:66

References ScaleCoupling< M, O >::CoupledElement::coupledParticles, BaseObject::getIndex(), logger, and VERBOSE.

Referenced by ScaleCoupling< M, O >::updateCoupledElements().

◆ setCoupledElement()

template<class M , class O >
void ScaleCoupling< M, O >::CoupledParticle::setCoupledElement ( CoupledElement coupledElementNew,
BaseParticle particle 
)
inline

Remove particle from coupledParticle.coupledElement.particles and set coupledParticle.coupledElement vector to null.

80  {
81  if (coupledElement_pt != coupledElementNew) {
82  if (coupledElement_pt != nullptr) {
83  remove(coupledElement_pt->coupledParticles.begin(), coupledElement_pt->coupledParticles.end(), particle);
84  logger(VERBOSE, "Moved particle % from element % to %", particle->getIndex(), coupledElement_pt, coupledElementNew);
85  } else {
86  logger(VERBOSE,"Added particle % to element %", particle->getIndex(), coupledElementNew);
87  }
88  // add coupledElement to particle
89  coupledElement_pt = coupledElementNew;
90  // add particle to coupledElement
91  coupledElement_pt->coupledParticles.push_back(particle);
92  }
93  }

References ScaleCoupling< M, O >::CoupledElement::coupledParticles, BaseObject::getIndex(), logger, and VERBOSE.

Referenced by ScaleCoupling< M, O >::updateCoupledElements().

Member Data Documentation

◆ coupledElement_pt

template<class M , class O >
CoupledElement* ScaleCoupling< M, O >::CoupledParticle::coupledElement_pt = nullptr

Element in which this particle resides (null if particle is not coupled)

Referenced by ScaleCoupling< M, O >::updateCoupledElements().

◆ couplingForce

template<class M , class O >
Vec3D ScaleCoupling< M, O >::CoupledParticle::couplingForce

◆ s

template<class M , class O >
Vector<double> ScaleCoupling< M, O >::CoupledParticle::s

Location of particle in coupled element, returned by locate zeta.

Referenced by ScaleCoupling< M, O >::updateCoupledElements().


The documentation for this struct was generated from the following file: