Skip to content
Snippets Groups Projects
Commit 1bba6236 authored by Éric Béchet's avatar Éric Béchet
Browse files

*** empty log message ***

parent b1d7e617
No related branches found
No related tags found
No related merge requests found
...@@ -75,23 +75,40 @@ class femTerm { ...@@ -75,23 +75,40 @@ class femTerm {
{ {
const int nbR = localMatrix.size1(); const int nbR = localMatrix.size1();
const int nbC = localMatrix.size2(); const int nbC = localMatrix.size2();
std::vector<Dof> R,C; std::vector<Dof> R,C; // better use default consdtructors and reserve the right amount of space to avoid reallocation
for (int j = 0; j < nbR; j++) R.reserve(nbR);
R.push_back(getLocalDofR(se, j)); C.reserve(nbC);
for (int k = 0; k < nbC; k++) bool sym=true;
C.push_back(getLocalDofC(se, k)); if (nbR == nbC)
{
for (int j = 0; j < nbR; j++)
{
Dof r(getLocalDofR(se, j));
Dof c(getLocalDofC(se, j));
R.push_back(r);
C.push_back(c);
if (!(r==c)) sym=false;
}
}
else
{
sym=false;
for (int j = 0; j < nbR; j++)
R.push_back(getLocalDofR(se, j));
for (int k = 0; k < nbC; k++)
C.push_back(getLocalDofC(se, k));
}
/* for (int i = 0; i < nbC; i++) */ /* for (int i = 0; i < nbC; i++) */
/* for (int j = 0; j < nbR; j++) */ /* for (int j = 0; j < nbR; j++) */
/* dm.assemble(getLocalDofR(se, i), getLocalDofC(se, j), localMatrix(i,j)); */ /* dm.assemble(getLocalDofR(se, i), getLocalDofC(se, j), localMatrix(i,j)); */
/* return; */ /* return; */
bool sym = true;
if (nbR == nbC){ // if (nbR == nbC){
for (int i=0;i<nbR;i++) // for (int i=0;i<nbR;i++)
if (!(C[i] == R[i]))sym = false; // if (!(C[i] == R[i]))sym = false;
} // }
else sym = false; // else sym = false;
if (!sym) if (!sym)
dm.assemble(R, C, localMatrix); dm.assemble(R, C, localMatrix);
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment