unwrap_nvector<VectorType>(const_n_vector);
Assert(false, NVectorTestError());
}
- catch (ExcMessage e)
+ catch (const ExcMessage &e)
{
const std::string msg(e.what());
Assert(msg.find(
+template <typename VectorType>
+void
+test_weighted_l2_norm()
+{
+ const auto vector_a = create_test_vector<VectorType>(2.0);
+ const auto vector_b = create_test_vector<VectorType>(3.0);
+
+ auto nv_a = make_nvector_view(vector_a);
+ auto nv_b = make_nvector_view(vector_b);
+
+ const auto result = N_VWL2Norm(nv_a, nv_b);
+
+ auto vector_a_reference = create_test_vector<VectorType>(2.0);
+ auto vector_b_reference = create_test_vector<VectorType>(3.0);
+ vector_a_reference.scale(vector_b_reference);
+ const auto result_reference = vector_a_reference.l2_norm();
+
+ Assert(std::fabs(result - result_reference) < 1e-12, NVectorTestError());
+
+ deallog << "test_weighted_l2_norm OK" << std::endl;
+}
+
+
+
template <typename VectorType>
void
test_max_norm()
+template <typename VectorType>
+void
+test_l1_norm()
+{
+ const auto vector_a = create_test_vector<VectorType>(2.0);
+ const auto vector_b = create_test_vector<VectorType>(-3.0);
+
+ auto nv_a = make_nvector_view(vector_a);
+ auto nv_b = make_nvector_view(vector_b);
+
+ auto result = N_VL1Norm(nv_a);
+ Assert(std::fabs(result - vector_a.l1_norm()) < 1e-12, NVectorTestError());
+
+ result = N_VL1Norm(nv_b);
+ Assert(std::fabs(result - vector_b.l1_norm()) < 1e-12, NVectorTestError());
+
+ deallog << "test_l1_norm OK" << std::endl;
+}
+
+
+
template <typename VectorType>
void
test_min_element()
test_elementwise_abs<VectorType>();
test_weighted_rms_norm<VectorType>();
test_weighted_rms_norm_mask<VectorType>();
+ test_weighted_l2_norm<VectorType>();
test_max_norm<VectorType>();
+ test_l1_norm<VectorType>();
test_min_element<VectorType>();
test_scale<VectorType>();
}
DEAL:0:Vector<double>::test_weighted_rms_norm OK
DEAL:0:Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:Vector<double>::test_weighted_l2_norm OK
DEAL:0:Vector<double>::test_max_norm OK
+DEAL:0:Vector<double>::test_l1_norm OK
DEAL:0:Vector<double>::test_min_element OK
DEAL:0:Vector<double>::test_scale OK
DEAL:0:BlockVector<double>::test_nvector_view_unwrap OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:BlockVector<double>::test_weighted_l2_norm OK
DEAL:0:BlockVector<double>::test_max_norm OK
+DEAL:0:BlockVector<double>::test_l1_norm OK
DEAL:0:BlockVector<double>::test_min_element OK
DEAL:0:BlockVector<double>::test_scale OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_nvector_view_unwrap OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_l2_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_max_norm OK
+DEAL:0:LinearAlgebra::distributed::Vector<double>::test_l1_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_min_element OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_scale OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_nvector_view_unwrap OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_l2_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_max_norm OK
+DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_l1_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_min_element OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_scale OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_max_norm OK
+DEAL:0:TrilinosWrappers::MPI::Vector::test_l1_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_min_element OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_scale OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:0:TrilinosWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_min_element OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_scale OK
DEAL:0:PETScWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:PETScWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_max_norm OK
+DEAL:0:PETScWrappers::MPI::Vector::test_l1_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_min_element OK
DEAL:0:PETScWrappers::MPI::Vector::test_scale OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:0:PETScWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_min_element OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_scale OK
DEAL:1:Vector<double>::test_weighted_rms_norm OK
DEAL:1:Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:1:Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:1:Vector<double>::test_weighted_l2_norm OK
DEAL:1:Vector<double>::test_max_norm OK
+DEAL:1:Vector<double>::test_l1_norm OK
DEAL:1:Vector<double>::test_min_element OK
DEAL:1:Vector<double>::test_scale OK
DEAL:1:BlockVector<double>::test_nvector_view_unwrap OK
DEAL:1:BlockVector<double>::test_weighted_rms_norm OK
DEAL:1:BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:1:BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:1:BlockVector<double>::test_weighted_l2_norm OK
DEAL:1:BlockVector<double>::test_max_norm OK
+DEAL:1:BlockVector<double>::test_l1_norm OK
DEAL:1:BlockVector<double>::test_min_element OK
DEAL:1:BlockVector<double>::test_scale OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_nvector_view_unwrap OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:1:LinearAlgebra::distributed::Vector<double>::test_weighted_l2_norm OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_max_norm OK
+DEAL:1:LinearAlgebra::distributed::Vector<double>::test_l1_norm OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_min_element OK
DEAL:1:LinearAlgebra::distributed::Vector<double>::test_scale OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_nvector_view_unwrap OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_weighted_l2_norm OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_max_norm OK
+DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_l1_norm OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_min_element OK
DEAL:1:LinearAlgebra::distributed::BlockVector<double>::test_scale OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:1:TrilinosWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_max_norm OK
+DEAL:1:TrilinosWrappers::MPI::Vector::test_l1_norm OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_min_element OK
DEAL:1:TrilinosWrappers::MPI::Vector::test_scale OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:1:TrilinosWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:1:TrilinosWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_min_element OK
DEAL:1:TrilinosWrappers::MPI::BlockVector::test_scale OK
DEAL:1:PETScWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:1:PETScWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:1:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:1:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:1:PETScWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:1:PETScWrappers::MPI::Vector::test_max_norm OK
+DEAL:1:PETScWrappers::MPI::Vector::test_l1_norm OK
DEAL:1:PETScWrappers::MPI::Vector::test_min_element OK
DEAL:1:PETScWrappers::MPI::Vector::test_scale OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:1:PETScWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:1:PETScWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_min_element OK
DEAL:1:PETScWrappers::MPI::BlockVector::test_scale OK
DEAL:0:Vector<double>::test_weighted_rms_norm OK
DEAL:0:Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:Vector<double>::test_weighted_l2_norm OK
DEAL:0:Vector<double>::test_max_norm OK
+DEAL:0:Vector<double>::test_l1_norm OK
DEAL:0:Vector<double>::test_min_element OK
DEAL:0:Vector<double>::test_scale OK
DEAL:0:BlockVector<double>::test_nvector_view_unwrap OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:BlockVector<double>::test_weighted_l2_norm OK
DEAL:0:BlockVector<double>::test_max_norm OK
+DEAL:0:BlockVector<double>::test_l1_norm OK
DEAL:0:BlockVector<double>::test_min_element OK
DEAL:0:BlockVector<double>::test_scale OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_nvector_view_unwrap OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:LinearAlgebra::distributed::Vector<double>::test_weighted_l2_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_max_norm OK
+DEAL:0:LinearAlgebra::distributed::Vector<double>::test_l1_norm OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_min_element OK
DEAL:0:LinearAlgebra::distributed::Vector<double>::test_scale OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_nvector_view_unwrap OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 1 OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_rms_norm_mask 0 OK
+DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_weighted_l2_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_max_norm OK
+DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_l1_norm OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_min_element OK
DEAL:0:LinearAlgebra::distributed::BlockVector<double>::test_scale OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:TrilinosWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_max_norm OK
+DEAL:0:TrilinosWrappers::MPI::Vector::test_l1_norm OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_min_element OK
DEAL:0:TrilinosWrappers::MPI::Vector::test_scale OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:TrilinosWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:0:TrilinosWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_min_element OK
DEAL:0:TrilinosWrappers::MPI::BlockVector::test_scale OK
DEAL:0:PETScWrappers::MPI::Vector::test_nvector_view_unwrap OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 1 OK
DEAL:0:PETScWrappers::MPI::Vector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:PETScWrappers::MPI::Vector::test_weighted_l2_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_max_norm OK
+DEAL:0:PETScWrappers::MPI::Vector::test_l1_norm OK
DEAL:0:PETScWrappers::MPI::Vector::test_min_element OK
DEAL:0:PETScWrappers::MPI::Vector::test_scale OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_nvector_view_unwrap OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 1 OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_rms_norm_mask 0 OK
+DEAL:0:PETScWrappers::MPI::BlockVector::test_weighted_l2_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_max_norm OK
+DEAL:0:PETScWrappers::MPI::BlockVector::test_l1_norm OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_min_element OK
DEAL:0:PETScWrappers::MPI::BlockVector::test_scale OK