Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_SPH_SPH_H
00002 #define OPENTISSUE_DYNAMICS_SPH_SPH_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00016 #include <OpenTissue/dynamics/sph/sph_emitter.h>
00017 #include <OpenTissue/dynamics/sph/sph_idealgas.h>
00018 #include <OpenTissue/dynamics/sph/sph_integrator.h>
00019 #include <OpenTissue/dynamics/sph/sph_kernel.h>
00020 #include <OpenTissue/dynamics/sph/sph_material.h>
00021 #include <OpenTissue/dynamics/sph/sph_particle.h>
00022 #include <OpenTissue/dynamics/sph/sph_solver.h>
00023 #include <OpenTissue/dynamics/sph/sph_system.h>
00024
00025 #include <OpenTissue/dynamics/sph/collision/sph_collision.h>
00026 #include <OpenTissue/dynamics/sph/emitters/sph_emitters.h>
00027 #include <OpenTissue/dynamics/sph/integrators/sph_integrators.h>
00028 #include <OpenTissue/dynamics/sph/kernels/sph_kernels.h>
00029 #include <OpenTissue/dynamics/sph/materials/sph_materials.h>
00030 #include <OpenTissue/dynamics/sph/solvers/sph_solvers.h>
00031
00032 #include <vector>
00033 #include <utility>
00034
00035 namespace OpenTissue
00036 {
00037 namespace sph
00038 {
00039
00040 template < typename type >
00041 class fixed_size_vector {
00042 public:
00043 typedef std::vector<type> container;
00044 typedef typename container::const_iterator const_iterator;
00045 const const_iterator begin() const {return m_elems.begin();}
00046 const const_iterator end() const {return m_elems.begin()+m_size;}
00047 void clear() {m_size=0;}
00048 void resize(size_t fixed_size) {m_elems.resize(fixed_size);m_size=0;}
00049 void push_back(const type& elem) {m_elems[m_size++]=elem;}
00050 fixed_size_vector(size_t fixed_size=0) {resize(fixed_size);}
00051 private:
00052 container m_elems;
00053 size_t m_size;
00054 };
00055
00060 template <
00061 typename Real_Type
00062 , template<typename> class Vector_Type
00063 , typename Particle_Type
00064 , typename Collision_Detection
00065 , typename Hash_Function
00066 , template<typename, typename, typename, typename> class Hash_Grid
00067 , template<typename, typename> class Point_Query
00068 >
00069 class Types
00070 {
00071 public:
00072 typedef Real_Type real_type;
00073 typedef Vector_Type<real_type> vector;
00074 typedef Particle_Type particle;
00075 typedef Collision_Detection collision_detection;
00076 typedef std::vector<particle> particle_container;
00077 typedef std::vector<particle*> particle_ptr_container;
00078 typedef fixed_size_vector<const particle*> particle_cptr_container;
00079 typedef std::pair<const particle*,const particle*> particle_cptr_pair;
00080 typedef std::vector<particle_cptr_pair> particle_cptr_pair_container;
00081 template<typename User_Policy, typename Data_Type>
00082 class hashing
00083 {
00084 public:
00085 typedef Hash_Grid<Vector_Type<real_type>, Vector_Type<long>, Data_Type, Hash_Function> hash_grid;
00086 typedef Point_Query<hash_grid, User_Policy> point_query;
00087 };
00088 };
00089
00090 }
00091 }
00092
00093
00094 #endif