namespace std
{
/**
- * Computes the sine of a vectorized data field. The result is return as
+ * Computes the sine of a vectorized data field. The result is returned as
* vectorized array in the form <tt>{sin(x[0]), sin(x[1]), ...,
* sin(x[n_array_elements-1])}</tt>.
*
/**
- * Computes the tangent of a vectorized data field. The result is return as
+ * Computes the tangent of a vectorized data field. The result is returned as
* vectorized array in the form <tt>{tan(x[0]), tan(x[1]), ...,
* tan(x[n_array_elements-1])}</tt>.
*
/**
- * Computes the cosine of a vectorized data field. The result is return as
+ * Computes the cosine of a vectorized data field. The result is returned as
* vectorized array in the form <tt>{cos(x[0]), cos(x[1]), ...,
* cos(x[n_array_elements-1])}</tt>.
*
/**
- * Computes the exponential of a vectorized data field. The result is return
+ * Computes the exponential of a vectorized data field. The result is returned
* as vectorized array in the form <tt>{exp(x[0]), exp(x[1]), ...,
* exp(x[n_array_elements-1])}</tt>.
*
/**
* Computes the natural logarithm of a vectorized data field. The result is
- * return as vectorized array in the form <tt>{log(x[0]), log(x[1]), ...,
+ * returned as vectorized array in the form <tt>{log(x[0]), log(x[1]), ...,
* log(x[n_array_elements-1])}</tt>.
*
* @relates VectorizedArray
/**
- * Computes the square root of a vectorized data field. The result is return
+ * Computes the square root of a vectorized data field. The result is returned
* as vectorized array in the form <tt>{sqrt(x[0]), sqrt(x[1]), ...,
* sqrt(x[n_array_elements-1])}</tt>.
*
/**
* Computes the absolute value (modulus) of a vectorized data field. The
- * result is return as vectorized array in the form <tt>{abs(x[0]),
+ * result is returned as vectorized array in the form <tt>{abs(x[0]),
* abs(x[1]), ..., abs(x[n_array_elements-1])}</tt>.
*
* @relates VectorizedArray
/**
* Computes the componentwise maximum of two vectorized data fields. The
- * result is return as vectorized array in the form <tt>{max(x[0],y[0]),
+ * result is returned as vectorized array in the form <tt>{max(x[0],y[0]),
* max(x[1],y[1]), ...}</tt>.
*
* @relates VectorizedArray
/**
* Computes the componentwise minimum of two vectorized data fields. The
- * result is return as vectorized array in the form <tt>{min(x[0],y[0]),
+ * result is returned as vectorized array in the form <tt>{min(x[0],y[0]),
* min(x[1],y[1]), ...}</tt>.
*
* @relates VectorizedArray
deallog << "OK" << std::endl
<< "Sine: ";
- e = std::sin(b);
+ e = std::sin(d);
for (unsigned int i=0; i<n_vectors; ++i)
- AssertThrow (std::fabs(e[i]-std::sin(b[i])) <
+ AssertThrow (std::fabs(e[i]-std::sin(d[i])) <
10.*std::numeric_limits<Number>::epsilon(),
ExcInternalError());
deallog << "OK" << std::endl
{
AssertDimension (src.size(), 2);
FEEvaluationGL<dim,fe_degree> current (data), old (data);
- deallog << "submitted values: ";
+ deallog << "submit / sine values: ";
for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
{
current.reinit (cell);
const VectorizedArray<double> current_value = current.get_value(q);
const VectorizedArray<double> old_value = old.get_value(q);
- current.submit_value (2.*current_value - old_value -
- delta_t_sqr * std::sin(current_value),q);
+ const VectorizedArray<double> submit_value =
+ 2.*current_value - old_value - delta_t_sqr * std::sin(current_value);
+ current.submit_value (submit_value,q);
current.submit_gradient (- delta_t_sqr *
current.get_gradient(q), q);
+
+ // output first value on quadrature point for all vector
+ // components (should be stable irrespective of vectorization
+ // width)
+ if (q==0)
+ for (unsigned int v=0; v<VectorizedArray<double>::n_array_elements; ++v)
+ deallog << submit_value[v] << " " << (delta_t_sqr*std::sin(current_value))[v] << " ";
}
- // output first value on quadrature point for all vector components
- // (should be stable irrespective of vectorization width)
- for (unsigned int v=0; v<VectorizedArray<double>::n_array_elements; ++v)
- deallog << current.begin_values()[0][v] << " ";
current.integrate (true,true);
current.distribute_local_to_global (dst);
}
deallog << std::endl;
-
- deallog << "no sine term: ";
- // now output similar terms again but without the sine term (and do not
- // write anything back to the solution vector)
- for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
- {
- current.reinit (cell);
- old.reinit (cell);
-
- current.read_dof_values (*src[0]);
- old.read_dof_values (*src[1]);
-
- current.evaluate (true, true, false);
- old.evaluate (true, false, false);
-
- for (unsigned int q=0; q<current.n_q_points; ++q)
- {
- const VectorizedArray<double> current_value = current.get_value(q);
- const VectorizedArray<double> old_value = old.get_value(q);
-
- current.submit_value (2.*current_value - old_value, q);
- current.submit_gradient (- delta_t_sqr *
- current.get_gradient(q), q);
- }
- // output first value on quadrature point for all vector components
- // (should be stable irrespective of vectorization width)
- for (unsigned int v=0; v<VectorizedArray<double>::n_array_elements; ++v)
- deallog << current.begin_values()[0][v] << " ";
- }
- deallog << std::endl;
}
DEAL:: Time step size: 0.2500, finest cell: 7.500
DEAL::
DEAL:: Time: -10.0 , solution norm: 7.11111164
-DEAL::submitted values: 0 0 0 0 0 0 0 0 0 0 0 0 0.569151584 0 0 0
-DEAL::no sine term: 0 0 0 0 0 0 0 0 0 0 0 0 0.562500000 0 0 0
+DEAL::submit / sine values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4.04730016 -0.0473001560 0 0 0 0 0 0
DEAL:: Time: -9.75 , solution norm: 3.78861141
-DEAL::submitted values: 0 0 0 0 0 0 -0.00121093741 0 0 -0.00121093741 0 0 0.222882619 -0.00121093741 -0.00121093741 0
-DEAL::no sine term: 0 0 0 0 0 0 -0.00124999978 0 0 -0.00124999978 0 0 0.225803189 -0.00124999978 -0.00124999978 0
+DEAL::submit / sine values: 0 0 0 0 0 0 0 0 0 0 0 0 -0.00861111050 -0.000277776814 0 0 0 0 -0.00861111050 -0.000277776814 0 0 0 0 1.58494307 0.0207685003 -0.00861111050 -0.000277776814 -0.00861111050 -0.000277776814 0 0
DEAL:: Time: -9.50 , solution norm: 0.869590104
DEAL::
DEAL:: Performed 3 time steps.