GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | Friends | List of all members
GranOO3::DEM::PeriodicBoundary Class Referenceabstract

a singleton virtual class for representing periodic boundaries More...

#include <PeriodicBoundary.hpp>

Inheritance diagram for GranOO3::DEM::PeriodicBoundary:
Inheritance graph
[legend]

Public Member Functions

 PeriodicBoundary ()
 constructor More...
 
virtual ~PeriodicBoundary ()
 destructor More...
 
virtual void init_function ()=0
 a pure virtual function that must be overridden More...
 
virtual void draw ()=0
 a pure virtual function to draw the domain More...
 
void make_periodic (Element &el)
 a function that transforms a normal element into a periodic master element with its related slaves More...
 
void init_periodic_object ()
 a function that initializes all the Periodic instances More...
 
void retrieve_slave ()
 
void clean_slave_element_without_master ()
 
virtual std::string info () const
 a util method to get some info More...
 
std::function< Geom::Vector(const Geom::Vector &, bool &)> & get_periodic_mv_function ()
 get the move function More...
 
std::function< Geom::Vector(const Geom::Vector &)> & get_follow_master_function (unsigned int rank)
 get the "follow master" More...
 
virtual std::ostream & write_ascii (std::ostream &out) const
 
virtual std::istream & read_ascii (std::istream &in)
 
- Public Member Functions inherited from GranOO3::Core::Base
virtual ~Base ()
 
size_t numID () const
 
size_t uID () const
 
void set_numID (size_t val)
 
void clear_numID ()
 
Physic::Materialget_mat () const
 
void set_mat (Physic::Material *)
 
Baseitem ()
 
const Baseitem () const
 
bool is_same (const Base &) const
 
template<class T >
T & cast_to ()
 
template<class T >
const T & cast_to () const
 
template<class T >
bool is () const
 
virtual bool is (size_t) const
 
virtual const std::string & get_ID () const
 
virtual Baseclone ()
 
template<class T >
T & clone_to ()
 
virtual std::ostream & export_to_povray (std::ostream &out) const
 
Signal< Base & > & deleted_signal ()
 
- Public Member Functions inherited from GranOO3::Core::Null
 Null ()
 
virtual ~Null ()
 
- Public Member Functions inherited from GranOO3::Core::Drawable
 Drawable ()
 
virtual ~Drawable ()
 
virtual void draw_edge ()
 
virtual void init_default_color ()
 
virtual std::ostream & get_info (std::ostream &os) const
 
virtual const Colordefault_color () const
 
Colorget_color ()
 
const Colorget_color () const
 
virtual void set_color (const Color &)
 
virtual void set_alpha (float alpha)
 
void apply_color () const
 
void apply_edge_color () const
 
void apply_default_color ()
 
void apply_selected_color ()
 
void set_line_width (float)
 
float get_line_width () const
 
float & get_line_width ()
 
void apply_line_width () const
 
bool is_visible () const
 
void set_visible (bool)
 
void paint ()
 
void paint_edge ()
 
unsigned int get_item_glkey () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Base >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Base > &set) const
 
std::list< SetOf< Base > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< PeriodicBoundary >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< PeriodicBoundary > *)
 
void remove_prop (Core::Prop< PeriodicBoundary > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< PeriodicBoundary >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< PeriodicBoundary > &set) const
 
std::list< SetOf< PeriodicBoundary > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 

Static Public Member Functions

static PeriodicBoundaryget ()
 get the singleton instance of the periodic boundaries More...
 
- Static Public Member Functions inherited from GranOO3::Core::Base
static Baseget_by_numID (size_t)
 
static void clear_all_numID ()
 
static unsigned int get_sub_class_number ()
 
- Static Public Member Functions inherited from GranOO3::Core::Drawable
static Drawableget_drawable_item_by_glkey (int)
 
static void set_draw_precision (unsigned int p)
 
static void increase_draw_precision ()
 
static void decrease_draw_precision ()
 
