// Copyright 2013 - Christian Schüller 2013, schuellc@inf.ethz.ch // Interactive Geometry Lab - ETH Zurich #include "Identity_LIMSolver3D.h" #include "TetrahedronMesh.h" Identity_LIMSolver3D::Identity_LIMSolver3D() { } Identity_LIMSolver3D::~Identity_LIMSolver3D() { } void Identity_LIMSolver3D::debugOutput(std::stringstream& info) { std::cout << "I: " << info.str() << "\n"; } void Identity_LIMSolver3D::prepareProblemData(std::vector& hessRowIdx, std::vector& hessColIdx) { const int numNodes = mesh->InitalVertices->rows(); const int numTets = mesh->Tetrahedra->rows(); // create sparse identity matrix Identity.resize(numVariables,numVariables); std::vector > triplets; triplets.reserve(numVariables); for(int i=0;i(i,i,1)); } Identity.setFromTriplets(triplets.begin(),triplets.end()); for (int i=0;i& x) { // laplacian energy function f(v) = (v-p)'L(v-p) Eigen::VectorXd vv0 = x-initialNodes; return 0.5 * vv0.transpose() * Identity * vv0; } void Identity_LIMSolver3D::computeGradient(const Eigen::Matrix& x, Eigen::Matrix& grad) { // laplacian grad = x-initialNodes; } void Identity_LIMSolver3D::computeHessian(const Eigen::Matrix& x, const Eigen::Matrix& hess) { // identity for(int i=0;i