const unsigned int n_transform_funcs) :
FiniteElementData<1> (dofs_per_vertex,
dofs_per_line,
- n_transform_functs)
+ n_transform_funcs)
{
Assert (dofs_per_quad==0, ExcInternalError());
const bool compute_ansatz_points,
vector<Point<1> > &q_points,
const bool compute_q_points,
- const dFMatrix &shape_values_transform,
- const vector<vector<Point<dim> > > &shape_grad_transform,
+ const dFMatrix &,
+ const vector<vector<Point<1> > > &,
const Boundary<1> &boundary) const {
Assert (jacobians.size() == unit_points.size(),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
if (compute_jacobians)
jacobians[i](0,0) = 1./h;
if (compute_q_points)
+ // assume a linear mapping from unit
+ // to real space. overload this
+ // function if you don't like that
q_points[i] = cell->vertex(0) + h*unit_points[i];
};
template <>
-void FiniteElement<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension(unit_points.size(), total_dofs));
+void FiniteElement<1>::get_unit_ansatz_points (vector<Point<1> > &ansatz_points) const {
+ Assert (ansatz_points.size() == total_dofs,
+ ExcWrongFieldDimension(ansatz_points.size(), total_dofs));
// compute ansatz points. The first ones
// belong to vertex one, the second ones
// to vertex two, all following are
perl -pi -e 's/grad_phi_polynom\[(\d)\] = (.*);/case $1: return Point<1>($2);/g;' shape_grad_1d
perl -pi -e 's/\[(\d+)\]\[(\d)\]/($1,$2)/g;' massmatrix_1d
perl -pi -e 's/\[(\d+)\]\[(\d)\]\[(\d)\]/[$1]($2,$3)/g;' prolongation_1d
- perl -pi -e 's/(t\d+) =/const double $1/g;' massmatrix_1d
+ perl -pi -e 's/(t\d+) =/const double $1 =/g;' massmatrix_1d
*/
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
- const double t1 8.0/105.0*h;
- const double t2 19.0/1680.0*h;
- const double t3 33.0/560.0*h;
- const double t4 3.0/140.0*h;
- const double t5 27.0/70.0*h;
- const double t6 27.0/560.0*h;
+ const double t1 = 8.0/105.0*h;
+ const double t2 = 19.0/1680.0*h;
+ const double t3 = 33.0/560.0*h;
+ const double t4 = 3.0/140.0*h;
+ const double t5 = 27.0/70.0*h;
+ const double t6 = 27.0/560.0*h;
local_mass_matrix(0,0) = t1;
local_mass_matrix(0,1) = t2;
local_mass_matrix(0,2) = t3;
+
/* $Id$ */
#include <fe/fe_lib.h>
Assert((i<total_dofs), ExcInvalidIndex(i));
switch (i)
{
- case 0: return (1.-p(0)) * (1.-p(1));
- case 1: return p(0) * (1.-p(1));
- case 2: return p(0) * p(1);
- case 3: return (1.-p(0)) * p(1);
+ case 0: return (1.-p(0)) * (1.-p(1));
+ case 1: return p(0) * (1.-p(1));
+ case 2: return p(0) * p(1);
+ case 3: return (1.-p(0)) * p(1);
}
return 0.;
};
Assert((i<total_dofs), ExcInvalidIndex(i));
switch (i)
{
- case 0: return Point<2> (p(1)-1., p(0)-1.);
- case 1: return Point<2> (1.-p(1), -p(0));
- case 2: return Point<2> (p(1), p(0));
- case 3: return Point<2> (-p(1), 1.-p(0));
+ case 0: return Point<2> (p(1)-1., p(0)-1.);
+ case 1: return Point<2> (1.-p(1), -p(0));
+ case 2: return Point<2> (p(1), p(0));
+ case 3: return Point<2> (-p(1), 1.-p(0));
}
return Point<2> ();
};
local_mass_matrix(0,2) = t15;
local_mass_matrix(0,3) = t16;
local_mass_matrix(1,0) = t14;
- local_mass_matrix(1,1) = t2/12-t3/12-t4/36-t12/18+t5/12+t6/36+t7/36-t8/12-t9/36+t13/18;
+ local_mass_matrix(1,1) = t2/12-t3/12-t4/36-t12/18+t5/12+t6/36+
+ t7/36-t8/12-t9/36+t13/18;
local_mass_matrix(1,2) = t18;
local_mass_matrix(1,3) = t15;
local_mass_matrix(2,0) = t15;
local_mass_matrix(2,1) = t18;
- local_mass_matrix(2,2) = -t1/18+t2/12+t5/36-t3/36+t6/12-t9/12+t10/18-t4/36+t7/36-t8/12;
+ local_mass_matrix(2,2) = -t1/18+t2/12+t5/36-t3/36+t6/12-t9/12+
+ t10/18-t4/36+t7/36-t8/12;
local_mass_matrix(2,3) = t20;
local_mass_matrix(3,0) = t16;
local_mass_matrix(3,1) = t15;
local_mass_matrix(3,2) = t20;
- local_mass_matrix(3,3) = t12/18+t2/36+t5/36-t3/36+t6/12-t9/12-t13/18-t4/12+t7/12-t8/36;
+ local_mass_matrix(3,3) = t12/18+t2/36+t5/36-t3/36+t6/12-t9/12-
+ t13/18-t4/12+t7/12-t8/36;
};
perl -pi -e 's/\[(\d+)\]\[(\d)\]/($1,$2)/g;' massmatrix_1d
perl -pi -e 's/\[(\d+)\]\[(\d)\]\[(\d)\]/[$1]($2,$3)/g;' prolongation_1d
perl -pi -e 's/.*= 0.0;\n//g;' prolongation_1d
- perl -pi -e 's/(t\d+) =/const double $1/g;' massmatrix_1d
+ perl -pi -e 's/(t\d+) =/const double $1 =/g;' massmatrix_1d
*/
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
- const double t1 146.0/2835.0*h;
- const double t2 29.0/5670.0*h;
- const double t3 148.0/2835.0*h;
- const double t4 29.0/945.0*h;
- const double t5 4.0/405.0*h;
- const double t6 128.0/405.0*h;
- const double t7 64.0/945.0*h;
- const double t8 128.0/2835.0*h;
+ const double t1 = 146.0/2835.0*h;
+ const double t2 = 29.0/5670.0*h;
+ const double t3 = 148.0/2835.0*h;
+ const double t4 = 29.0/945.0*h;
+ const double t5 = 4.0/405.0*h;
+ const double t6 = 128.0/405.0*h;
+ const double t7 = 64.0/945.0*h;
+ const double t8 = 128.0/2835.0*h;
local_mass_matrix(0,0) = t1;
local_mass_matrix(0,1) = -t2;
local_mass_matrix(0,2) = t3;
vector<Point<1> > &q_points,
const bool compute_q_points,
const dFMatrix &shape_values_transform,
- const vector<vector<Point<dim> > > &shape_gradients_transform,
+ const vector<vector<Point<1> > > &shape_gradients_transform,
const Boundary<1> &boundary) const {
// simply pass down
FiniteElement<1>::fill_fe_values (cell, unit_points,
template <>
void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
- const unsigned int face_no,
- const Boundary<2> &,
- const vector<Point<1> > &unit_points,
- vector<Point<2> > &normal_vectors) const {
+ const unsigned int face_no,
+ const Boundary<2> &,
+ const vector<Point<1> > &unit_points,
+ vector<Point<2> > &normal_vectors) const {
// more or less copied from the linear
// finite element
Assert (unit_points.size() == normal_vectors.size(),
template <>
void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int,
- const vector<Point<1> > &unit_points,
- vector<Point<2> > &normal_vectors) const {
+ const unsigned int face_no,
+ const unsigned int,
+ const vector<Point<1> > &unit_points,
+ vector<Point<2> > &normal_vectors) const {
// more or less copied from the linear
// finite element
// note, that in 2D the normal vectors to the
template <>
void Triangulation<1>::create_triangulation (const vector<Point<1> > &v,
const vector<CellData<1> > &cells,
- const SubCellData &) {
+ const SubCellData &subcelldata) {
// note: since no boundary information
// can be given in one dimension, the
- // #subcelldata# field is ignored.
+ // #subcelldata# field is ignored. (only
+ // used for error checking, which is a
+ // good idea in any case)
const unsigned int dim=1;