Itasca C++ Interface
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cmodelsxd::ContactModel Class Referenceabstract

Contact model implementation. More...

#include <contactmodel.h>

Inheritance diagram for cmodelsxd::ContactModel:
cmodelsxd::ContactModelFluid cmodelsxd::ContactModelMechanical cmodelsxd::ContactModelThermal

Public Types

typedef void *(* NewFunction) (size_t, const char *, unsigned)
 
typedef void(* DeleteFunction) (void *, const char *, unsigned)
 
typedef std::pair< NewFunction, DeleteFunction > AllocFunctions
 

Public Member Functions

 ContactModel ()
 Constructor.
 
virtual ~ContactModel ()
 Destructor.
 
virtual ContactModelclone () const =0
 Make a clone of this contact model. Must be implemeted.
 
virtual bool isOKToDelete () const
 Generic implementation - by default it is always OK to delete a contact.
 
virtual void archive (ArchiveStream &)
 Used for save/restore. Important to implement.
 
virtual void copy (const ContactModel *cm)
 Copy the contact model from cm. Must be overridden in derived classes.
 
IContactModel * getContactModel () override
 Return the IContactModel pointer.
 
const IContactModel * getContactModel () const override
 Return the const IContactModel pointer.
 
QString getName () const override=0
 
virtual QString getPluginName () const
 By default, the plugin name is the contact model name. Must be implemented in derived class.
 
QString getProperties () const override=0
 Returns a comma delimited string that lists the contact model properies. Must be implemented in derived classes.
 
QVariant getProperty (uint i, const IContact *con=0) const override=0
 
bool getPropertyGlobal (uint) const override
 
int isProperty (const QString &c, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const override
 
bool setProperty (uint i, const QVariant &v, IContact *con=0) override=0
 
bool getPropertyReadOnly (uint) const override
 
bool supportsInheritance (uint) const override
 
bool getInheritance (uint) const override
 
void setInheritance (uint, bool) override
 
QString getMethods () const override
 
int isMethod (const QString &c, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const override
 Processing of a methods based on the method list returned by getMehtods.
 
QString getMethodArguments (uint) const override
 Default implementation so that no methods must be defined.
 
bool setMethod (uint, const QVector< QVariant > &, IContact *c=0) override
 By default, no methods must be defined.
 
QString getEnergies () const override
 Default implementation so that no energies must be defined.
 
int isEnergy (const QString &c, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const override
 Default implementation so that no energies must be defined.
 
double getEnergy (uint) const override
 Default implementation so that no energies must be defined.
 
bool getEnergyAccumulate (uint) const override
 Default implementation so that no energies must be defined.
 
void setEnergy (uint, const double &) override
 Default implementation so that no energies must be defined.
 
void activateEnergy () override
 Default implementation so that no energies must be defined.
 
virtual bool getEnergyActivated () const
 Default implementation so that no energies must be defined.
 
uint getMinorVersion () const override=0
 
void destroy () override
 
void getSphereList (const IContact *con, std::vector< DVect > *pos, std::vector< double > *rad, std::vector< double > *val) override=0
 For contact specific plotting.
 
void getCylinderList (const IContact *con, std::vector< DVect > *bot, std::vector< DVect > *top, std::vector< double > *radlow, std::vector< double > *radhi, std::vector< double > *val) override=0
 For contact specific plotting.
 
virtual QString getFishCallEvents () const
 Return a comma delimited liest of FISH callback events.
 
void setEventVal (int i, int j)
 Set the order of the contact model events as stored in the ContactModelList.
 
void setFromParent (const ContactModel *cm)
 For executing events within the contact model.
 
void setNonForcePropsFrom (IContactModel *) override
 
uint getPropertyIndex (const QString &name, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
 
QString getPropertyName (uint index) const
 Utility function that returns the property name given it's index.
 
void * operator new (size_t size)
 
void * operator new (size_t size, const char *file, unsigned line)
 
void operator delete (void *v)
 
void operator delete (void *v, const char *file, unsigned line)
 

Static Public Member Functions

static uint32 getMajorVersion ()
 
static AllocFunctions setAllocFunctions (AllocFunctions afunc)
 
static AllocFunctions getDefaultAllocFunctions ()
 
static AllocFunctions getAllocFunctions ()
 

Protected Attributes

FArray< int, 5 > cmEvents_
 Set of events as defined in a specified order. The int refers to the location of the event in the ContactModelMechanicalList.
 

Static Protected Attributes

static NewFunction newFunc_ = defaultNewFunction
 
static DeleteFunction deleteFunc_ = defaultDeleteFunction
 

Detailed Description

Contact model implementation.

Member Function Documentation

◆ clone()

virtual ContactModel * cmodelsxd::ContactModel::clone ( ) const
pure virtual

Make a clone of this contact model. Must be implemeted.

Implemented in cmodelsxd::ContactModelMechanical.

◆ getCylinderList()

void cmodelsxd::ContactModel::getCylinderList ( const IContact * con,
std::vector< DVect > * bot,
std::vector< DVect > * top,
std::vector< double > * radlow,
std::vector< double > * radhi,
std::vector< double > * val )
overridepure virtual

◆ getProperty()

QVariant cmodelsxd::ContactModel::getProperty ( uint i,
const IContact * con = 0 ) const
overridepure virtual

Returns a QVariant corresponding to the property with position i in the string returned by getProperties(). Must be implemented in derived classes.

Parameters
iPosition index in the comma-delimited property list string.
conOptional contact pointer. This pointer is null if the contact model instance is not assigned to any contact.

◆ getPropertyGlobal()

bool cmodelsxd::ContactModel::getPropertyGlobal ( uint ) const
inlineoverride

Returns a boolean indicating whether the property with a given index (see the getProperty() method description) is expressed in the global coordinate system or in the contact local coordinate system. This is important for vectors. Must be overridden in derived classes.

◆ getPropertyIndex()

uint cmodelsxd::ContactModel::getPropertyIndex ( const QString & name,
Qt::CaseSensitivity cs = Qt::CaseInsensitive ) const

Utility function that returns the property index based on its name, or 0 if property doesn't exist. Case insensitive by default.

◆ getSphereList()

void cmodelsxd::ContactModel::getSphereList ( const IContact * con,
std::vector< DVect > * pos,
std::vector< double > * rad,
std::vector< double > * val )
overridepure virtual

◆ isOKToDelete()

virtual bool cmodelsxd::ContactModel::isOKToDelete ( ) const
inlinevirtual

Generic implementation - by default it is always OK to delete a contact.

Reimplemented in cmodelsxd::ContactModelMechanical.

◆ isProperty()

int cmodelsxd::ContactModel::isProperty ( const QString & c,
Qt::CaseSensitivity cs = Qt::CaseInsensitive ) const
override

Returns the integer index of a property based on the property list returned by getProperties, starting at 1. This method overrides the IContactModel pure virtual method, and should not be overridden by derived classes.

◆ setNonForcePropsFrom()

void cmodelsxd::ContactModel::setNonForcePropsFrom ( IContactModel * )
inlineoverride

For setting the contact model properties from another contact model but without changing the forces - just the properties.

◆ setProperty()

bool cmodelsxd::ContactModel::setProperty ( uint i,
const QVariant & v,
IContact * con = 0 )
overridepure virtual

Set the value of the property at position i in the string returned by getProperties(). Must be implemented in derived classes.

Parameters
iPosition index in the comma-delimited property list string.
vQVariant holding the value to be set.
conOptional contact pointer. This pointer is null if the contact model instance is not assigned to any contact.

The documentation for this class was generated from the following files: