34 #ifndef _libDEM_Prop_Periodic_hpp_
35 #define _libDEM_Prop_Periodic_hpp_
94 virtual std::ostream&
write_ascii (std::ostream& out)
const;
95 virtual std::istream&
read_ascii (std::istream& in);
100 template<
class Archive>
void serialize(Archive&,
const unsigned int);
115 template<
class Archive>
void
117 ar & boost::serialization::base_object<Core::Prop<Element> >(*this);
129 #include <boost/serialization/version.hpp>
135 GRANOO_CLASS_DECLARE_TPL(DEM::Periodic);
146 static Base*
new_object(
const std::string& classID, std::istream& in);
BOOST_CLASS_VERSION(GranOO3::DEM::Periodic, 0) namespace GranOO3
Definition: Periodic.hpp:130
Definition: SetOf.hpp:346
Definition: SetOf.hpp:153
a base class that represents an element
Definition: Element.hpp:55
a property for adding periodic behavior to DEM::Element
Definition: Periodic.hpp:54
virtual ~Periodic()
destructor
Definition: Periodic.cpp:63
bool _has_slave
a variable that stores if the element has slave or not
Definition: Periodic.hpp:104
void set_master_from_element()
Definition: Periodic.cpp:87
std::function< Geom::Vector(const Geom::Vector &)> _function_follow_master
Definition: Periodic.hpp:111
void swap_bond(Core::SetOfBase< Element > &set, const Geom::Point &p)
this method allows to swap a bond if a master becomes a slave
Definition: Periodic.cpp:242
bool is_slave() const
for knowing if the element is a slave or not
Definition: Periodic.cpp:186
void make_slave(Periodic &master, std::function< Geom::Vector(const Geom::Vector &)> f, int slave_number=0)
set the element as a slave one
Definition: Periodic.cpp:123
void set_follow_master_function(std::function< Geom::Vector(const Geom::Vector &)> f)
similar as set_slave_function (with a more explicit name), provided for convenience
Definition: Periodic.cpp:175
Periodic * get_master()
an accessor to the master element
Definition: Periodic.cpp:77
Element * _master_element
a variable that stores the master element
Definition: Periodic.hpp:109
void set_master_function(std::function< Geom::Vector(const Geom::Vector &, bool &)> f)
set the master function (only allowed for master element)
Definition: Periodic.cpp:112
void teleport_master()
this method allows to teleport the master element if it crosses a boundary
Definition: Periodic.cpp:281
void set_teleport_master_function(std::function< Geom::Vector(const Geom::Vector &, bool &)> f)
similar as set_master_function (with a more explicit name), provided for convenience
Definition: Periodic.cpp:118
bool _is_slave
a variable that stores if the element is a slave or not
Definition: Periodic.hpp:105
void make_master(std::function< Geom::Vector(const Geom::Vector &, bool &)> f)
set the element as a master one
Definition: Periodic.cpp:105
virtual std::istream & read_ascii(std::istream &in)
Definition: Periodic.cpp:341
unsigned int _slave_number
a variable that stores the number of slave
Definition: Periodic.hpp:106
unsigned int get_slave_number() const
get the slave number
Definition: Periodic.cpp:181
bool has_slave() const
for knowing if the element has slave or not
Definition: Periodic.cpp:191
Periodic()
constructor
Definition: Periodic.cpp:50
void follow_master_motion(bool follow_master_velocity)
this method allows for a slave to follow its master motion
Definition: Periodic.cpp:201
void serialize(Archive &, const unsigned int)
Definition: Periodic.hpp:116
Periodic * _master
a variable that stores the master periodic element
Definition: Periodic.hpp:108
void follow_master_strain()
Definition: Periodic.cpp:227
virtual std::ostream & write_ascii(std::ostream &out) const
Definition: Periodic.cpp:327
Core::SetOfBase< Periodic > * _slave
the list of slave periodic elements
Definition: Periodic.hpp:103
bool is_master() const
for knowing if the element is a master or not
Definition: Periodic.cpp:196
friend class boost::serialization::access
Definition: Periodic.hpp:99
bool _is_master
a variable that stores if the element is a master or not
Definition: Periodic.hpp:107
Core::SetOfBase< Periodic > & slave()
Definition: Periodic.cpp:319
Element * get_master_element()
an accessor to the master element
Definition: Periodic.cpp:94
void set_slave_function(std::function< Geom::Vector(const Geom::Vector &)> f)
set the slave function (only allowed for slave element)
Definition: Periodic.cpp:154
unsigned int get_total_slave_number() const
get the total slave number
Definition: Periodic.cpp:145
std::function< Geom::Vector(const Geom::Vector &, bool &)> _function_teleport_master
Definition: Periodic.hpp:110
void remove_slave(Periodic &)
Definition: Periodic.cpp:308
Definition: Vector.hpp:75
Definition: Common.hpp:198
Definition: SetOfManager.hpp:63
static Base * new_object(const std::string &classID, std::istream &in)
Definition: SetOfManager.hpp:64