Skip to content
Snippets Groups Projects
Commit 39d9b38a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix windows build

parent 07ea32a6
No related branches found
No related tags found
No related merge requests found
...@@ -154,12 +154,8 @@ void elasticitySolver::readInputFile(const std::string &fn) ...@@ -154,12 +154,8 @@ void elasticitySolver::readInputFile(const std::string &fn)
return; return;
} }
if(what[0]=='#'){ if(what[0]=='#'){
char buffer[1024];
char *line=NULL; fgets(buffer, sizeof(buffer), f);
size_t l = 0;
getline(&line,&l,f);
free(line);
} }
else if (!strcmp(what, "ElasticDomain")){ else if (!strcmp(what, "ElasticDomain")){
elasticField field; elasticField field;
...@@ -504,53 +500,6 @@ void elasticitySolver::assemble(linearSystem<double> *lsys) ...@@ -504,53 +500,6 @@ void elasticitySolver::assemble(linearSystem<double> *lsys)
} }
static void deformation(dofManager<double> *a, MElement *e,
double u, double v, double w, int _tag, double *eps)
{
double valx[256];
double valy[256];
double valz[256];
for (int k = 0; k < e->getNumVertices(); k++){
a->getDofValue(e->getVertex(k), 0, _tag, valx[k]);
a->getDofValue(e->getVertex(k), 1, _tag, valy[k]);
a->getDofValue(e->getVertex(k), 2, _tag, valz[k]);
}
double gradux[3];
double graduy[3];
double graduz[3];
e->interpolateGrad(valx, u, v, w, gradux);
e->interpolateGrad(valy, u, v, w, graduy);
e->interpolateGrad(valz, u, v, w, graduz);
eps[0] = gradux[0];
eps[1] = graduy[1];
eps[2] = graduz[2];
eps[3] = 0.5 * (gradux[1] + graduy[0]);
eps[4] = 0.5 * (gradux[2] + graduz[0]);
eps[5] = 0.5 * (graduy[2] + graduz[1]);
}
static double vonMises(dofManager<double> *a, MElement *e,
double u, double v, double w,
double E, double nu, int _tag)
{
double eps[6];
deformation(a, e, u, v, w, _tag, eps);
double A = E / (1. + nu);
double B = A * (nu / (1. - 2 * nu));
double trace = eps[0] + eps[1] + eps[2] ;
double sxx = A * eps[0] + B * trace;
double syy = A * eps[1] + B * trace;
double szz = A * eps[2] + B * trace;
double sxy = A * eps[3];
double sxz = A * eps[4];
double syz = A * eps[5];
double s[9] = {sxx, sxy, sxz, sxy, syy, syz,sxz, syz, szz};
return ComputeVonMises(s);
}
void elasticitySolver::computeEffectiveStiffness(std::vector<double> stiff) void elasticitySolver::computeEffectiveStiffness(std::vector<double> stiff)
{ {
double st[6] = {0., 0., 0., 0., 0., 0.}; double st[6] = {0., 0., 0., 0., 0., 0.};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment