changed: remove unused method from PETScMatrix

git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@2716 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
akva
2014-02-18 12:34:10 +00:00
committed by Knut Morten Okstad
parent 7d14f3ec74
commit 650d96e265

View File

@@ -289,93 +289,6 @@ static bool assemPETSc (const Matrix& eM, Mat SM, PETScVector* SV,
}
/* kmo: This static method is never compiled, even when building without PETSc.
It used to be within an #ifndef HAS_PETSC but since the whole file content
is within an #ifdef HAS_PETSC it will never be in action.
SO PLEASE DELETE IT, UNLESS THERE IS SOMETHING HERE I'VE MISSED....
static void assemPETSc (const Matrix& eM, Mat SM, PETScVector* SV,
const std::vector<int>& meen, const int* meqn,
const int* mpmceq, const int* mmceq, const Real* ttcc)
{
Real c0;
size_t i, j;
int ieq, jeq, ip, jp, iceq, jceq;
// Get C array
PetscScalar* svec = NULL;
if (SV && SV->dim() > 0)
VecGetArray(SV->getVector(),&svec);
// Number of degrees of freedom for element
size_t nedof = meen.size();
// Convert meen to 0-based C array
PetscInt* l2g = new PetscInt[nedof];
for (i = 0; i < nedof; i++)
l2g[i] = meqn[meen[i]-1] - 1;
// Add element stiffness matrix to global matrix
Matrix A(eM,true); // A = eM^t
MatSetValues(SM,nedof,l2g,nedof,l2g,A.ptr(),ADD_VALUES);
// Add (appropriately weighted) elements corresponding to constrained
// (dependent and prescribed) dofs in eM into SM and/or SV
for (j = 1; j <= nedof; j++) {
jceq = -meen[j-1];
if (jceq < 1) continue;
jp = mpmceq[jceq-1];
c0 = ttcc[jp-1];
// Add contributions to right-hand side vector (SV)
if (svec)
for (i = 1; i <= nedof; i++) {
ieq = meen[i-1];
iceq = -ieq;
if (ieq > 0)
svec[ieq-1] -= c0*eM(i,j);
else if (iceq > 0)
for (ip = mpmceq[iceq-1]; ip < mpmceq[iceq]-1; ip++)
if (mmceq[ip] > 0) {
ieq = meqn[mmceq[ip]-1];
svec[ieq-1] -= c0*ttcc[ip]*eM(i,j);
}
}
// Add contributions to SM
for (jp = mpmceq[jceq-1]; jp < mpmceq[jceq]-1; jp++) {
if (mmceq[jp] > 0) {
jeq = meqn[mmceq[jp]-1];
for (i = 1; i <= nedof; i++) {
ieq = meen[i-1];
iceq = -ieq;
if (ieq > 0)
if (ieq == jeq)
MatSetValue(SM,ieq-1,jeq-1,(ttcc[jp]+ttcc[jp])*eM(i,j),ADD_VALUES);
else {
MatSetValue(SM,ieq-1,jeq-1,ttcc[jp]*eM(i,j),ADD_VALUES);
MatSetValue(SM,jeq-1,ieq-1,ttcc[jp]*eM(j,i),ADD_VALUES);
}
else if (iceq > 0)
for (ip = mpmceq[iceq-1]; ip < mpmceq[iceq]-1; ip++)
if (mmceq[ip] > 0) {
ieq = meqn[mmceq[ip]-1];
MatSetValue(SM,ieq-1,jeq-1,ttcc[ip]*ttcc[jp]*eM(i,j),ADD_VALUES);
}
}
}
}
}
// Restore vector values
if (svec)
VecRestoreArray(SV->getVector(),&svec);
// Deallocate memory for l2g mapping
delete [] l2g;
}
*/
void PETScMatrix::initAssembly (const SAM& sam, bool)
{
const SAMpatchPara* sampch = dynamic_cast<const SAMpatchPara*>(&sam);