7 #ifndef __mechanics_mechanicsAS_h__ 8 #define __mechanics_mechanicsAS_h__ 18 class FE_DL_EXPORT AsFrame :
20 public Initialize<AsFrame>
26 add(transform, FE_SPEC(
"spc:transform",
"spatial transform"));
31 virtual void populate(sp<Layout> spLayout)
33 AccessorSet::populate(spLayout);
36 scope()->within(spLayout->name(),
"spc:location",
37 "spc:transform", 3*
sizeof(SpatialVector));
43 Accessor<SpatialTransform> transform;
46 class FE_DL_EXPORT AsChildFrame:
48 public Initialize<AsChildFrame>
53 add(parent, FE_SPEC(
"frame:parent",
"parent record"));
55 Accessor<Record> parent;
58 class FE_DL_EXPORT AsMark:
60 public Initialize<AsMark>
65 add(mark, FE_SPEC(
"generic:mark",
"transient mark for algorithm usage"));
70 class FE_DL_EXPORT AsGenericInt:
72 public Initialize<AsGenericInt>
77 add(integer, FE_SPEC(
"generic:i_0",
"transient generic integer"));
79 Accessor<int> integer;
82 class FE_DL_EXPORT AsZYXTFrame:
84 public Initialize<AsZYXTFrame>
89 add(zyx, FE_SPEC(
"frame:zyx",
"Euler angle rotations in ZYX order"));
90 add(t, FE_SPEC(
"frame:t",
"translation"));
92 Accessor<SpatialVector> zyx;
93 Accessor<SpatialVector> t;
96 class FE_DL_EXPORT AsRelativeFrame:
98 public Initialize<AsRelativeFrame>
101 void initialize(
void)
103 add(bound, FE_SPEC(
"frame:bound",
"whether frame has been bound to the parent"));
104 add(reference, FE_SPEC(
"frame:reference",
"reference frame to use for binding, relative to parent"));
105 add(delta, FE_SPEC(
"frame:delta",
"the transform representing the binding"));
107 Accessor<bool> bound;
108 Accessor<Record> reference;
109 Accessor<SpatialTransform> delta;
112 class FE_DL_EXPORT AsBodyFrame :
114 public Initialize<AsBodyFrame>
117 void initialize(
void)
119 add(component, FE_SPEC(
"component",
"a generic component"));
121 Accessor< sp<Component> > component;
124 class FE_DL_EXPORT AsWeightedPoint :
126 public Initialize<AsWeightedPoint>
129 void initialize(
void)
131 add(weight, FE_SPEC(
"spc:weight",
"weight of a point"));
132 add(point, FE_SPEC(
"spc:point",
"spatial point"));
135 Accessor< Record > point;
138 class FE_DL_EXPORT AsBarycentricPoint :
140 public Initialize<AsBarycentricPoint>
143 void initialize(
void)
145 add(location, FE_SPEC(
"spc:location",
"location of a point defined with weighted points"));
146 add(velocity, FE_SPEC(
"spc:velocity",
"velocity of a point defined with weighted points"));
147 add(weightedPoints, FE_SPEC(
"spc:weightedPoints",
"collection of weighted points"));
149 Accessor<SpatialVector> location;
150 Accessor<SpatialVector> velocity;
151 Accessor< sp<RecordGroup> > weightedPoints;
156 e_forcePoint = (int)(1 << 0),
157 e_solverParticle = (int)(1 << 1),
158 e_barycentricPoint = (int)(1 << 2)
161 class FE_DL_EXPORT AsExplicitPointType :
163 public Initialize<AsExplicitPointType>
166 void initialize(
void)
168 add(type, FE_USE(
"spc:pointType"));
174 class FE_DL_EXPORT AsLocatedFrame :
176 public Initialize<AsLocatedFrame>
179 void initialize(
void)
181 add(locator0, FE_USE(
"bdy:locator0"));
182 add(locator1, FE_USE(
"bdy:locator1"));
183 add(locator2, FE_USE(
"bdy:locator2"));
184 add(offset, FE_USE(
"bdy:offset"));
187 Accessor<Record> locator0;
189 Accessor<Record> locator1;
191 Accessor<Record> locator2;
193 Accessor<SpatialVector> offset;
198 class FE_DL_EXPORT AsPhysicalFrame :
200 public Initialize<AsPhysicalFrame>
203 void initialize(
void)
205 add(force, FE_USE(
"bdy:force"));
206 add(torque, FE_USE(
"bdy:torque"));
209 m_asBodyFrame.bind(scope());
210 m_asLocatedFrame.bind(scope());
211 m_asForcePoint.bind(scope());
212 m_asChildFrame.bind(scope());
215 Accessor<SpatialVector> force;
216 Accessor<SpatialVector> torque;
219 SpatialVector velocity(Record r_frame,
220 const SpatialVector &a_worldLocation);
222 AsBodyFrame m_asBodyFrame;
223 AsLocatedFrame m_asLocatedFrame;
224 AsForcePoint m_asForcePoint;
225 AsChildFrame m_asChildFrame;
231 inline SpatialVector AsPhysicalFrame::velocity(Record r_frame,
const SpatialVector &a_worldLocation)
233 SpatialVector velocity;
235 if(m_asBodyFrame.check(r_frame))
237 sp<BodyI> spBody(m_asBodyFrame.component(r_frame));
240 spBody->getVelocity(velocity, a_worldLocation);
247 if(m_asLocatedFrame.check(r_frame))
249 Record r_locator0 = m_asLocatedFrame.locator0(r_frame);
250 if(!r_locator0.isValid() || !m_asForcePoint.check(r_locator0))
254 Record r_locator1 = m_asLocatedFrame.locator1(r_frame);
255 if(!r_locator1.isValid() || !m_asForcePoint.check(r_locator1))
259 Record r_locator2 = m_asLocatedFrame.locator2(r_frame);
260 if(!r_locator2.isValid() || !m_asForcePoint.check(r_locator2))
267 SpatialTransform t0_inv;
268 invert(t0_inv, m_asLocatedFrame.transform(r_frame));
271 transformVector(t0_inv, a_worldLocation, loc);
274 const SpatialVector &x0 = m_asForcePoint.location(r_locator0);
275 const SpatialVector &x1 = m_asForcePoint.location(r_locator1);
276 const SpatialVector &x2 = m_asForcePoint.location(r_locator2);
277 const SpatialVector &v0 = m_asForcePoint.velocity(r_locator0);
278 const SpatialVector &v1 = m_asForcePoint.velocity(r_locator1);
279 const SpatialVector &v2 = m_asForcePoint.velocity(r_locator2);
280 const SpatialVector &offset = m_asLocatedFrame.offset(r_frame);
281 makeFrame(t1, x0+v0*h, x1+v1*h, x2+v2*h, offset);
282 SpatialTransform t1_inv;
285 SpatialVector worldLocation1;
286 transformVector(t1, loc, worldLocation1);
288 velocity = (worldLocation1 - a_worldLocation) / h;
293 if(m_asChildFrame.check(r_frame))
295 Record r_parent = m_asChildFrame.parent(r_frame);
297 if(r_parent.isValid())
299 velocity = this->velocity(r_parent, a_worldLocation);
309 class FE_DL_EXPORT AsTire :
311 public Initialize<AsTire>
314 void initialize(
void)
316 add(frame, FE_USE(
"spc:frame"));
317 add(radius, FE_USE(
"bdy:radius"));
318 add(stiffness, FE_USE(
"mat:stiffness"));
319 add(damping, FE_USE(
"mat:damping"));
320 add(grip, FE_USE(
"mat:grip"));
323 Accessor<Record> frame;
325 Accessor<Real> radius;
327 Accessor<Real> stiffness;
329 Accessor<Real> damping;
334 class FE_DL_EXPORT AsNaiveTire :
336 public Initialize<AsNaiveTire>
339 void initialize(
void)
341 add(is, FE_USE(
"tire:naive"));
346 class FE_DL_EXPORT AsNaiveTireData :
348 public Initialize<AsNaiveTireData>
351 void initialize(
void)
353 add(inContact, FE_USE(
"naive_tire:inContact"));
354 add(component, FE_USE(
"component"));
355 add(thrust, FE_USE(
"naive_tire:thrust"));
356 add(sidethrust, FE_USE(
"naive_tire:sidethrust"));
357 add(contactRecord, FE_USE(
"naive_tire:contact"));
360 Accessor<bool> inContact;
362 Accessor< sp<Component> > component;
364 Accessor<Real> thrust;
366 Accessor<Real> sidethrust;
368 Accessor<Record> contactRecord;
374 class FE_DL_EXPORT AsPointCloud :
376 public Initialize<AsPointCloud>
379 void initialize(
void)
381 add(points, FE_USE(
"bdy:points"));
384 Accessor< sp<RecordGroup> > points;
390 class FE_DL_EXPORT AsRod :
392 public Initialize<AsRod>
395 void initialize(
void)
397 add(radius, FE_USE(
"bdy:radius"));
398 add(length, FE_USE(
"bdy:length"));
399 add(material, FE_USE(
"bdy:material"));
402 Accessor<Real> radius;
404 Accessor<Real> length;
406 Accessor<Record> material;
410 class FE_DL_EXPORT AsWheel :
412 public Initialize<AsWheel>
415 void initialize(
void)
417 add(radius, FE_USE(
"bdy:radius"));
418 add(width, FE_USE(
"bdy:width"));
421 Accessor<Real> radius;
423 Accessor<Real> width;
427 class FE_DL_EXPORT AsFrameConstraint :
429 public Initialize<AsFrameConstraint>
432 void initialize(
void)
434 add(frame, FE_USE(
"constraint:frame"));
435 add(point, FE_USE(
"constraint:point"));
438 Accessor<Record> frame;
440 Accessor<Record> point;
444 class FE_DL_EXPORT AsChild :
446 public Initialize<AsChild>
449 void initialize(
void)
451 add(parent, FE_USE(
"bdy:parent"));
452 add(local, FE_USE(
"spc:local"));
454 Accessor<Record> parent;
455 Accessor<SpatialTransform> local;
460 class FE_DL_EXPORT AsTube :
462 public Initialize<AsTube>
465 void initialize(
void)
467 add(radius, FE_USE(
"bdy:radius"));
468 add(thickness, FE_USE(
"bdy:thickness"));
469 add(length, FE_USE(
"bdy:length"));
470 add(material, FE_USE(
"bdy:material"));
473 Accessor<Real> radius;
475 Accessor<Real> thickness;
477 Accessor<Real> length;
479 Accessor<Record> material;
484 class FE_DL_EXPORT AsHinge :
486 public Initialize<AsHinge>
489 void initialize(
void)
491 add(anchor, FE_USE(
"jnt:anchor"));
492 add(axis, FE_USE(
"spc:direction"));
493 add(left, FE_USE(
"pair:left"));
494 add(right, FE_USE(
"pair:right"));
497 Accessor<Record> anchor;
499 Accessor<SpatialVector> axis;
501 Accessor<WeakRecord> left;
503 Accessor<WeakRecord> right;
506 class FE_DL_EXPORT AsMaterial :
508 public Initialize<AsMaterial>
511 void initialize(
void)
513 add(density, FE_USE(
"mat:density"));
516 Accessor<Real> density;
521 class FE_DL_EXPORT AsForcePair :
523 public Initialize<AsForcePair>
526 void initialize(
void)
528 add(a, FE_USE(
"pair:left"));
529 add(b, FE_USE(
"pair:right"));
534 class FE_DL_EXPORT AsPointThrust :
536 public Initialize<AsPointThrust>
539 void initialize(
void)
541 add(point, FE_USE(
"spc:point"));
542 add(force, FE_USE(
"sim:force"));
544 Accessor<Record> point;
545 Accessor<SpatialVector> force;
549 class FE_DL_EXPORT AsRadialFake :
551 public Initialize<AsRadialFake>
554 void initialize(
void)
556 add(r0, FE_USE(
"pair:left"));
557 add(r1, FE_USE(
"pair:right"));
558 add(r2, FE_USE(
"fake:r2"));
559 add(r3, FE_USE(
"fake:r3"));
560 add(anchor, FE_USE(
"fake:anchor"));
561 add(stiffness, FE_USE(
"mat:stiffness"));
565 Accessor<WeakRecord> r0;
567 Accessor<WeakRecord> r1;
569 Accessor<WeakRecord> r2;
571 Accessor<WeakRecord> r3;
573 Accessor<WeakRecord> anchor;
575 Accessor<Real> stiffness;
579 class FE_DL_EXPORT AsDifferential :
581 public Initialize<AsDifferential>
584 void initialize(
void)
586 add(shaft, FE_USE(
"diff:shaft"));
587 add(mount, FE_USE(
"diff:mount"));
588 add(left, FE_USE(
"pair:left"));
589 add(right, FE_USE(
"pair:right"));
590 add(flags, FE_USE(
"mat:flags"));
593 Accessor<WeakRecord> mount;
595 Accessor<WeakRecord> shaft;
597 Accessor<WeakRecord> left;
599 Accessor<WeakRecord> right;
604 #define FE_DIFF_LOCKED (int)(1 << 0) 605 #define FE_DIFF_OPEN (int)(1 << 1) 606 #define FE_DIFF_HLSD (int)(1 << 2) 607 #define FE_DIFF_VLSD (int)(1 << 3) 615 void initialize(
void)
617 add(left, FE_USE(
"pair:left"));
618 add(right, FE_USE(
"pair:right"));
619 add(length, FE_USE(
"bdy:length"));
620 add(stiffness, FE_USE(
"mat:stiffness"));
621 add(damping, FE_USE(
"mat:damping"));
635 #define FE_LSF_NOCOMPRESS (int)(1 << 0) 636 #define FE_LSF_XIGNORE (int)(1 << 1) 637 #define FE_LSF_YIGNORE (int)(1 << 2) 638 #define FE_LSF_ZIGNORE (int)(1 << 3) 639 #define FE_LSF_PULLCOMPRESS (int)(1 << 4) 640 #define FE_LSF_OFFSET_MODE (int)(1 << 5) 642 class FE_DL_EXPORT AsLinearSpringExtended :
647 void initialize(
void)
649 add(flags, FE_USE(
"mat:flags"));
655 class FE_DL_EXPORT AsLinearSpringForceReturn :
660 void initialize(
void)
662 add(spring, FE_USE(
"lsf:spring"));
669 class FE_DL_EXPORT AsLinearSpringDelta :
674 void initialize(
void)
676 add(a, FE_USE(
"quad:a"));
677 add(b, FE_USE(
"quad:b"));
678 add(c, FE_USE(
"quad:c"));
679 add(d, FE_USE(
"quad:d"));
680 add(stiffness, FE_USE(
"mat:stiffness"));
681 add(damping, FE_USE(
"mat:damping"));
682 add(is, FE_USE(
"is:linsprdelta"));
696 class FE_DL_EXPORT AsLinearSpringDeltaData :
701 void initialize(
void)
703 add(abSpring, FE_USE(
"pair:left"));
704 add(cdSpring, FE_USE(
"pair:right"));
716 void initialize(
void)
718 add(a, FE_USE(
"quad:a"));
719 add(b, FE_USE(
"quad:b"));
720 add(c, FE_USE(
"quad:c"));
721 add(d, FE_USE(
"quad:d"));
722 add(stiffness, FE_USE(
"mat:stiffness"));
723 add(damping, FE_USE(
"mat:damping"));
724 add(is, FE_USE(
"is:bend"));
741 class FE_DL_EXPORT AsLinearBend :
746 void initialize(
void)
748 add(length, FE_USE(
"bend:length"));
749 add(alpha, FE_USE(
"bend:alpha"));
750 add(lambda, FE_USE(
"bend:lambda"));
751 add(gamma, FE_USE(
"bend:gamma"));
753 add(bendJacobians, FE_USE(
"bdy:bendJacobians"));
771 class FE_DL_EXPORT AsFace :
776 void initialize(
void)
778 add(a, FE_USE(
"face:a"));
779 add(b, FE_USE(
"face:b"));
780 add(c, FE_USE(
"face:c"));
781 add(d, FE_USE(
"face:d"));
793 class FE_DL_EXPORT AsFacePressure :
798 void initialize(
void)
800 add(pressure, FE_USE(
"face:pressure"));
806 class FE_DL_EXPORT AsFaceStrain :
811 void initialize(
void)
813 add(angle, FE_USE(
"face:angle"));
814 add(stiffness, FE_USE(
"mat:uv_stiffness"));
815 add(damping, FE_USE(
"mat:uv_damping"));
816 add(poisson, FE_USE(
"mat:poisson"));
817 add(shear, FE_USE(
"mat:uv_shear_stiffness"));
832 class FE_DL_EXPORT AsStrand :
837 void initialize(
void)
839 add(a, FE_USE(
"strand:a"));
840 add(b, FE_USE(
"strand:b"));
841 add(c, FE_USE(
"strand:c"));
842 add(stiffness, FE_USE(
"mat:stiffness"));
843 add(damping, FE_USE(
"mat:damping"));
844 add(is, FE_USE(
"strand:bend"));
862 class FE_DL_EXPORT AsDotElement :
867 void initialize(
void)
869 add(a, FE_USE(
"strand:a"));
870 add(b, FE_USE(
"strand:b"));
871 add(c, FE_USE(
"strand:c"));
872 add(stiffness, FE_USE(
"mat:stiffness"));
873 add(damping, FE_USE(
"mat:damping"));
874 add(restdot, FE_USE(
"strand:restdot"));
891 class FE_DL_EXPORT AsLinearStrand :
896 void initialize(
void)
898 add(length, FE_USE(
"bend:length"));
899 add(alpha, FE_USE(
"bend:alpha"));
900 add(lambda, FE_USE(
"bend:lambda"));
901 add(gamma, FE_USE(
"bend:gamma"));
903 add(bendJacobians, FE_USE(
"bdy:bendJacobians"));
912 class FE_DL_EXPORT AsStrandTwist :
917 void initialize(
void)
919 add(a, FE_USE(
"strand:a"));
920 add(b, FE_USE(
"strand:b"));
921 add(c, FE_USE(
"strand:c"));
922 add(d, FE_USE(
"strand:d"));
923 add(stiffness, FE_USE(
"mat:rotStiffness"));
924 add(damping, FE_USE(
"mat:rotDamping"));
934 class FE_DL_EXPORT AsLinearStrandTwist:
935 public AsStrandTwist,
939 void initialize(
void)
941 add(length, FE_USE(
"bend:length"));
942 add(alpha, FE_USE(
"bend:alpha"));
943 add(lambda, FE_USE(
"bend:lambda"));
944 add(gamma, FE_USE(
"bend:gamma"));
946 add(jacobians, FE_USE(
"bdy:bendJacobians"));
955 class FE_DL_EXPORT AsElastic:
960 void initialize(
void)
962 add(stiffness, FE_USE(
"mat:stiffness"));
968 class FE_DL_EXPORT AsLiquidSand:
973 void initialize(
void)
975 add(hardRadius, FE_USE(
"liquid:hardRadius"));
976 add(attractRate, FE_USE(
"liquid:attractRate"));
982 class FE_DL_EXPORT AsHasChannel:
987 void initialize(
void)
989 add(name, FE_USE(
"channel:name"));
994 class FE_DL_EXPORT AsDrivenHinge:
999 void initialize(
void)
1001 add(angle, FE_USE(
"jnt:angle"));
1002 add(stiffness, FE_USE(
"mat:rotStiffness"));
1003 add(damping, FE_USE(
"mat:rotDamping"));
1010 class FE_DL_EXPORT ContactRV :
public RecordView 1013 ContactRV(
void) { setName(
"ContactRV"); }
1014 virtual void addFunctors(
void)
1016 add(frame, FE_USE(
"spc:frame"));
1017 add(location, FE_USE(
"spc:location"));
1018 add(velocity, FE_USE(
"spc:velocity"));
1019 add(normal, FE_USE(
"spc:normal"));
1020 add(depth, FE_USE(
"spc:depth"));
1021 add(stiffness, FE_USE(
"mat:stiffness"));
1022 add(damping, FE_USE(
"mat:damping"));
1023 add(group, FE_USE(
"group"));
1024 add(
transient, FE_USE(
"generic:mark"));
1026 Functor<Record> frame;
1027 Functor<SpatialVector> location;
1028 Functor<SpatialVector> velocity;
1029 Functor<SpatialVector> normal;
1030 Functor<Real> depth;
1031 Functor<Real> stiffness;
1032 Functor<Real> damping;
1033 Functor< sp<RecordGroup> > group;
1034 Functor<bool>
transient;
1038 class FE_DL_EXPORT AsRelocate :
1043 void initialize(
void)
1045 add(group, FE_USE(
"group"));
1050 class FE_DL_EXPORT AsReferenceFrame :
1055 void initialize(
void)
1057 add(is, FE_USE(
"sim:refframe"));
1062 class FE_DL_EXPORT AsSmoothedParticle :
1067 void initialize(
void)
1069 add(density, FE_USE(
"sim:density"));
1070 add(heat, FE_USE(
"sim:heat"));
1071 add(heatAccumulator,FE_USE(
"sim:heat_accum"));
1079 class FE_DL_EXPORT AsActuator :
1084 void initialize(
void)
1086 add(transform, FE_USE(
"liquid:transform"));
1087 add(velocity, FE_USE(
"liquid:velocity"));
1088 add(spin, FE_USE(
"liquid:spin"));
1089 add(radius, FE_USE(
"liquid:radius"));
1090 add(mode, FE_USE(
"liquid:mode"));
Accessor< WeakRecord > c
connected tip point – CD is axis
Definition: mechanicsAS.h:731
Set of accessors.
Definition: AccessorSet.h:18
Accessor< Real > stiffness
stiffness
Definition: mechanicsAS.h:630
Basic Hooke's law linear spring.
Definition: mechanicsAS.h:610
kernel
Definition: namespace.dox:3
Matrix< 4, 4, T > & invert(Matrix< 4, 4, T > &a_inverted, const Matrix< 4, 4, T > &a_matrix)
4x4 full matrix inversion
Definition: Matrix.h:1033
Accessor< WeakRecord > left
connected point
Definition: mechanicsAS.h:624
Accessor< Real > damping
damping
Definition: mechanicsAS.h:632
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Accessor< WeakRecord > right
connected point
Definition: mechanicsAS.h:626
Accessor< Real > length
rest length
Definition: mechanicsAS.h:628
particle in physical space
Definition: shapeAS.h:58
Accessor< WeakRecord > b
connected tip point – B is opposite across axis from A
Definition: mechanicsAS.h:729
Accessor< WeakRecord > a
connected tip point – A is opposite across axis from B
Definition: mechanicsAS.h:727
possible bounding area/volume attributes
Definition: shapeAS.h:148
Bindable collection of accessor Functors.
Definition: RecordView.h:106
For bending element based on Volino 2006 bending model.
Definition: mechanicsAS.h:711
Accessor< WeakRecord > d
connected tip point – CD is axis
Definition: mechanicsAS.h:733
Accessor< Real > damping
damping
Definition: mechanicsAS.h:737
Accessor< Real > stiffness
stiffness
Definition: mechanicsAS.h:735