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

🎨 added write beam to file option

parent ee8f50c4
......@@ -509,7 +509,6 @@ void beam_setTwist(Beam *bm, double *twist)
int i;
double k1;
for(i=0;i<bm->nframe;i++){
printf("%f\n",twist[i]);
bm->frame[i][0][0] = 1.0;
bm->frame[i][0][1] = 0.0;
bm->frame[i][0][2] = 0.0;
......@@ -525,8 +524,7 @@ void beam_setTwist(Beam *bm, double *twist)
{
bm->member[i][6] = i+1; // Associate a non-zero curvature to the member -- TODO: find why it does not work when curvature is zero
bm->curvature[i][0] = k1;
}
printf("%f\n",k1);
}
}
}
......@@ -789,20 +787,26 @@ void beam_writeBeamToFile(Beam *bm,char *fname)
int i,j,k;
FILE *fid = fopen(fname,"w");
fprintf(fid,"nkp = %d",bm->nkp);
fprintf(fid,"%d",bm->nelem);
fprintf(fid,"%d",bm->ndof_el);
fprintf(fid,"%d",bm->nmemb);
fprintf(fid,"%d",bm->ncond_pt);
fprintf(fid,"%d",bm->nmate);
fprintf(fid,"%d",bm->nframe);
fprintf(fid,"%d",bm->ndistrfun);
fprintf(fid,"%d",bm->ncurv);
fprintf(fid,"nkp = %d\n",bm->nkp);
fprintf(fid,"nelem = %d\n",bm->nelem);
fprintf(fid,"ndof = %d\n",bm->ndof_el);
fprintf(fid,"nmemb = %d\n",bm->nmemb);
fprintf(fid,"ncond_pt = %d\n",bm->ncond_pt);
fprintf(fid,"nmate = %d\n",bm->nmate);
fprintf(fid,"nframe = %d\n",bm->nframe);
fprintf(fid,"ndistrfun = %d\n",bm->ndistrfun);
fprintf(fid,"ncurv = %d\n",bm->ncurv);
fprintf(fid,"Coordinates: \n");
WRITEF2(bm->coord, fid, %f, bm->nkp, NDIM);
fprintf(fid,"Member: \n");
WRITEF2(bm->member, fid, %d, bm->nmemb, MEMB_CONST);
WRITEF3(bm->material, fid, %f, bm->nmate, bm->ndof_el - NSTRN, NSTRN);
fprintf(fid,"Material: \n");
WRITEF3(bm->material, fid, % 1.6E, bm->nmate, bm->ndof_el - NSTRN, NSTRN);
fprintf(fid,"Frame: \n");
WRITEF3(bm->frame, fid, %f, bm->nframe, NDIM, NDIM);
fprintf(fid,"Distributed Functions: \n");
WRITEF2(bm->distr_fun,fid, %f, bm->ndistrfun, NSTRN);
fprintf(fid,"Curvatures: \n");
WRITEF2(bm->curvature,fid, %f, bm->ncurv, NDIM);
fclose(fid);
......
......@@ -160,6 +160,7 @@ void beam_setEndLoad(Beam *bm, double loads, int load_no);
void beam_analysis(Beam *bm);
void beam_writeBeamToFile(Beam *bm,char *fname);
void beam_writeSolToFile(Beam *bm, char *fileName);
void freeBeam(Beam *bm);
......
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