From 8af51750b24ea037c5ad64641d79b05a60448d11 Mon Sep 17 00:00:00 2001 From: over0219 Date: Tue, 30 Jun 2020 17:07:29 -0500 Subject: working on mcgs --- extern/softbody/src/admmpd_types.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'extern/softbody/src/admmpd_types.h') diff --git a/extern/softbody/src/admmpd_types.h b/extern/softbody/src/admmpd_types.h index 46765150e1c..3615fd9cd5f 100644 --- a/extern/softbody/src/admmpd_types.h +++ b/extern/softbody/src/admmpd_types.h @@ -32,7 +32,7 @@ struct Options { mult_k(1), min_res(1e-6), youngs(1000000), - poisson(0.299), + poisson(0.399), grav(0,0,-9.8) {} }; @@ -72,24 +72,25 @@ struct SolverData { RowSparseMatrix D; // reduction matrix RowSparseMatrix DtW2; // D'W^2 RowSparseMatrix A; // M + D'W^2D - RowSparseMatrix K[3]; // constraint Jacobian - Eigen::VectorXd l; // constraint rhs (Kx=l) + RowSparseMatrix C; // linearized constraints + Eigen::VectorXd d; // constraints rhs double spring_k; // constraint stiffness Eigen::SimplicialLDLT > ldltA; - struct CGData { // Temporaries used in conjugate gradients - RowSparseMatrix A[3]; // (M + D'W^2D) + k * Kt K - Eigen::MatrixXd b; // M xbar + DtW2(z-u) + k Kt l - Eigen::MatrixXd r; // residual - Eigen::MatrixXd z; - Eigen::MatrixXd p; - Eigen::MatrixXd Ap; // A * p - } cgdata; - struct GSData { // Temporaries used in Gauss-Seidel - RowSparseMatrix KtK; // k * Kt K, different dim than A! - Eigen::MatrixXd last_dx; // last GS iter change in x - std::vector > A_colors; // colors of just A matrix - std::vector > A_KtK_colors; // colors of just A+KtK - } gsdata; + struct GlobalStepData { // Temporaries used in global step + RowSparseMatrix A3; // (M + D'W^2D) n3 x n3 + RowSparseMatrix CtC; // k * Ct C + RowSparseMatrix A3_plus_CtC; + Eigen::VectorXd Ctd; // k * Ct d + Eigen::VectorXd b3_plus_Ctd; // M xbar + DtW2(z-u) + k Kt l + // Used by Conjugate-Gradients: + Eigen::VectorXd r; // residual + Eigen::VectorXd z; // auxilary + Eigen::VectorXd p; // direction + Eigen::VectorXd A3p; // A3 * p + // Used by Gauss-Seidel: + std::vector > A_colors; // colors of (original) A matrix + std::vector > A3_plus_CtC_colors; // colors of A3+KtK + } gsdata; // Set in append_energies: std::vector indices; // per-energy index into D (row, num rows) std::vector rest_volumes; // per-energy rest volume -- cgit v1.2.3