Example 1 By C++

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
ArdalanNejat
Posts: 19
Joined: Sat Aug 03, 2013 3:56 am
Location: Shiraz University
Contact:

Example 1 By C++

Post by ArdalanNejat » Mon Sep 30, 2013 11:40 pm

Dear All,
I've been trying to solve example 1 by C++, first the console app. said that there is no node 5 in domain so I change SP_CONSTRAINT arguments to these
SP_Constraint *sp1 = new SP_Constraint(1, 0, 0.0);
SP_Constraint *sp2 = new SP_Constraint(1, 1, 0.0);
SP_Constraint *sp3 = new SP_Constraint(2, 0, 0.0);
SP_Constraint *sp4 = new SP_Constraint(2, 1, 0.0);
SP_Constraint *sp5 = new SP_Constraint(3, 0, 0.0);
SP_Constraint *sp6 = new SP_Constraint(3, 1, 0.0);
after this change the program ran successfully but the answers are wrong and they are completely different from opensees.exe(ran by Tcl) please help me for this thank you so much.
the wrong answers:


/***************************************************/
Current Domain Information
Current Time: 1
tCommitted Time: 1

NODE DATA: NumNodes: 4

Node: 1
Coordinates : 0 0
Disps: 0 0
Velocities : 0 0
unbalanced Load: 0 0
ID : 6 7


Node: 2
Coordinates : 144 0
Disps: 0 0
Velocities : 0 0
unbalanced Load: 0 0
ID : 2 3


Node: 3
Coordinates : 168 0
Disps: 0 0
Velocities : 0 0
unbalanced Load: 0 0
ID : 0 1


Node: 4
Coordinates : 72 96
Disps: 100 -50
Velocities : 0 0
unbalanced Load: 100 -50
ID : 4 5


ELEMENT DATA: NumEle: 3
Element: 1 type: Truss iNode: 1 jNode: 4 Area: 10 Mass/Length: 0
strain: 0.166667 axial load: 5000
unbalanced load: -3000 -4000 3000 4000
Material: Elastic tag: 1
Epos: 3000 Eneg: 3000 eta: 0

Element: 2 type: Truss iNode: 2 jNode: 4 Area: 5 Mass/Length: 0
strain: -0.833333 axial load: -12500
unbalanced load: -7500 10000 7500 -10000
Material: Elastic tag: 1
Epos: 3000 Eneg: 3000 eta: 0

Element: 3 type: Truss iNode: 3 jNode: 4 Area: 5 Mass/Length: 0
strain: -0.78125 axial load: -11718.8
unbalanced load: -8286.41 8286.41 8286.41 -8286.41
Material: Elastic tag: 1
Epos: 3000 Eneg: 3000 eta: 0


SP_Constraints: numConstraints: 6
SP_Constraint: 0 Node: 1 DOF: 0 ref value: 0 current value: 0
SP_Constraint: 1 Node: 1 DOF: 1 ref value: 0 current value: 0
SP_Constraint: 2 Node: 2 DOF: 0 ref value: 0 current value: 0
SP_Constraint: 3 Node: 2 DOF: 1 ref value: 0 current value: 0
SP_Constraint: 4 Node: 3 DOF: 0 ref value: 0 current value: 0
SP_Constraint: 5 Node: 3 DOF: 1 ref value: 0 current value: 0

Pressure_Constraints: numConstraints: 0

MP_Constraints: numConstraints: 0

LOAD PATTERNS: numPatterns: 1

Load Pattern: 1
Scale Factor: 1
Linear Series: constant factor: 1
Nodal Loads:
Nodal Load: 4 load : 100 -50

Elemental Loads:

Single Point Constraints:

PARAMETERS: numParameters: 0

Post Reply