Ejemplo n.º 1
0
//example problem 1
Structure* problem1() {
	Structure* s = new Structure();

	Joint* jointA = new Joint("A", true, s);
	Joint* jointB = new Joint("B", false, s);
	Joint* jointC = new Joint("C", false, s);
	End* end1 = new End(jointA, 0.0, 0.5, -172.8);
	End* end2 = new End(jointB, 0.5, 0.5, 115.2);
	End* end3 = new End(jointB, 0.5, 0.5, -416.7);
	End* end4 = new End(jointC, 1, 0.5, 416.7);

	s->add_joint(jointA);
	s->add_joint(jointB);
	s->add_joint(jointC);

	s->make_member(end1, end2);
	s->make_member(end3, end4);

	return s;
}
Ejemplo n.º 2
0
//example problem 2
Structure* problem2() {
	Structure* s = new Structure();

	Joint* jointA = new Joint("A", false, s);
	Joint* jointB = new Joint("B", false, s);
	Joint* jointC = new Joint("C", false, s);
	Joint* jointD = new Joint("D", false, s);
	Joint* jointE = new Joint("E", true, s);
	Joint* jointF = new Joint("F", true, s);

	End* end1 = new End(jointA, 1, 0.5, 0);
	End* end2 = new End(jointB, 1.0 / 3.5, 0.5, 0);
	End* end3 = new End(jointB, 1.0 / 3.5, 0.5, -44.4);
	End* end4 = new End(jointC, 1.0 / 3.5, 0.5, 22.2);
	End* end5 = new End(jointC, 1.0 / 3.5, 0.5, -90);
	End* end6 = new End(jointD, 1, 0.5, 90);
	End* end7 = new End(jointB, 1.5 /3.5, 0.5, -25);
	End* end8 = new End(jointE, 1, 0.5, 25);
	End* end9 = new End(jointC, 1.5 / 3.5, 0.5, 0);
	End* end10 = new End(jointF, 1, 0.5, 0);

	s->add_joint(jointA);
	s->add_joint(jointB);
	s->add_joint(jointC);
	s->add_joint(jointD);
	s->add_joint(jointE);
	s->add_joint(jointF);

	s->make_member(end1, end2);
	s->make_member(end3, end4);
	s->make_member(end5, end6);
	s->make_member(end7, end8);
	s->make_member(end9, end10);

	return s;
}