Exemple #1
0
 def res():
   if name == 'direct':
     lhs = model.solve_linear( dofs, residual=residual, constrain=cons )
   else:
     lhs = model.newton( dofs, residual=residual, lhs0=cons|0, freezedofs=cons.where ).solve( tol=1e-10, maxiter=0 )
   res = residual.replace( dofs, lhs ).eval()
   resnorm = numpy.linalg.norm( res[~cons.where] )
   assert resnorm < 1e-13
Exemple #2
0
 def res():
   tol = 1e-10
   if name == 'direct':
     lhs = model.solve_linear( dofs, residual=residual, constrain=cons )
   elif name == 'newton':
     lhs = model.newton( dofs, residual=residual, lhs0=lhs0, freezedofs=cons.where ).solve( tol=tol, maxiter=2 )
   else:
     lhs = model.pseudotime( dofs, residual=residual, lhs0=lhs0, freezedofs=cons.where, inertia=inertia, timestep=1 ).solve( tol=tol, maxiter=3 )
   res = residual.replace( dofs, lhs ).eval()
   resnorm = numpy.linalg.norm( res[~cons.where] )
   assert resnorm < tol
Exemple #3
0
 def res():
     if name == 'direct':
         lhs = model.solve_linear(dofs,
                                  residual=residual,
                                  constrain=cons)
     else:
         lhs = model.newton(dofs,
                            residual=residual,
                            lhs0=cons | 0,
                            freezedofs=cons.where).solve(tol=1e-10,
                                                         maxiter=0)
     res = residual.replace(dofs, lhs).eval()
     resnorm = numpy.linalg.norm(res[~cons.where])
     assert resnorm < 1e-13
Exemple #4
0
 def res():
     tol = 1e-10
     if name == 'direct':
         lhs = model.solve_linear(dofs,
                                  residual=residual,
                                  constrain=cons)
     elif name == 'newton':
         lhs = model.newton(dofs,
                            residual=residual,
                            lhs0=lhs0,
                            freezedofs=cons.where).solve(tol=tol,
                                                         maxiter=2)
     else:
         lhs = model.pseudotime(dofs,
                                residual=residual,
                                lhs0=lhs0,
                                freezedofs=cons.where,
                                inertia=inertia,
                                timestep=1).solve(tol=tol, maxiter=3)
     res = residual.replace(dofs, lhs).eval()
     resnorm = numpy.linalg.norm(res[~cons.where])
     assert resnorm < tol