Commit 7b099e2a authored by François Trigaux's avatar François Trigaux
Browse files

replaced beam_ by gebt_

parent e99ec271
......@@ -29,18 +29,18 @@ int main(int argc, char* argv[])
{
loads[i] = atof(argv[1]);
}
beam_setLoads(bm,loads,2);
gebt_setLoads(bm,loads,2);
printf("...Done!\n");
// Performing the analysis
printf("Performing the analysis...\n");
beam_analysis(bm);
gebt_analysis(bm);
printf("...Done!\n");
printf("Outputting the results...\n");
beam_writeSolToFile(bm);
gebt_writeSolToFile(bm);
printf("... Done!\n");
return EXIT_SUCCESS;
......
......@@ -26,7 +26,7 @@ int main(int argc, char* argv[])
// Creating an array with the uniform load for each member
printf("Creating the loads...\n");
load = atof(argv[1]);
beam_setEndLoad(bm,load,4); // 4 -> My
gebt_setEndLoad(bm,load,4); // 4 -> My
printf("...Done!\n");
char fname[32] = "output";
......@@ -34,8 +34,8 @@ int main(int argc, char* argv[])
// Performing the analysis
printf("Performing the analysis...\n");
beam_analysis(bm);
beam_writeSolToFile(bm,fname);
gebt_analysis(bm);
gebt_writeSolToFile(bm,fname);
printf("... Ok! \n");
......
......@@ -30,7 +30,7 @@ int main(int argc, char* argv[])
loads[i] = atof(argv[1])*0.0;
}
loads[bm->nmemb-1] = atof(argv[1]);
beam_setLoads(bm,loads,2);
gebt_setLoads(bm,loads,2);
free(loads);
printf("...Done!\n");
......@@ -43,8 +43,8 @@ int main(int argc, char* argv[])
{
sprintf(fname,"output%d_",i);
printf("Global Step = %d...\n",i);
beam_analysis(bm);
beam_writeSolToFile(bm,fname);
gebt_analysis(bm);
gebt_writeSolToFile(bm,fname);
printf("... Ok! \n");
}
......
......@@ -2,7 +2,7 @@
analysis_flag = 2
nkp = 25
niter = 1
nstep = 100
nstep = 10
ncond_pt = 2
initFromFile = 0
L=61.5
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
initBeam(bm);
printf("...Done!\n");
beam_setTwistFromFile(bm,"Twist.dat");
gebt_setTwistFromFile(bm,"Twist.dat");
// Creating an array with the uniform load for each member
printf("Creating the loads...\n");
......@@ -26,12 +26,12 @@ int main(int argc, char* argv[])
{
loads[i] = 5e3;
}
beam_setLoads(bm,loads,1); // 1 -> Fy (flapwise)
gebt_setLoads(bm,loads,1); // 1 -> Fy (flapwise)
for(i=0;i<bm->nmemb;i++)
{
loads[i] = 10e3;
}
beam_setLoads(bm,loads,2); // 2 -> Fz (edgewise)
gebt_setLoads(bm,loads,2); // 2 -> Fz (edgewise)
printf("...Done!\n");
char fname[32] = "output";
......@@ -39,24 +39,25 @@ int main(int argc, char* argv[])
clock_t start;
printf("Performing the analysis...\n");
for (i=0;i<100;i++)
int ntot= 100;
for (i=0;i<ntot;i++)
{
sprintf(fname,"output_%d_",i);
printf("Global Step = %d...\n",i);
start = clock();
beam_analysis(bm);
gebt_analysis(bm);
meanTime += ((double) (clock() - start))/CLOCKS_PER_SEC;
beam_writeSolToFile(bm,fname);
gebt_writeSolToFile(bm,fname);
printf("... Ok! \n");
}
beam_writeBeamToFile(bm,"beamFile.out");
gebt_writeBeamToFile(bm,"beamFile.out");
free(loads);
freeBeam(bm);
free(bm);
printf("Mean time: %e",meanTime/10.0);
printf("Mean time: %e",meanTime/((double)ntot));
return EXIT_SUCCESS;
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ for f in ["output"]:
u3[f] = []
phi1[f] = []
for k in range(100):
for j in range(100):
for j in range(10):
print("%s_%d_%03d.dat"%(f,k,j))
data_pts = np.loadtxt("%s_%d_%03d.dat"%(f,k,j),max_rows=nkp);
data_mem = np.loadtxt("%s_%d_%03d.dat"%(f,k,j),skiprows=nkp);
......
......@@ -24,7 +24,7 @@ int main(int argc, char* argv[])
initBeam(bm);
printf("...Done!\n");
beam_setTwistFromFile(bm,"Twist.dat");
gebt_setTwistFromFile(bm,"Twist.dat");
// Creating an array with the uniform load for each member
printf("Creating the loads...\n");
......@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
{
loads[i] = atof(argv[1]);
}
beam_setLoads(bm,loads,2);
gebt_setLoads(bm,loads,2);
printf("...Done!\n");
char fname[32] = "output";
......@@ -41,8 +41,8 @@ int main(int argc, char* argv[])
// Performing the analysis
printf("Performing the analysis...\n");
beam_analysis(bm);
beam_writeSolToFile(bm,fname);
gebt_analysis(bm);
gebt_writeSolToFile(bm,fname);
printf("... Ok! \n");
freeBeam(bm);
......
......@@ -29,14 +29,14 @@ int main(int argc, char* argv[])
{
twist[i] = 90.0 * M_PI/180.0 * i / ((double) (bm->nkp - 1.0));
}
beam_setTwist(bm,twist);
gebt_setTwist(bm,twist);
free(twist);*/
beam_setTwistFromFile(bm,"Twist.dat");
gebt_setTwistFromFile(bm,"Twist.dat");
// Creating an array with the uniform load for each member
printf("Creating the loads...\n");
load = atof(argv[1]);
beam_setEndLoad(bm,load,2); // 2 -> Fz
gebt_setEndLoad(bm,load,2); // 2 -> Fz
printf("...Done!\n");
char fname[32] = "output";
......@@ -44,8 +44,8 @@ int main(int argc, char* argv[])
// Performing the analysis
printf("Performing the analysis...\n");
beam_analysis(bm);
beam_writeSolToFile(bm,fname);
gebt_analysis(bm);
gebt_writeSolToFile(bm,fname);
printf("... Ok! \n");
......
......@@ -129,7 +129,7 @@ void initBeam(Beam *bm)
}
// Initialize the materials
beam_setMaterial(bm);
gebt_setMaterial(bm);
......@@ -504,7 +504,7 @@ void initBeamFromGebtFile(Beam *bm)
// Assign the twist to each of the member by changing its frame
// twist_per_L [rad/arc length] is only required if there are subdivisions to the members
void beam_setTwist(Beam *bm, double *twist)
void gebt_setTwist(Beam *bm, double *twist)
{
int i;
double k1;
......@@ -530,7 +530,7 @@ void beam_setTwist(Beam *bm, double *twist)
// Assign the twist to each of the member by changing its frame
// twist_per_L [rad/arc length] is only required if there are subdivisions to the members
void beam_setTwistFromFile(Beam *bm, char *fname)
void gebt_setTwistFromFile(Beam *bm, char *fname)
{
int i,j,k;
int idx,np;
......@@ -591,7 +591,7 @@ void beam_setTwistFromFile(Beam *bm, char *fname)
twist[k] *= M_PI/180.0; // convert to radian
}
beam_setTwist(bm,twist); // NOTE: 0.0 is hardcoded
gebt_setTwist(bm,twist); // NOTE: 0.0 is hardcoded
DEALLOCATE1(twist);
DEALLOCATE1(twistp);
......@@ -602,7 +602,7 @@ void beam_setTwistFromFile(Beam *bm, char *fname)
fclose(fid);
}
void beam_getNodeVelocities(double **vel, Beam *bm){
void gebt_getNodeVelocities(double **vel, Beam *bm){
int i,j;
int step = bm->nstep-1;
......@@ -616,7 +616,7 @@ void beam_getNodeVelocities(double **vel, Beam *bm){
}
}
void beam_getMemberVelocities(double **vel, Beam *bm){
void gebt_getMemberVelocities(double **vel, Beam *bm){
int i,j;
int step = bm->nstep-1;
......@@ -633,7 +633,7 @@ void beam_getMemberVelocities(double **vel, Beam *bm){
/* disp = allocated double pointer of size (6,nkp)
/!\ the order of is reversed!
*/
void beam_getNodeDisplacement(double **disp, Beam *bm){
void gebt_getNodeDisplacement(double **disp, Beam *bm){
int i,j;
int step = bm->nstep-1;
......@@ -650,7 +650,7 @@ void beam_getNodeDisplacement(double **disp, Beam *bm){
/* disp = allocated double pointer of size (6,nelem)
/!\ the order of is reversed!
*/
void beam_getNodeDisplacement(double **disp, Beam *bm){
void gebt_getMemberDisplacement(double **disp, Beam *bm){
int i,j;
int step = bm->nstep-1;
......@@ -664,7 +664,7 @@ void beam_getNodeDisplacement(double **disp, Beam *bm){
}
}
void beam_writeSolToFile(Beam *bm,char* fileName)
void gebt_writeSolToFile(Beam *bm,char* fileName)
{
int i,j,k;
char fname[32];
......@@ -703,7 +703,7 @@ void beam_writeSolToFile(Beam *bm,char* fileName)
void beam_setLoads(Beam *bm, double *loads, int load_no)
void gebt_setLoads(Beam *bm, double *loads, int load_no)
{
int i;
for(i=0;i<bm->ncond_mb;i++)
......@@ -719,7 +719,7 @@ void beam_setLoads(Beam *bm, double *loads, int load_no)
}
}
void beam_setEndLoad(Beam *bm, double loads, int load_no)
void gebt_setEndLoad(Beam *bm, double loads, int load_no)
{
int i;
for(i=0;i<bm->ncond_mb;i++)
......@@ -736,7 +736,7 @@ void beam_setEndLoad(Beam *bm, double loads, int load_no)
}
void beam_analysis(Beam *bm)
void gebt_analysis(Beam *bm)
{
int i;
......@@ -806,7 +806,7 @@ void beam_analysis(Beam *bm)
/*
This updates the initial condition, but when the analysis does its initial step, it does not work
void beam_updateInitialConditions(Beam *bm)
void gebt_updateInitialConditions(Beam *bm)
{
int i,j;
for (i=0;i<bm->nelem;i++)
......@@ -842,7 +842,7 @@ void beam_updateInitialConditions(Beam *bm)
fprintf(fid,#type " ",ptr[i_][j_]);\
fprintf(fid,"\n");}
void beam_writeBeamToFile(Beam *bm,char *fname)
void gebt_writeBeamToFile(Beam *bm,char *fname)
{
int i,j,k;
FILE *fid = fopen(fname,"w");
......@@ -903,7 +903,7 @@ void freeBeam(Beam *bm)
// Library utils
static void beam_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart)
static void gebt_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart)
{
int i,j;
int idx = 0;
......@@ -954,7 +954,7 @@ static void beam_interpolateMatrix(double **out, double x, double *xp, double **
static void beam_setMaterial(Beam *bm)
static void gebt_setMaterial(Beam *bm)
{
int i,j,k;
int ncomp, nmass;
......@@ -1018,10 +1018,10 @@ static void beam_setMaterial(Beam *bm)
x = sqrt(bm->coord[i][0]*bm->coord[i][0] + bm->coord[i][1]*bm->coord[i][1] + bm->coord[i][2]*bm->coord[i][2]) / bm->L;
// Interpolate the material at the correct point position
beam_interpolateMatrix(bm->material[i],x,xcomp,matComp,ncomp,NSTRN,NSTRN,0 ,0);
gebt_interpolateMatrix(bm->material[i],x,xcomp,matComp,ncomp,NSTRN,NSTRN,0 ,0);
if (bm->analysis_flag!=0)
{
beam_interpolateMatrix(bm->material[i],x,xmass,matMass,nmass,NSTRN,NSTRN,NSTRN,0);
gebt_interpolateMatrix(bm->material[i],x,xmass,matMass,nmass,NSTRN,NSTRN,NSTRN,0);
}
}
......
......@@ -152,30 +152,30 @@ typedef struct
void initBeam(Beam *bm);
void beam_setTwist(Beam *bm, double *twist);
void beam_setTwistFromFile(Beam *bm, char *fname);
void gebt_setTwist(Beam *bm, double *twist);
void gebt_setTwistFromFile(Beam *bm, char *fname);
void beam_setLoads(Beam *bm, double *loads, int load_no);
void beam_setEndLoad(Beam *bm, double loads, int load_no);
void gebt_setLoads(Beam *bm, double *loads, int load_no);
void gebt_setEndLoad(Beam *bm, double loads, int load_no);
void beam_analysis(Beam *bm);
void gebt_analysis(Beam *bm);
void beam_getNodeVelocities(double **vel, Beam *bm);
void beam_getMemberVelocities(double **vel, Beam *bm);
void gebt_getNodeVelocities(double **vel, Beam *bm);
void gebt_getMemberVelocities(double **vel, Beam *bm);
void beam_getNodeDisplacement(double **disp, Beam *bm);
void beam_getMemberDisplacement(double **disp, Beam *bm);
void gebt_getNodeDisplacement(double **disp, Beam *bm);
void gebt_getMemberDisplacement(double **disp, Beam *bm);
void beam_writeBeamToFile(Beam *bm,char *fname);
void beam_writeSolToFile(Beam *bm, char *fileName);
void gebt_writeBeamToFile(Beam *bm,char *fname);
void gebt_writeSolToFile(Beam *bm, char *fileName);
void freeBeam(Beam *bm);
// Private functions
static void beam_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart);
static void gebt_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart);
static void beam_setMaterial(Beam *bm);
static void gebt_setMaterial(Beam *bm);
void fortran_analysis(int nkp,int nelem,int ndof_el,int nmemb,int ncond_pt,int nmate,int nframe,int ndistrfun,int ncurv, double **coord,
int **member,struct PrescriInf **pt_condition, double **material, int niter, int nstep, double **sol_pt, double **sol_mb,char *error, int ncond_mb,
......
......@@ -128,7 +128,7 @@ void initBeam(Beam *bm)
}
// Initialize the materials
beam_setMaterial(bm);
gebt_setMaterial(bm);
......@@ -507,7 +507,7 @@ void initBeamFromGebtFile(Beam *bm)
// Assign the twist to each of the member by changing its frame
// twist_per_L [rad/arc length] is only required if there are subdivisions to the members
void beam_setTwist(Beam *bm, double *twist)
void gebt_setTwist(Beam *bm, double *twist)
{
int i;
double k1;
......@@ -535,7 +535,7 @@ void beam_setTwist(Beam *bm, double *twist)
// Assign the twist to each of the member by changing its frame
// twist_per_L [rad/arc length] is only required if there are subdivisions to the members
void beam_setTwistFromFile(Beam *bm, char *fname)
void gebt_setTwistFromFile(Beam *bm, char *fname)
{
int i,j,k;
int idx,np;
......@@ -596,7 +596,7 @@ void beam_setTwistFromFile(Beam *bm, char *fname)
twist[k] *= M_PI/180.0; // convert to radian
}
beam_setTwist(bm,twist); // NOTE: 0.0 is hardcoded
gebt_setTwist(bm,twist); // NOTE: 0.0 is hardcoded
DEALLOCATE1(twist);
DEALLOCATE1(twistp);
......@@ -607,7 +607,7 @@ void beam_setTwistFromFile(Beam *bm, char *fname)
}
void beam_writeSolToFile(Beam *bm,char* fileName)
void gebt_writeSolToFile(Beam *bm,char* fileName)
{
int i,j,k;
char fname[32];
......@@ -646,7 +646,7 @@ void beam_writeSolToFile(Beam *bm,char* fileName)
void beam_setLoads(Beam *bm, double *loads, int load_no)
void gebt_setLoads(Beam *bm, double *loads, int load_no)
{
int i;
for(i=0;i<bm->ncond_mb;i++)
......@@ -662,7 +662,7 @@ void beam_setLoads(Beam *bm, double *loads, int load_no)
}
}
void beam_setEndLoad(Beam *bm, double loads, int load_no)
void gebt_setEndLoad(Beam *bm, double loads, int load_no)
{
int i;
for(i=0;i<bm->ncond_mb;i++)
......@@ -679,7 +679,7 @@ void beam_setEndLoad(Beam *bm, double loads, int load_no)
}
void beam_analysis(Beam *bm)
void gebt_analysis(Beam *bm)
{
int i;
......@@ -750,7 +750,7 @@ void beam_analysis(Beam *bm)
/*
This updates the initial condition, but when the analysis does its initial step, it does not work
void beam_updateInitialConditions(Beam *bm)
void gebt_updateInitialConditions(Beam *bm)
{
int i,j;
for (i=0;i<bm->nelem;i++)
......@@ -786,7 +786,7 @@ void beam_updateInitialConditions(Beam *bm)
fprintf(fid,#type " ",ptr[i_][j_]);\
fprintf(fid,"\n");}
void beam_writeBeamToFile(Beam *bm,char *fname)
void gebt_writeBeamToFile(Beam *bm,char *fname)
{
int i,j,k;
FILE *fid = fopen(fname,"w");
......@@ -841,7 +841,7 @@ void freeBeam(Beam *bm)
// Library utils
static void beam_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart)
static void gebt_interpolateMatrix(double **out, double x, double *xp, double ***matrix, int np, int nx, int ny, int ixStart, int iyStart)
{
int i,j;
int idx = 0;
......@@ -890,7 +890,7 @@ static void beam_interpolateMatrix(double **out, double x, double *xp, double **
static void beam_setMaterial(Beam *bm)
static void gebt_setMaterial(Beam *bm)
{
int i,j,k;
int ncomp, nmass;
......@@ -954,10 +954,10 @@ static void beam_setMaterial(Beam *bm)
x = sqrt(bm->coord[i][0]*bm->coord[i][0] + bm->coord[i][1]*bm->coord[i][1] + bm->coord[i][2]*bm->coord[i][2]) / bm->L;
// Interpolate the material at the correct point position
beam_interpolateMatrix(bm->material[i],x,xcomp,matComp,ncomp,NSTRN,NSTRN,0 ,0);
gebt_interpolateMatrix(bm->material[i],x,xcomp,matComp,ncomp,NSTRN,NSTRN,0 ,0);
if (bm->analysis_flag!=0)
{
beam_interpolateMatrix(bm->material[i],x,xmass,matMass,nmass,NSTRN,NSTRN,NSTRN,0);
gebt_interpolateMatrix(bm->material[i],x,xmass,matMass,nmass,NSTRN,NSTRN,NSTRN,0);
}
}
......@@ -976,7 +976,7 @@ static void beam_setMaterial(Beam *bm)
static void beam_setMaterial(Beam *bm)
static void gebt_setMaterial(Beam *bm)
{
int i,j,k;
char* line = NULL;
......
......@@ -19,20 +19,20 @@ int main(int argc, char* argv[])
{
loads[i] = 1.0;
}
beam_setLoads(bm,loads,2);
gebt_setLoads(bm,loads,2);
printf("...Done!\n");
printf("Performing the analysis...\n");
beam_analysis(bm);
gebt_analysis(bm);
printf("...Done!\n");
printf("Outputting the results...\n");
beam_writeSolToFile(bm);
gebt_writeSolToFile(bm);
printf("... Done!\n");
return EXIT_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment