void NRSolver :: initPrescribedEqs() { EModelDefaultEquationNumbering dn; ParallelContext *parallel_context = engngModel->giveParallelContext( this->domain->giveNumber() ); int count = 0, ndofman = domain->giveNumberOfDofManagers(); IntArray localPrescribedEqs(numberOfPrescribedDofs); for ( int j = 1; j <= ndofman; j++ ) { if ( !parallel_context->isLocal( domain->giveNode(j) ) ) { continue; } int jglobnum = domain->giveNode(j)->giveGlobalNumber(); for ( int i = 1; i <= numberOfPrescribedDofs; i++ ) { int inode = prescribedDofs.at(2 * i - 1); int idofid = prescribedDofs.at(2 * i); if ( inode == jglobnum ) { localPrescribedEqs.at(++count) = domain->giveNode(j)->giveDofWithID(idofid)->giveEquationNumber(dn); continue; } } } prescribedEqs.resize(count); for ( int i = 1; i <= count; i++ ) { prescribedEqs.at(i) = localPrescribedEqs.at(i); } numberOfPrescribedDofs = count; this->prescribedEqsInitFlag = true; }
void NRSolver :: initPrescribedEqs() { EModelDefaultEquationNumbering dn; #if defined ( __PARALLEL_MODE ) && defined ( __PETSC_MODULE ) PetscContext *parallel_context = engngModel->givePetscContext(this->domain->giveNumber()); #endif int jglobnum, count = 0, ndofman = domain->giveNumberOfDofManagers(); int inode, idof; IntArray localPrescribedEqs(numberOfPrescribedDofs); for ( int j = 1; j <= ndofman; j++ ) { #if defined ( __PARALLEL_MODE ) && defined ( __PETSC_MODULE ) if ( !parallel_context->isLocal(domain->giveNode(j)) ) { continue; } #endif jglobnum = domain->giveNode(j)->giveGlobalNumber(); for ( int i = 1; i <= numberOfPrescribedDofs; i++ ) { inode = prescribedDofs.at(2 * i - 1); idof = prescribedDofs.at(2 * i); if ( inode == jglobnum ) { localPrescribedEqs.at(++count) = domain->giveNode(j)->giveDof(idof)->giveEquationNumber(dn); continue; } } } prescribedEqs.resize(count); for ( int i = 1; i <= count; i++ ) { prescribedEqs.at(i) = localPrescribedEqs.at(i); } numberOfPrescribedDofs = count; this->prescribedEqsInitFlag = true; }