static unsigned int get_draw_precision ()
 

Protected Member Functions

template<class Archive >
void serialize (Archive &, const unsigned int)
 complete serializing of the FractureFacet in the *.gdd format More...
 
- Protected Member Functions inherited from GranOO3::Core::Base
 Base ()
 

Protected Attributes

std::function< Geom::Vector(const Geom::Vector &, bool &)> _periodic_mv_function
 a simple function for moving master elements from one boundary to another More...
 
std::vector< std::function< Geom::Vector(const Geom::Vector &)> > _follow_master_function
 a list of simple functions for moving slave elements considering the master More...
 
- Protected Attributes inherited from GranOO3::Core::PropClass< PeriodicBoundary >
std::vector< Core::Prop< PeriodicBoundary > * > _prop
 

Private Member Functions

 PeriodicBoundary (const PeriodicBoundary &)=delete
 
PeriodicBoundaryoperator= (const PeriodicBoundary &)=delete
 

Static Private Attributes

static PeriodicBoundary_me = nullptr
 a pointer to the singleton More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Attributes inherited from GranOO3::Core::Null
static Null null = Null()
 
- Static Protected Member Functions inherited from GranOO3::Core::Base
static unsigned int affect_class_rank_ID ()
 

Detailed Description

a singleton virtual class for representing periodic boundaries

This class is the main entry point for managing periodic boundaries with GranOO. When you manage periodic boundaries, you should consider "slave" and "master" elements. The master elements are the main elements which are inside the boundary whereas the slave elements are some kind of clones of the master elements. For example, within a Full3D periodic boundaries (using parallelepipedic domains) a single master element has 27 slave elements. A master element could interact with a slave element by contacts or bonds. When a master element crosses a boundary, he is immediately "teleported" to the other front boundary. Note that, slave elements have similar displacements, velocities, masses and so on, from their master elements. If you want to accede to master element and slave elements, you can retrieve them with the "Master" and "Slave" IDs SetOf

Note that this class is purely virtual. You can override this class to implement different kind of periodic boundaries. The available periodic boundaries are located into the PeriodicBoundary folder. Note that a property called Periodic is associated to Element in order to manage periodic boundaries.

Constructor & Destructor Documentation

◆ PeriodicBoundary() [1/2]

GranOO3::DEM::PeriodicBoundary::PeriodicBoundary ( )

constructor

◆ ~PeriodicBoundary()

GranOO3::DEM::PeriodicBoundary::~PeriodicBoundary ( )
virtual

destructor

◆ PeriodicBoundary() [2/2]

GranOO3::DEM::PeriodicBoundary::PeriodicBoundary ( const PeriodicBoundary )
privatedelete

Member Function Documentation

◆ clean_slave_element_without_master()

void GranOO3::DEM::PeriodicBoundary::clean_slave_element_without_master ( )

◆ draw()

void GranOO3::DEM::PeriodicBoundary::draw ( )
pure virtual

a pure virtual function to draw the domain

This function is used by the granoo-viewer tool in order to visualize the periodic boundary.

Reimplemented from GranOO3::Core::Drawable.

Implemented in GranOO3::DEM::Full3D.

◆ get()

PeriodicBoundary & GranOO3::DEM::PeriodicBoundary::get ( )
static

get the singleton instance of the periodic boundaries

◆ get_follow_master_function()

std::function< Geom::Vector(const Geom::Vector &)> & GranOO3::DEM::PeriodicBoundary::get_follow_master_function ( unsigned int  rank)
inline

get the "follow master"

Parameters
[in]therank of the wanted "follow master" function
Returns
simply returns the _follow_master_function located at the rank rank

◆ get_periodic_mv_function()

std::function< Geom::Vector(const Geom::Vector &, bool &)> & GranOO3::DEM::PeriodicBoundary::get_periodic_mv_function ( )
inline

get the move function

Returns
simply returns the _periodic_mv_function attribute

◆ info()

