void FSDEMatIsotropicSurfaceT::TakeParameterList(const ParameterListT& list) { FSSolidMatT::TakeParameterList(list); /* FSDEMatQ1P0SurfaceT stuff */ fMu = list.GetParameter("mu"); fElectricPermittivity = list.GetParameter("epsilon"); fNrig = list.GetParameter("Nrig"); fLambda = list.GetParameter("lambda"); /* Isotropic surface stuff */ fNu = list.GetParameter("Poisson"); fE = list.GetParameter("Young_Modulus"); /* dimension work space */ fModulusKStV.Dimension(kStressDim); fIsotropicStress.Dimension(kNumDOF); fStress1.Dimension(kNumDOF); fTM.Dimension(kStressDim); /* Calculate (constant) Isotropic modulus */ SetModulus(); }
PAlgebraModDerived<type>::PAlgebraModDerived(const PAlgebra& _zMStar, long _r) : zMStar(_zMStar), r(_r) { long p = zMStar.getP(); long m = zMStar.getM(); // For dry-run, use a tiny m value for the PAlgebra tables if (isDryRun()) m = (p==3)? 4 : 3; assert(r > 0); ZZ BigPPowR = power_ZZ(p, r); assert(BigPPowR.SinglePrecision()); pPowR = to_long(BigPPowR); long nSlots = zMStar.getNSlots(); RBak bak; bak.save(); SetModulus(p); // Compute the factors Ft of Phi_m(X) mod p, for all t \in T RX phimxmod; conv(phimxmod, zMStar.getPhimX()); // Phi_m(X) mod p vec_RX localFactors; EDF(localFactors, phimxmod, zMStar.getOrdP()); // equal-degree factorization RX* first = &localFactors[0]; RX* last = first + localFactors.length(); RX* smallest = min_element(first, last); swap(*first, *smallest); // We make the lexicographically smallest factor have index 0. // The remaining factors are ordered according to their representives. RXModulus F1(localFactors[0]); for (long i=1; i<nSlots; i++) { unsigned long t =zMStar.ith_rep(i); // Ft is minimal polynomial of x^{1/t} mod F1 unsigned long tInv = InvMod(t, m); // tInv = t^{-1} mod m RX X2tInv = PowerXMod(tInv,F1); // X2tInv = X^{1/t} mod F1 IrredPolyMod(localFactors[i], X2tInv, F1); } /* Debugging sanity-check #1: we should have Ft= GCD(F1(X^t),Phi_m(X)) for (i=1; i<nSlots; i++) { unsigned long t = T[i]; RX X2t = PowerXMod(t,phimxmod); // X2t = X^t mod Phi_m(X) RX Ft = GCD(CompMod(F1,X2t,phimxmod),phimxmod); if (Ft != localFactors[i]) { cout << "Ft != F1(X^t) mod Phi_m(X), t=" << t << endl; exit(0); } }*******************************************************************/ if (r == 1) { build(PhimXMod, phimxmod); factors = localFactors; pPowRContext.save(); // Compute the CRT coefficients for the Ft's crtCoeffs.SetLength(nSlots); for (long i=0; i<nSlots; i++) { RX te = phimxmod / factors[i]; // \prod_{j\ne i} Fj te %= factors[i]; // \prod_{j\ne i} Fj mod Fi InvMod(crtCoeffs[i], te, factors[i]); // \prod_{j\ne i} Fj^{-1} mod Fi } } else { PAlgebraLift(zMStar.getPhimX(), localFactors, factors, crtCoeffs, r); RX phimxmod1; conv(phimxmod1, zMStar.getPhimX()); build(PhimXMod, phimxmod1); pPowRContext.save(); } // set factorsOverZZ factorsOverZZ.resize(nSlots); for (long i = 0; i < nSlots; i++) conv(factorsOverZZ[i], factors[i]); genCrtTable(); genMaskTable(); }