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

updated nrel5_dynamic case

parent 9e645972
[Beam]
analysis_flag = 2
nkp = 21
nkp = 25
niter = 1
nstep = 5000
nstep = 100
ncond_pt = 2
initFromFile = 0
L=61.5
dt = 0.002
\ No newline at end of file
dt = 0.01
\ No newline at end of file
49
0.0000000E+00 1.3308000E+01
1.9987500E-01 1.3308000E+01
1.1998650E+00 1.3308000E+01
2.1998550E+00 1.3308000E+01
3.1998450E+00 1.3308000E+01
4.1998350E+00 1.3308000E+01
5.1998250E+00 1.3308000E+01
6.1998150E+00 1.3308000E+01
7.1998050E+00 1.3308000E+01
8.2010250E+00 1.3308000E+01
9.1997850E+00 1.3308000E+01
1.0199775E+01 1.3308000E+01
1.1199765E+01 1.3181000E+01
1.2199755E+01 1.2848000E+01
1.3200975E+01 1.2192000E+01
1.4199735E+01 1.1561000E+01
1.5199725E+01 1.1072000E+01
1.6199715E+01 1.0792000E+01
1.8200925E+01 1.0232000E+01
2.0200290E+01 9.6720000E+00
2.2200270E+01 9.1100000E+00
2.4200250E+01 8.5340000E+00
2.6200230E+01 7.9320000E+00
2.8200825E+01 7.3210000E+00
3.0200190E+01 6.7110000E+00
3.2200170E+01 6.1220000E+00
3.4200150E+01 5.5460000E+00
3.6200130E+01 4.9710000E+00
3.8200725E+01 4.4010000E+00
4.0200090E+01 3.8340000E+00
4.2200070E+01 3.3320000E+00
4.4200050E+01 2.8900000E+00
4.6200030E+01 2.5030000E+00
4.8201240E+01 2.1160000E+00
5.0199990E+01 1.7300000E+00
5.2199970E+01 1.3420000E+00
5.4199950E+01 9.5400000E-01
5.5199940E+01 7.6000000E-01
5.6199930E+01 5.7400000E-01
5.7199920E+01 4.0400000E-01
5.7699915E+01 3.1900000E-01
5.8201140E+01 2.5300000E-01
5.8699905E+01 2.1600000E-01
5.9199900E+01 1.7800000E-01
5.9699895E+01 1.4000000E-01
6.0199890E+01 1.0100000E-01
6.0699885E+01 6.2000000E-02
6.1199880E+01 2.3000000E-02
6.1500000E+01 0.0000000E+00
\ No newline at end of file
0.0000000E+00 -1.3308000E+01
1.9987500E-01 -1.3308000E+01
1.1998650E+00 -1.3308000E+01
2.1998550E+00 -1.3308000E+01
3.1998450E+00 -1.3308000E+01
4.1998350E+00 -1.3308000E+01
5.1998250E+00 -1.3308000E+01
6.1998150E+00 -1.3308000E+01
7.1998050E+00 -1.3308000E+01
8.2010250E+00 -1.3308000E+01
9.1997850E+00 -1.3308000E+01
1.0199775E+01 -1.3308000E+01
1.1199765E+01 -1.3181000E+01
1.2199755E+01 -1.2848000E+01
1.3200975E+01 -1.2192000E+01
1.4199735E+01 -1.1561000E+01
1.5199725E+01 -1.1072000E+01
1.6199715E+01 -1.0792000E+01
1.8200925E+01 -1.0232000E+01
2.0200290E+01 -9.6720000E+00
2.2200270E+01 -9.1100000E+00
2.4200250E+01 -8.5340000E+00
2.6200230E+01 -7.9320000E+00
2.8200825E+01 -7.3210000E+00
3.0200190E+01 -6.7110000E+00
3.2200170E+01 -6.1220000E+00
3.4200150E+01 -5.5460000E+00
3.6200130E+01 -4.9710000E+00
3.8200725E+01 -4.4010000E+00
4.0200090E+01 -3.8340000E+00
4.2200070E+01 -3.3320000E+00
4.4200050E+01 -2.8900000E+00
4.6200030E+01 -2.5030000E+00
4.8201240E+01 -2.1160000E+00
5.0199990E+01 -1.7300000E+00
5.2199970E+01 -1.3420000E+00
5.4199950E+01 -9.5400000E-01
5.5199940E+01 -7.6000000E-01
5.6199930E+01 -5.7400000E-01
5.7199920E+01 -4.0400000E-01
5.7699915E+01 -3.1900000E-01
5.8201140E+01 -2.5300000E-01
5.8699905E+01 -2.1600000E-01
5.9199900E+01 -1.7800000E-01
5.9699895E+01 -1.4000000E-01
6.0199890E+01 -1.0100000E-01
6.0699885E+01 -6.2000000E-02
6.1199880E+01 -2.3000000E-02
6.1500000E+01 -0.0000000E+00
\ No newline at end of file
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include "beam.h"
......@@ -10,14 +11,6 @@ int main(int argc, char* argv[])
int i;
double load;
// Check the input argument
if(argc<2)
{
printf("Please specify the uniform load value as arguments\n");
printf("Example: ./gebt 100\n");
exit(EXIT_FAILURE);
}
// Initializing the Beam
printf("Initializing the beam...\n");
Beam *bm = malloc(sizeof(Beam));
......@@ -31,26 +24,39 @@ int main(int argc, char* argv[])
double *loads = malloc(sizeof(double)*bm->nmemb);
for(i=0;i<bm->nmemb;i++)
{
loads[i] = atof(argv[1]);
loads[i] = 5e3;
}
beam_setLoads(bm,loads,1); // 1 -> Fy (flapwise)
for(i=0;i<bm->nmemb;i++)
{
loads[i] = 10e3;
}
beam_setLoads(bm,loads,2);
beam_setLoads(bm,loads,2); // 2 -> Fz (edgewise)
printf("...Done!\n");
char fname[32] = "output";
double meanTime = 0.0;
clock_t start;
printf("Performing the analysis...\n");
for (i=0;i<1;i++)
for (i=0;i<100;i++)
{
sprintf(fname,"output%d_",i);
sprintf(fname,"output_%d_",i);
printf("Global Step = %d...\n",i);
start = clock();
beam_analysis(bm);
meanTime += ((double) (clock() - start))/CLOCKS_PER_SEC;
beam_writeSolToFile(bm,fname);
printf("... Ok! \n");
}
beam_writeBeamToFile(bm,"beamFile.out");
free(loads);
freeBeam(bm);
free(bm);
printf("Mean time: %e",meanTime/10.0);
return EXIT_SUCCESS;
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
import numpy as np
fid = open("ComplianceAndMass.dat","r");
fid = open("StiffnessAndMass.dat","r");
lines = fid.readlines();
......
#!/usr/bin/env python3
# Launch the Euler-Bernoulli comparison for the beam
#%%
import numpy as np
import matplotlib.pyplot as plt
from readIni import IniReader
......@@ -12,50 +13,98 @@ dt = ini.getValue("Beam","dt" ,typeCast=float);
nmemb = nkp-1
display = 0
F = 1e4;
#out = sp.run(["./gebt"],check=True);
u2 = {};
u3 = {};
phi1 = {};
for f in ["output"]:
u2[f] = []
u3[f] = []
phi1[f] = []
for k in range(100):
for j in range(100):
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);
pts = data_pts;
mem = data_mem;
if(display):
#plt.plot(mem[:,0]+mem[:,3],mem[:,4]+mem[:,1]);
plt.plot(pts[:,0]+pts[:,3],pts[:,5]+pts[:,2],'.-k');
#plt.plot(mem[:,0]+mem[:,3],mem[:,5]+mem[:,2],'.r');
plt.xlabel('x');
plt.ylabel('w(x)');
#plt.axis('scaled');
plt.ylim([-10,10]);
plt.pause(0.01);
plt.clf();
print("u2 = %f m"%(pts[-1,4]))
print("u3 = %f m"%(pts[-1,5]))
#out = sp.run(["./gebt", "-%e"%(F)],check=True);
u2[f].append(pts[-1,4]);
u3[f].append(pts[-1,5]);
phi1[f].append(pts[-1,6]);
u2 = [];
u3 = [];
u2[f] = np.array(u2[f]);
u3[f] = np.array(u3[f]);
phi1[f] = np.array(phi1[f]);
t = np.linspace(0,u3[f].size*dt,u3[f].size);
for k in range(5000):
data_pts = np.loadtxt("output0_%03d.dat"%(k),max_rows=nkp);
data_mem = np.loadtxt("output0_%03d.dat"%(k),skiprows=nkp);
for f in []:
u2[f] = []
u3[f] = []
for k in range(100):
for j in range(100):
data_pts = np.loadtxt("output%s_%d_%03d.dat"%(f,k,j),max_rows=nkp);
data_mem = np.loadtxt("output%s_%d_%03d.dat"%(f,k,j),skiprows=nkp);
pts = data_pts;
mem = data_mem;
pts = data_pts;
mem = data_mem;
if(display):
#plt.plot(mem[:,0]+mem[:,3],mem[:,4]+mem[:,1]);
plt.plot(pts[:,0]+pts[:,3],pts[:,5]+pts[:,2],'.-k');
#plt.plot(mem[:,0]+mem[:,3],mem[:,5]+mem[:,2],'.r');
if(display):
#plt.plot(mem[:,0]+mem[:,3],mem[:,4]+mem[:,1]);
plt.plot(pts[:,0]+pts[:,3],pts[:,5]+pts[:,2],'.-k');
#plt.plot(mem[:,0]+mem[:,3],mem[:,5]+mem[:,2],'.r');
plt.xlabel('x');
plt.ylabel('w(x)');
#plt.axis('scaled');
plt.xlabel('x');
plt.ylabel('w(x)');
#plt.axis('scaled');
plt.ylim([-10,10]);
plt.ylim([-10,10]);
plt.pause(0.01);
plt.clf();
plt.pause(0.01);
plt.clf();
print("u2 = %f m"%(pts[-1,4]))
print("u3 = %f m"%(pts[-1,5]))
print("u2 = %f m"%(pts[-1,4]))
print("u3 = %f m"%(pts[-1,5]))
u2.append(pts[-1,4]);
u3.append(pts[-1,5]);
u2[f].append(pts[-1,4]);
u3[f].append(pts[-1,5]);
u2 = np.array(u2);
u3 = np.array(u3);
t = np.linspace(0,u3.size*dt,u3.size);
u2[f] = np.array(u2[f]);
u3[f] = np.array(u3[f]);
t = np.linspace(0,u3[f].size*dt,u3[f].size);
plt.figure()
plt.plot(t,u2);
plt.plot(t,u3);
plt.grid(True);
for f in ["output"]:
plt.plot(t,u2[f]);
plt.plot(t,u3[f]);
plt.plot(t,phi1[f]);
plt.grid(True);
plt.title("GEBT");
print("Done!");
......
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