std::string GranOO3::DEM::PeriodicBoundary::info ( ) const
virtual

a util method to get some info

Returns
some info

Reimplemented from GranOO3::Core::Base.

Reimplemented in GranOO3::DEM::Full3D.

◆ init_function()

void GranOO3::DEM::PeriodicBoundary::init_function ( )
pure virtual

a pure virtual function that must be overridden

This function must be overridden in order to initialize the _follow_master_function

Implemented in GranOO3::DEM::Full3D.

◆ init_periodic_object()

void GranOO3::DEM::PeriodicBoundary::init_periodic_object ( )

a function that initializes all the Periodic instances

This method must be used once, just before running a periodic simulation. For instance, it is used in the initialization method of ApplyPeriodicCondition plugin.

◆ make_periodic()

void GranOO3::DEM::PeriodicBoundary::make_periodic ( Element el)

a function that transforms a normal element into a periodic master element with its related slaves

Parameters
[in]el: a regular element to transform into a periodic one

This method does the following things :

  • transforms the el element into a master element
  • clones the el element (making slave elements)
  • associates DEM::Periodic properties to the master and slave elements
    Note that this method must be called in order to transform a normal simulation with regular boundaries into a periodic simulation with periodic boundaries.

◆ operator=()

PeriodicBoundary& GranOO3::DEM::PeriodicBoundary::operator= ( const PeriodicBoundary )
privatedelete

◆ read_ascii()

std::istream & GranOO3::DEM::PeriodicBoundary::read_ascii ( std::istream &  in)
virtual

Reimplemented from GranOO3::Core::Base.

Reimplemented in GranOO3::DEM::Full3D.

◆ retrieve_slave()

void GranOO3::DEM::PeriodicBoundary::retrieve_slave ( )

◆ serialize()

template<class Archive >
void GranOO3::DEM::PeriodicBoundary::serialize ( Archive &  ar,
const unsigned int  version 
)
protected

complete serializing of the FractureFacet in the *.gdd format

See also
the Domain classes to get additional info about I/O

◆ write_ascii()

std::ostream & GranOO3::DEM::PeriodicBoundary::write_ascii ( std::ostream &  out) const
virtual

Reimplemented from GranOO3::Core::Base.

Reimplemented in GranOO3::DEM::Full3D.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ _follow_master_function

std::vector< std::function< Geom::Vector(const Geom::Vector &)> > GranOO3::DEM::PeriodicBoundary::_follow_master_function
protected

a list of simple functions for moving slave elements considering the master

This vector contains a list of function which are used for moving the slave elements. Here, a list must be used as several slaves are considered for a single master element. For instance, for the Full3D periodic condition, 27 functions (one per slave) must be present. Each of these functions are passed to the Periodic property and are is mainly used by the Periodic::follow_master_motion() method which is called by the ApplyPeriodicCondition plugin.

Each of these functions takes a Geom::Vector as input which corresponds to the current position of the master element and returns the position of the considered slave element.

◆ _me

PeriodicBoundary * GranOO3::DEM::PeriodicBoundary::_me = nullptr
staticprivate

a pointer to the singleton

◆ _periodic_mv_function

std::function< Geom::Vector(const Geom::Vector &, bool &)> GranOO3::DEM::PeriodicBoundary::_periodic_mv_function
protected

a simple function for moving master elements from one boundary to another

This function is used to move a master element from one boundary to another one (also called teleportation). In fact, this function is passed to the Periodic property is mainly used by the Periodic::teleport_master() method which is called by the ApplyPeriodicCondition plugin.

For now, this teleportation feature is just activated for pure granular simulation without bonds. Managing bonds with teleportation is not yet supported. However, it is not really problem as bonded domains represent continuum domain where teleportation is not expected.

This _periodic_mv_function function :

  • takes a Geom::Vector as input which corresponds to the current position vector of the element
  • returns the new position of the considered element
  • note that the boolean parameters is used as output for telling if the considered element must be teleported or not

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