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

pp

parent 29255f9f
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,8 @@ class dofManager{
}
inline void assemble(MVertex *vR, int iCompR, int iFieldR,
MVertex *vC, int iCompC, int iFieldC,
const dataMat &value){
const dataMat &value)
{
assemble(vR->getNum(), Dof::createTypeWithTwoInts(iCompR, iFieldR),
vC->getNum(), Dof::createTypeWithTwoInts(iCompC, iFieldC),
value);
......@@ -157,7 +158,8 @@ class dofManager{
assemble(Dof(entR, typeR), value);
}
inline void assemble(MVertex *vR, int iCompR, int iFieldR,
const dataMat &value){
const dataMat &value)
{
assemble(vR->getNum(), Dof::createTypeWithTwoInts(iCompR, iFieldR), value);
}
int sizeOfR() const { return unknown.size(); }
......
......@@ -143,7 +143,8 @@ void elasticitySolver::solve()
it != nodalDisplacements.end(); ++it){
MVertex *v = pModel->getMeshVertexByTag(it->first.first);
pAssembler-> fixVertex(v , it->first.second, _tag, it->second);
printf("-- Fixing node %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second);
printf("-- Fixing node %3d comp %1d to %8.5f\n",
it->first.first, it->first.second, it->second);
}
for (std::map<std::pair<int, int>, double>::iterator it = edgeDisplacements.begin();
......@@ -151,7 +152,8 @@ void elasticitySolver::solve()
elasticityTerm El(pModel, 1, 1, _tag);
El.dirichletNodalBC(it->first.first, 1, it->first.second, _tag,
gmshFunction<double>(it->second), *pAssembler);
printf("-- Fixing edge %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second);
printf("-- Fixing edge %3d comp %1d to %8.5f\n",
it->first.first, it->first.second, it->second);
}
for (std::map<std::pair<int, int>, double>::iterator it = faceDisplacements.begin();
......@@ -159,7 +161,8 @@ void elasticitySolver::solve()
elasticityTerm El(pModel, 1, 1, _tag);
El.dirichletNodalBC(it->first.first, 2, it->first.second, _tag,
gmshFunction<double>(it->second), *pAssembler);
printf("-- Fixing face %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second);
printf("-- Fixing face %3d comp %1d to %8.5f\n",
it->first.first, it->first.second, it->second);
}
// we number the nodes : when a node is numbered, it cannot be numbered
......@@ -189,7 +192,8 @@ void elasticitySolver::solve()
pAssembler-> assemble(ent[i]->mesh_vertices[0] , 0, _tag, f.x());
pAssembler-> assemble(ent[i]->mesh_vertices[0] , 1, _tag, f.y());
pAssembler-> assemble(ent[i]->mesh_vertices[0] , 2, _tag, f.z());
printf("-- Force on node %3d(%3d) : %8.5f %8.5f %8.5f\n", ent[i]->mesh_vertices[0]->getNum(), iVertex, f.x(), f.y(), f.z());
printf("-- Force on node %3d(%3d) : %8.5f %8.5f %8.5f\n",
ent[i]->mesh_vertices[0]->getNum(), iVertex, f.x(), f.y(), f.z());
}
}
......
......@@ -52,10 +52,12 @@ class elasticitySolver{
void setMesh(const std::string &meshFileName);
virtual void solve();
void readInputFile(const std::string &meshFileName);
// PView * buildDisplacementView (const std::string &postFileName);
// PView * buildVonMisesView(const std::string &postFileName);
// std::pair<PView *, PView*> buildErrorEstimateView (const std::string &errorFileName, double, int);
// std::pair<PView *, PView*> buildErrorEstimateView (const std::string &errorFileName, const gmshElasticityData &ref, double, int);
// PView *buildDisplacementView(const std::string &postFileName);
// PView *buildVonMisesView(const std::string &postFileName);
// std::pair<PView *, PView*> buildErrorEstimateView
// (const std::string &errorFileName, double, int);
// std::pair<PView *, PView*> buildErrorEstimateView
// (const std::string &errorFileName, const gmshElasticityData &ref, double, int);
};
#endif
......
......@@ -12,7 +12,7 @@
#include "MElement.h"
#include "fullMatrix.h"
class elasticityTerm : public femTerm<double,double> {
class elasticityTerm : public femTerm<double, double> {
protected:
double _E, _nu;
int _iField;
......@@ -32,7 +32,7 @@ class elasticityTerm : public femTerm<double,double> {
}
public:
elasticityTerm(GModel *gm, double E, double nu, int iField) :
femTerm<double,double>(gm), _E(E), _nu(nu), _iField(iField){}
femTerm<double, double>(gm), _E(E), _nu(nu), _iField(iField) {}
void setVector(const SVector3 &f) {_volumeForce = f;}
void elementMatrix(MElement *e, fullMatrix<double> &m) const;
void elementVector(MElement *e, fullVector<double> &m) const;
......
......@@ -17,7 +17,7 @@
// \nabla \cdot k \nabla U + a U
template<class scalar>
class helmoltzTerm : public femTerm<scalar,scalar> {
class helmoltzTerm : public femTerm<scalar, scalar> {
protected:
const gmshFunction<scalar> *_k, *_a;
const int _iFieldR;
......@@ -80,9 +80,9 @@ class helmoltzTerm : public femTerm<scalar,scalar> {
}
for (int j = 0; j < nbNodes; j++){
for (int k = 0; k <= j; k++){
m(j, k) += (K* (Grads[j][0] * Grads[k][0] +
Grads[j][1] * Grads[k][1] +
Grads[j][2] * Grads[k][2]) + A * sf[j] * sf[k]) *
m(j, k) += (K * (Grads[j][0] * Grads[k][0] +
Grads[j][1] * Grads[k][1] +
Grads[j][2] * Grads[k][2]) + A * sf[j] * sf[k]) *
weightDetJ;
}
}
......
......@@ -20,11 +20,9 @@ class laplaceTerm : public helmholtzTerm<scalar> {
_k = ONE;
}
laplaceTerm(GModel *gm, int iFieldR, gmshFunction<scalar> *k) :
helmholtzTerm<scalar>(gm, iFieldR, iFieldR, k, 0), ONE(0)
{}
helmholtzTerm<scalar>(gm, iFieldR, iFieldR, k, 0), ONE(0) {}
laplaceTerm(GModel *gm, int iFieldR, int iFieldC, gmshFunction<scalar> *k) :
helmholtzTerm<scalar>(gm, iFieldR, iFieldC, k, 0), ONE(0)
{}
helmholtzTerm<scalar>(gm, iFieldR, iFieldC, k, 0), ONE(0) {}
virtual ~laplaceTerm()
{
if(ONE) delete ONE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment