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

🛁 code clean up (removed commented functions)

parent d297b88d
......@@ -955,32 +955,9 @@ static void beam_setMaterial(Beam *bm)
// Interpolate the material at the correct point position
beam_interpolateMatrix(bm->material[i],x,xcomp,matComp,ncomp,NSTRN,NSTRN,0 ,0);
//for (j=0;j<NSTRN;j++){
// for(k=0;k<NSTRN;k++)
// {
// bm->material[i][j][k] = matComp[0][j][k];
// }
// }
if (bm->analysis_flag!=0)
{
beam_interpolateMatrix(bm->material[i],x,xmass,matMass,nmass,NSTRN,NSTRN,NSTRN,0);
// Copy mass matrix
// for (j=NSTRN;j<NSTRN+NSTRN;j++){
// for(k=0;k<NSTRN;k++)
// {
// bm->material[i][j][k] = matMass[0][j-NSTRN][k];
// }
// }
}
//for(j=0;j<bm->ndof_el-NSTRN;j++)
//{
// for(k=0;k<NSTRN;k++)
// {
// printf("%e ",bm->material[i][j][k]);
// }
// printf("\n");
//}
//printf("\n");
}
......@@ -996,129 +973,4 @@ static void beam_setMaterial(Beam *bm)
fclose(COMP);
fclose(MASS);
}
/*
static void beam_setMaterial(Beam *bm)
{
int i,j,k;
char* line = NULL; //don't forget to free
ssize_t read;
int frmt;
size_t len = 0;
int ncomp, nmass;
double x;
FILE *MASS, *COMP;
double ***matComp, ***matMass;
double *xcomp, *xmass;
// TODO - This need to be reworked to interpolate the mass matrices at the nkp positions
COMP = fopen("Compliance.dat","r");
if (COMP==NULL)
{printf("Unable to read compliance matrix file\n"); exit(EXIT_FAILURE);}
MASS = fopen("Mass.dat","r");
if ((MASS==NULL) && (bm->analysis_flag==2))
{printf("Unable to read mass matrix file for dynamic analysis\n"); exit(EXIT_FAILURE);}
// Read all the compliance matrices
// READ1(COMP,ncomp,%d);
// ALLOCATE3(matComp,double,2,2,2);
// ALLOCATE1(xcomp,double,1);
//for (i=0;i<ncomp;i++)
//{
// READ1(COMP,xcomp[i],%lf);
// for (j=0; j<NSTRN; j++)
// {
// READL(line,len,COMP);
// frmt = sscanf(line,"%lf %lf %lf %lf %lf %lf",&matComp[i][j][0],&matComp[i][j][1],&matComp[i][j][2],&matComp[i][j][3],&matComp[i][j][4],&matComp[i][j][5]); CHKFRMT(frmt,6);
// }
//}
// Read all the mass matrices
//if ((bm->analysis_flag!=0))
//{
// READ1(MASS,nmass,%d);
// ALLOCATE3(matMass,double,2,2,2);
// ALLOCATE1(xmass,double,1);
// for (i=0;i<nmass;i++)
// {
// READ1(MASS,xmass[i],%lf);
// for (j=0; j<NSTRN; j++)
// {
// READL(line,len,MASS);
// frmt = sscanf(line,"%lf %lf %lf %lf %lf %lf",&matMass[i][j][0],&matMass[i][j][1],&matMass[i][j][2],&matMass[i][j][3],&matMass[i][j][4],&matMass[i][j][5]); CHKFRMT(frmt,6);
// }
// }
//}
//fclose(COMP);
//fclose(MASS);
COMP = fopen("Compliance.dat","r");
if (COMP==NULL)
{printf("Unable to read compliance matrix file\n"); exit(EXIT_FAILURE);}
MASS = fopen("Mass.dat","r");
if ((MASS==NULL) && (bm->analysis_flag==2))
{printf("Unable to read mass matrix file for dynamic analysis\n"); exit(EXIT_FAILURE);}
READ1(COMP,ncomp,%d);
READ1(COMP,x,%lf);
READ1(MASS,nmass,%d);
READ1(MASS,x,%lf);
for (i=0;i<bm->nmate;i++)
{
if (i==0)
{
for (j=0; j<NSTRN; j++)
{
READL(line,len,COMP);
frmt = sscanf(line,"%lf %lf %lf %lf %lf %lf",&bm->material[i][j][0],&bm->material[i][j][1],&bm->material[i][j][2],&bm->material[i][j][3],&bm->material[i][j][4],&bm->material[i][j][5]); CHKFRMT(frmt,6);
}
if(bm->analysis_flag!=0){
for (j=NSTRN;j<NSTRN+NSTRN;j++){
READL(line,len,MASS);
frmt = sscanf(line,"%lf %lf %lf %lf %lf %lf",&bm->material[i][j][0],&bm->material[i][j][1],&bm->material[i][j][2],&bm->material[i][j][3],&bm->material[i][j][4],&bm->material[i][j][5]); CHKFRMT(frmt,6);
}
}
}
else
{
// COPY compliance matrix
for (j=0;j<NSTRN;j++)
{
for(k=0;k<NSTRN;k++)
{
bm->material[i][j][k] = bm->material[0][j][k];
}
}
// Copy mass matrix
if(bm->analysis_flag!=0){
for (j=NSTRN;j<NSTRN+NSTRN;j++){
for(k=0;k<NSTRN;k++)
{
bm->material[i][j][k] = bm->material[0][j][k];
}
}
}
}
}
//DEALLOCATE1(xcomp);
//DEALLOCATE3(matComp,1,1);
//if (bm->analysis_flag!=0)
//{
// DEALLOCATE1(xmass);
// DEALLOCATE3(matMass,1,1);
//}
free(line);
fclose(COMP);
fclose(MASS);
}
*/
\ No newline at end of file
}
\ No newline at end of file
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