7 #ifndef __solve_SemiImplicit_h__ 8 #define __solve_SemiImplicit_h__ 14 #define PARTICLE_DEBUG 22 typedef FE_UWORD FE_UWORD;
36 virtual void initialize(
sp<Scope> a_spScope);
38 virtual void prestep(
void);
39 virtual void step(t_solve_real a_timestep,
t_solve_v3 &a_totalConstraintForce);
41 virtual void setGravity(
t_solve_v3 a_g) { m_gravity = a_g; }
42 virtual void setDirectSolve(
bool a_flag) { m_direct_solve = a_flag; }
43 virtual void set2D(
bool a_flag) { m_2D = a_flag; }
44 virtual void setRayleighDamping(
bool a_flag) { m_rayleigh_damping = a_flag; }
45 virtual void setRayleighDamping(t_solve_real a_stiffness, t_solve_real a_mass)
47 m_rayleigh_stiffness = a_stiffness;
48 m_rayleigh_mass = -a_mass;
69 std::vector<Particle> &particles(
void) {
return m_particles; }
70 bool lookupIndex(
unsigned int &a_particle,
Record &r_particle);
72 class FE_DL_EXPORT CompileMatrix
79 typedef std::vector<t_ppBlock> t_dfdx_array;
80 typedef std::vector<t_ppBlock> t_dfdv_array;
81 typedef std::pair<t_dfdx_array, t_dfdv_array> t_entry;
82 typedef std::map<unsigned int, t_entry> t_row;
84 std::vector<t_row> m_rows;
87 void setRows(
unsigned int a_count);
88 unsigned int rows(
void);
89 t_row &row(
unsigned int a_index);
90 t_entry &entry(
unsigned int a_i,
93 typedef std::set<unsigned int> t_nonzero_set;
94 typedef std::vector< t_nonzero_set > t_nonzero_pattern;
96 void symbolicFill(
void);
100 typedef unsigned int t_size;
101 typedef std::pair<t_size, t_size> t_pair;
102 typedef std::vector<t_pair> t_pairs;
107 virtual ~Force(
void){}
109 virtual void clear(
void){}
110 virtual void accumulate(
void){}
111 virtual bool validate(
void){
return true; }
114 std::vector<Particle> &a_particles,
115 CompileMatrix &a_compileMatrix){}
119 virtual void constrain( std::vector< FilterConstraint<t_solve_real> > &a_filters,
120 std::vector<t_solve_v3> &a_dv,
121 std::vector<t_solve_v3> &a_dx,
125 virtual void addForce(
sp<Force> a_force,
bool a_add_damping=
false);
131 void reorder(std::vector<unsigned int> &a_order, t_pairs &a_pairs);
133 std::vector<Particle> m_particles;
136 AsSolverParticle m_asSolverParticle;
137 AsLineConstrained m_asLineConstrained;
138 AsPlaneConstrained m_asPlaneConstrained;
146 #ifdef PARTICLE_DEBUG 147 AsColored m_asColored;
149 AsForceFilter m_asForceFilter;
153 unsigned int m_n_sim;
154 std::vector< sp<Force> > m_forces_add_damping;
155 std::vector< sp<Force> > m_forces_as_is;
164 std::vector<t_solve_v3> m_rhs;
165 std::vector<t_solve_v3> m_dv;
166 std::vector<t_solve_v3> m_tmp;
170 std::map<FE_UWORD, unsigned int> m_recordToParticle;
173 BlockDiagonalPreconditioner<t_solve_real> m_preconditioner;
175 BlockPCG<t_solve_real> m_solver;
177 t_solve_real m_dv2dxRatio;
178 t_solve_real m_dxImplicitness;
179 t_solve_real m_dvImplicitness;
181 t_solve_real m_ratio;
182 unsigned int m_subdivcnt;
183 unsigned int m_subdivsz;
184 t_solve_real m_subdivmult;
189 bool m_rayleigh_damping;
190 t_solve_real m_rayleigh_stiffness;
191 t_solve_real m_rayleigh_mass;
192 std::vector<t_solve_v3> m_perturb;
194 std::vector<FilterConstraint< t_solve_real> > m_dummy_filters;
just a Component
Definition: AccessorSets.h:92
Heap-based support for classes participating in fe::ptr <>
Definition: Counted.h:35
kernel
Definition: namespace.dox:3
force application point
Definition: shapeAS.h:42
clear signal
Definition: solveAS.h:38
Special vector for color (RGBA)
Definition: Color.h:21
Semi Implicit time integration.
Definition: SemiImplicit.h:29
particle in physical space
Definition: shapeAS.h:58
Time-based Operator.
Definition: datatoolAS.h:73
validate signal
Definition: solveAS.h:80
update state signal
Definition: solveAS.h:97
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Base class providing an fe::Handle to the derived class.
Definition: Handled.h:209
accumulate signal
Definition: solveAS.h:59
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192