def test_all_cases(self): def mask_candidate(AggOp, candidates): # mask out all dofs that are not included in the aggregation candidates[diff(AggOp.indptr) == 0, :] = 0 for AggOp, fine_candidates in self.cases: mask_candidate(AggOp, fine_candidates) Q, coarse_candidates = fit_candidates(AggOp, fine_candidates) # each fine level candidate should be fit (almost) exactly assert_almost_equal(fine_candidates, Q * coarse_candidates) assert_almost_equal(Q * (Q.H * fine_candidates), fine_candidates)
def test_all_cases(self): def mask_candidate(AggOp,candidates): #mask out all dofs that are not included in the aggregation candidates[diff(AggOp.indptr) == 0,:] = 0 for AggOp,fine_candidates in self.cases: mask_candidate(AggOp,fine_candidates) Q,coarse_candidates = fit_candidates(AggOp,fine_candidates) #each fine level candidate should be fit (almost) exactly assert_almost_equal(fine_candidates,Q*coarse_candidates) assert_almost_equal(Q*(Q.H*fine_candidates),fine_candidates)