// sofcla.h
//
// define some of the classes used in sofea.cpp

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
#include <math.h>

int EndOfFile=0;

//#define PI 3.14159265359

//-----------NODE--------------------------------------------------------
class Node
{
public:			// Caution No private because couldn't use some other function!!
				// So to change
	long number;
	double nx[6];			// Node coordinates x,y,z and rotations rx,ry,rz (for inclined support etc)
	double u[6];				// Node displacements and rotations
	long DOF;					// Number of DOF for this node
	int ActiveDOF[6];			// Active DOF in x,y,z,rotx,roty,rotz 0:inactive, 1:active
	int FixedDOF[6];			// Fixed DOF in x,y,z,rotx,roty,rotz 0:inactive, 1:active
	double DispBC[6];			// Value of Disp Boundary Condition in x,y,z,rotx,roty,rotz
	double ForceBC[6];			// Value of Force/Moment Boundary Condition in x,y,z,rotx,roty,rotz
	long CumSum;				// "Address" in the vectors.
	void Node::Init(void);
};

void Node::Init(void)		// function to initialize data during the file reading
{
	int i;
	DOF = 0;
	CumSum=0;
	for(i=0;i<6;i++) { 
		nx[i]=0.0;
		u[i]=0.0;
		ActiveDOF[i]=0; 
		FixedDOF[i]=0; 
		DispBC[i]=0.0;
		ForceBC[i]=0.0;
		}
}

//----------MATERIAL----------------------------------------------------------
class Material
{
public:
	long number;
	double Ex;		// Material properties...
	double Nuxy;
	double Alphax;
	double Density;
	Material(long num);
};

Material::Material(long num)
{
	number = num;
	Ex = 0;
	Nuxy = 0;
	Density=0;
}

//----------Cross Section Property------------------------------------------

class CrossSection
{
public:
	long number;
	double Area;
	double Ixx, Iyy, Izz;
	double Height;
	double Thickness;
	CrossSection(long num);
};

CrossSection::CrossSection(long num)
{
	number = num;
	Area = 0;
	Izz = 0;
	Height = 0;
	Thickness = 0;
}

//----- Gauss Integration Points 2x2 ---------

class Gauss22
{
public:
	double Rg[4];
	double Sg[4];
	Gauss22(void);
};

Gauss22::Gauss22(void)
{
	double g;
	g=1.0/sqrt(3);
	
	Rg[0]=-g;
	Rg[1]=g;
	Rg[2]=g;
	Rg[3]=-g;

	Sg[0]=-g;
	Sg[1]=-g;
	Sg[2]=g;
	Sg[3]=g;
}
