30 #ifndef _LibDEM_Element_T
31 #define _LibDEM_Element_T
35 #include <boost/serialization/version.hpp>
36 #include <boost/serialization/map.hpp>
49 template<
class T>
class ElementT;
58 GRANOO_CLASS_DEFAULT_COLOR(.8, .0, .1, 1.);
98 virtual std::string
info()
const;
110 virtual std::ostream&
write_ascii (std::ostream& os)
const;
123 template<
class Archive>
void serialize(Archive&,
const unsigned int);
143 const double V = get_linear_velocity().norm();
144 const double W = get_angular_velocity().norm();
145 return 0.5*( (
get_mass()*V*V) + (get_inertia_tensor().xx()*W*W));
169 template<
class Archive>
void
171 ar & boost::serialization::base_object<Physic::Body>(*
this);
172 ar & boost::serialization::base_object<Core::PropClass<Element> >(*this);
178 #include <boost/serialization/version.hpp>
184 GRANOO_CLASS_DECLARE_TPL(DEM::Element);
185 extern template class Core::PropClass< DEM::Element >;
BOOST_CLASS_VERSION(GranOO3::DEM::Element, 0) namespace GranOO3
Definition: Element.hpp:179
bool is() const
Definition: Base.hpp:150
Definition: PropClass.hpp:47
Definition: SetOf.hpp:346
Definition: SetOf.hpp:153
the base class for all bonds between discrete elements.
Definition: Bond.hpp:49
a base class that represents an element
Definition: Element.hpp:55
virtual std::ostream & write_ascii(std::ostream &os) const
dump the current state of the element in a ascii file (standard *.lgdd format)
Definition: Element.cpp:218
void serialize(Archive &, const unsigned int)
complete serializing of the element in the *.gdd format
Definition: Element.hpp:170
void make_equal_to(const Element &el)
for equalizing two elements
Definition: Element.cpp:205
bool is_unbonded() const
util method to know if the current element is unbonded
Definition: Element.cpp:142
virtual std::string info() const
get some info on a given element
Definition: Element.cpp:210
Core::SetOfBase< Element > & neighbour_set()
get a list of neighbour element
Definition: Element.hpp:159
NeighbourManager< Element > _neighbour
the always up-to-date list of bond which are bonded to the current element
Definition: Element.hpp:127
virtual ~Element()=0
destructor
Definition: Element.cpp:80
Element(const Element &)=delete
void erase_bond(Bond &b)
erase a bond from the _bondset list
Definition: Element.cpp:176
void add_bond(Bond &b)
add a bond to the _bondset list
Definition: Element.cpp:170
Bond & common_bond(const Element &el)
returns the bond that bonds the current element with the el element
Definition: Element.cpp:111
virtual std::istream & read_ascii(std::istream &is)
update the current state of the element from an ascii file format *.lgdd
Definition: Element.cpp:224
virtual bool is_spherical_element() const =0
util method for knowing if the element is spherical or not
Core::SetOfBase< Bond > & get_bond_set()
get the bond list of the current element
Definition: Element.hpp:132
virtual bool is_polyhedral_element() const =0
util method for knowing if the element is polyhedral or not
void compute_bond_cluster(Core::SetOfBase< DEM::Element > &cluster_set, Core::SetOfBase< DEM::Bond > &parsed_bond)
util method for detecting a cluster
Definition: Element.cpp:152
Element & operator=(const Element &)=delete
friend class boost::serialization::access
Definition: Element.hpp:122
size_t get_bond_number() const
get the number of bond connected to the current element
Definition: Element.hpp:137
double compute_kinetic_energy() const
compute the kinetic energy of the current element
Definition: Element.hpp:142
void delete_all_bond()
delete all the bond connected to the current element
Definition: Element.cpp:197
Core::SetOfBase< Element > get_bonded_element()
get a list of bonded element
Definition: Element.cpp:182
NeighbourManager< Element > & neighbour()
get a list of neighbour element
Definition: Element.hpp:149
Element(Shape::Volume &shape, const Geom::Point &point)
constructor
Definition: Element.cpp:70
virtual std::string shape_class_ID() const =0
get the related shape classID
bool is_bonded() const
util method to know if the current element is bonded
Definition: Element.cpp:147
Core::SetOfBase< Bond > _bondset
the always up-to-date list of bond which are bonded to the current element
Definition: Element.hpp:126
a util class for representing neighbouring (mainly DEM::Element) items
Definition: NeighbourManager.hpp:41
a class that represents a body
Definition: Body.hpp:43
double get_mass() const
get the current mass value of the body
Definition: Body.cpp:58
Definition: Volume.hpp:103
Definition: Common.hpp:198