added option for computing biharmonic field
This commit is contained in:
parent
24fe5cb6a0
commit
0aec75be39
|
@ -55,7 +55,7 @@ public:
|
||||||
* @note the algorithm has unexpected behavior if the mesh contains unreferenced vertices.
|
* @note the algorithm has unexpected behavior if the mesh contains unreferenced vertices.
|
||||||
*/
|
*/
|
||||||
template <typename ACCESSOR>
|
template <typename ACCESSOR>
|
||||||
static bool ComputeScalarField(MeshType & m, const ConstraintVec & constraints, ACCESSOR field)
|
static bool ComputeScalarField(MeshType & m, const ConstraintVec & constraints, ACCESSOR field, bool biharmonic = false)
|
||||||
{
|
{
|
||||||
typedef Eigen::SparseMatrix<CoeffScalar> SpMat; // sparse matrix type
|
typedef Eigen::SparseMatrix<CoeffScalar> SpMat; // sparse matrix type
|
||||||
typedef Eigen::Triplet<CoeffScalar> Triple; // triplet type to fill the matrix
|
typedef Eigen::Triplet<CoeffScalar> Triple; // triplet type to fill the matrix
|
||||||
|
@ -115,6 +115,13 @@ public:
|
||||||
}
|
}
|
||||||
laplaceMat.setFromTriplets(coeffs.begin(), coeffs.end());
|
laplaceMat.setFromTriplets(coeffs.begin(), coeffs.end());
|
||||||
|
|
||||||
|
if (biharmonic)
|
||||||
|
{
|
||||||
|
SpMat lap_t = laplaceMat;
|
||||||
|
lap_t.transpose();
|
||||||
|
laplaceMat = lap_t * laplaceMat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Setting the constraints
|
// Setting the constraints
|
||||||
const CoeffScalar alpha = pow(10.0, 8.0); // penalty factor alpha
|
const CoeffScalar alpha = pow(10.0, 8.0); // penalty factor alpha
|
||||||
|
|
Loading…
Reference in New Issue