本文整理汇总了C++中SparseMatrix::GetInverseIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ SparseMatrix::GetInverseIndex方法的具体用法?C++ SparseMatrix::GetInverseIndex怎么用?C++ SparseMatrix::GetInverseIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparseMatrix
的用法示例。
在下文中一共展示了SparseMatrix::GetInverseIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
StVKStiffnessMatrix::StVKStiffnessMatrix(StVKInternalForces * stVKInternalForces)
{
precomputedIntegrals = stVKInternalForces->GetPrecomputedIntegrals();
volumetricMesh = stVKInternalForces->GetVolumetricMesh();
numElementVertices = volumetricMesh->getNumElementVertices();
int numElements = volumetricMesh->getNumElements();
lambdaLame = (double*) malloc (sizeof(double) * numElements);
muLame = (double*) malloc (sizeof(double) * numElements);
for(int el=0; el<numElements; el++)
{
VolumetricMesh::Material * material = volumetricMesh->getElementMaterial(el);
VolumetricMesh::ENuMaterial * eNuMaterial = downcastENuMaterial(material);
if (eNuMaterial == NULL)
{
printf("Error: mesh does not consist of E, nu materials.\n");
throw 1;
}
lambdaLame[el] = eNuMaterial->getLambda();
muLame[el] = eNuMaterial->getMu();
}
// build stiffness matrix skeleton
SparseMatrix * stiffnessMatrixTopology;
GetStiffnessMatrixTopology(&stiffnessMatrixTopology);
// build acceleration indices
row_ = (int**) malloc (sizeof(int*) * numElements);
column_ = (int**) malloc (sizeof(int*) * numElements);
for (int el=0; el < numElements; el++)
{
row_[el] = (int*) malloc (sizeof(int) * numElementVertices);
column_[el] = (int*) malloc (sizeof(int) * numElementVertices * numElementVertices);
for(int ver=0; ver<numElementVertices; ver++)
row_[el][ver] = volumetricMesh->getVertexIndex(el, ver);
// seek for value row[j] in list associated with row[i]
for(int i=0; i<numElementVertices; i++)
for(int j=0; j<numElementVertices; j++)
column_[el][numElementVertices * i + j] =
stiffnessMatrixTopology->GetInverseIndex(3*row_[el][i],3*row_[el][j]) / 3;
}
delete(stiffnessMatrixTopology);
}