7 #ifndef __solve_SemiImplicit1D_h__ 8 #define __solve_SemiImplicit1D_h__ 14 #define PARTICLE_DEBUG 107 inline t_solve_real l_ext(t_solve_real a_value, t_solve_real a_ratio)
109 return a_value / a_ratio;
111 inline t_solve_real v_ext(t_solve_real a_value, t_solve_real a_ratio)
113 return a_value / a_ratio;
115 inline t_solve_real f_ext(t_solve_real a_value, t_solve_real a_ratio)
117 return a_value * a_ratio;
119 inline t_solve_real k_ext(t_solve_real a_value, t_solve_real a_ratio)
121 return a_value * a_ratio * a_ratio;
123 inline t_solve_real d_ext(t_solve_real a_value, t_solve_real a_ratio)
125 return a_value * a_ratio * a_ratio;
127 inline t_solve_real m_int_deprecate(t_solve_real a_mass, t_solve_real a_ratio)
129 return a_mass * a_ratio * a_ratio;
135 inline t_solve_real l_int(t_solve_real a_value, t_solve_real a_ratio)
137 return a_value * a_ratio;
139 inline t_solve_real v_int(t_solve_real a_value, t_solve_real a_ratio)
141 return a_value * a_ratio;
144 inline t_solve_real f_int(t_solve_real a_value, t_solve_real a_ratio)
146 return a_value / a_ratio;
161 virtual void initialize(
sp<Scope> a_spScope);
163 virtual void step(t_solve_real a_timestep, t_solve_real &a_totalConstraintForce);
165 virtual void setRayleighDamping(
bool a_flag) { m_rayleigh_damping = a_flag; }
166 virtual void setRayleighDamping(t_solve_real a_stiffness, t_solve_real a_mass)
168 m_rayleigh_stiffness = a_stiffness;
169 m_rayleigh_mass = -a_mass;
172 virtual void shiftDomain(t_solve_real a_period,
unsigned int a_p);
173 virtual void shiftDomain(
void);
177 void propogateRatiosFrom(
unsigned int a_p);
180 void reconfigure(
void);
184 typedef unsigned int t_size;
193 t_pair(
const t_size &a_first,
const t_size &a_second)
199 void setGearRatio(
int a_from,
int a_to)
201 if (a_from < 1) { a_from = 1; }
202 if (a_to < 1) { a_to = 1; }
203 m_ratio = (t_solve_real)a_from/(t_solve_real)a_to;
206 void setIrrational(t_solve_real a_maybe_irrational)
208 m_ratio = a_maybe_irrational;
215 t_solve_real m_ratio;
217 typedef std::vector< fe::sp<t_pair> > t_pairs;
223 t_solve_real m_location;
224 t_solve_real m_adjustment;
225 t_solve_real m_velocity;
226 t_solve_real m_force;
227 t_solve_real m_force_weak;
228 t_solve_real m_force_external;
230 t_solve_real m_prev_location;
231 t_solve_real m_prev_velocity;
232 t_solve_real m_constraint_force;
234 t_solve_real m_ratio;
236 t_solve_real m_location_ratio;
242 #ifdef PARTICLE_DEBUG 247 std::vector<Particle> &particles(
void) {
return m_particles; }
248 bool lookupIndex(
unsigned int &a_particle,
Record &r_particle);
250 class FE_DL_EXPORT CompileMatrix
254 ~CompileMatrix(
void);
256 typedef t_solve_real **t_ppBlock;
257 typedef std::vector<t_ppBlock> t_dfdx_array;
258 typedef std::vector<t_ppBlock> t_dfdv_array;
259 typedef std::pair<t_dfdx_array, t_dfdv_array> t_entry;
260 typedef std::map<unsigned int, t_entry> t_row;
262 std::vector<t_row> m_rows;
265 void setRows(
unsigned int a_count);
266 unsigned int rows(
void);
267 t_row &row(
unsigned int a_index);
268 t_entry &entry(
unsigned int a_i,
271 typedef std::set<unsigned int> t_nonzero_set;
272 typedef std::vector< t_nonzero_set > t_nonzero_pattern;
274 void symbolicFill(
void);
277 typedef std::vector< std::vector<unsigned int> > t_shift;
278 typedef std::vector< std::vector<unsigned int> > t_neighbors;
282 Force(
void){ m_timestep = 0.0; }
283 virtual ~Force(
void){}
286 virtual void accumulate(
void) = 0;
287 virtual bool validate(
void){
return true; }
290 std::vector<Particle> &a_particles,
291 CompileMatrix &a_compileMatrix){}
294 t_pairs &a_pairs) { }
295 void setTimestep(t_solve_real a_timestep) { m_timestep = a_timestep; }
296 virtual void reconfigure(
void) {}
298 t_solve_real m_timestep;
301 virtual void addForce(
sp<Force> a_force,
bool a_add_damping=
false);
306 t_solve_real m_int(t_solve_real a_mass, t_solve_real a_ratio)
308 return a_mass * a_ratio * a_ratio;
311 void reorder(std::vector<unsigned int> &a_order, t_pairs &a_pairs);
313 std::vector<Particle> m_particles;
316 AsSolverParticle1D m_asSolverParticle;
324 #ifdef PARTICLE_DEBUG 325 AsColored m_asColored;
327 AsForceFilter m_asForceFilter;
331 unsigned int m_n_sim;
332 std::vector< sp<Force> > m_forces_add_damping;
333 std::vector< sp<Force> > m_forces_as_is;
335 t_solve_real m_dummy_block;
342 std::vector<t_solve_real> m_rhs;
343 std::vector<t_solve_real> m_dv;
344 std::vector<t_solve_real> m_tmp;
347 std::map<FE_UWORD, unsigned int> m_recordToParticle;
349 t_solve_real m_dv2dxRatio;
350 t_solve_real m_dxImplicitness;
351 t_solve_real m_dvImplicitness;
353 unsigned int m_subdivcnt;
354 unsigned int m_subdivsz;
355 t_solve_real m_subdivmult;
357 bool m_rayleigh_damping;
358 t_solve_real m_rayleigh_stiffness;
359 t_solve_real m_rayleigh_mass;
360 std::vector<t_solve_real> m_perturb;
362 std::vector<t_solve_real> m_adjustableState;
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
clear signal
Definition: solveAS.h:38
Special vector for color (RGBA)
Definition: Color.h:21
force application point
Definition: shapeAS.h:98
Semi Implicit time integration.
Definition: SemiImplicit1D.h:154
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
particle in physical space
Definition: shapeAS.h:114
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