ImplicitNewmarkDense::ImplicitNewmarkDense(int r, double timestep, double * massMatrix, ReducedForceModel * reducedForceModel, solverType solver, double dampingMassCoef, double dampingStiffnessCoef, int maxIterations, double epsilon, double NewmarkBeta, double NewmarkGamma): IntegratorBaseDense(r, timestep, massMatrix, reducedForceModel, dampingMassCoef, dampingStiffnessCoef) { this->solver = solver; this->maxIterations = maxIterations; // maxIterations = 1 for semi-implicit this->epsilon = epsilon; this->NewmarkBeta = NewmarkBeta; this->NewmarkGamma = NewmarkGamma; symmetricSolver_lwork = 64 * r; symmetricSolver_work = (double*) malloc (sizeof(double) * symmetricSolver_lwork); UpdateAlphas(); }
ImplicitNewmarkSparse::ImplicitNewmarkSparse(int r, double timestep, SparseMatrix * massMatrix_, ForceModel * forceModel_, int positiveDefiniteSolver_, int numConstrainedDOFs_, int * constrainedDOFs_, double dampingMassCoef, double dampingStiffnessCoef, int maxIterations, double epsilon, double NewmarkBeta, double NewmarkGamma, int numSolverThreads_): IntegratorBaseSparse(r, timestep, massMatrix_, forceModel_, numConstrainedDOFs_, constrainedDOFs_, dampingMassCoef, dampingStiffnessCoef), positiveDefiniteSolver(positiveDefiniteSolver_), numSolverThreads(numSolverThreads_) { this->maxIterations = maxIterations; // maxIterations = 1 for semi-implicit this->epsilon = epsilon; this->NewmarkBeta = NewmarkBeta; this->NewmarkGamma = NewmarkGamma; useStaticSolver = false; UpdateAlphas(); forceModel->GetTangentStiffnessMatrixTopology(&tangentStiffnessMatrix); if (tangentStiffnessMatrix->Getn() != massMatrix->Getn()) { printf("Error: the provided mass matrix does not have correct size. Mass matrix: %d x %d. Stiffness matrix: %d x %d.\n", massMatrix->Getn(), massMatrix->Getn(), tangentStiffnessMatrix->Getn(), tangentStiffnessMatrix->Getn()); exit(1); } rayleighDampingMatrix = new SparseMatrix(*tangentStiffnessMatrix); rayleighDampingMatrix->BuildSubMatrixIndices(*massMatrix); tangentStiffnessMatrix->BuildSubMatrixIndices(*massMatrix); tangentStiffnessMatrix->BuildSubMatrixIndices(*dampingMatrix, 1); if (tangentStiffnessMatrix->GetNumRows() != massMatrix->GetNumRows()) { printf("Error: mass matrix and stiffness matrix don't have same dimensions.\n"); exit(1); } bufferConstrained = (double*) malloc (sizeof(double) * (r - numConstrainedDOFs)); systemMatrix = new SparseMatrix(*tangentStiffnessMatrix); systemMatrix->RemoveRowsColumns(numConstrainedDOFs, constrainedDOFs); systemMatrix->BuildSuperMatrixIndices(numConstrainedDOFs, constrainedDOFs, tangentStiffnessMatrix); #ifdef PARDISO printf("Creating Pardiso solver. Positive-definite solver: %d. Num threads: %d\n", positiveDefiniteSolver, numSolverThreads); pardisoSolver = new PardisoSolver(systemMatrix, numSolverThreads, positiveDefiniteSolver); #endif #ifdef PCG jacobiPreconditionedCGSolver = new CGSolver(systemMatrix); #endif }
void ImplicitNewmarkDenseMulti1D::SetNewmarkGamma(double NewmarkGamma_) { NewmarkGamma = NewmarkGamma_; UpdateAlphas(); UpdateCoefs(); }