+#include <base/function.h>
#include <base/quadrature_lib.h>
#include <grid/tria.h>
#include <grid/tria_accessor.h>
#include <fe/fe_values.h>
#include <dofs/dof_tools.h>
#include <numerics/data_out.h>
+#include <numerics/vectors.h>
+#include <numerics/matrices.h>
#include <lac/vector.h>
#include <lac/full_matrix.h>
};
+
void LaplaceProblem::assemble_system ()
{
QGauss3<2> quadrature_formula;
cell->get_dof_indices (local_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
- system_matrix.add (i, j, cell_matrix(i,j));
+ system_matrix.add (local_dof_indices[i],
+ local_dof_indices[j],
+ cell_matrix(i,j));
for (unsigned int i=0; i<dofs_per_cell; ++i)
- system_rhs(i) += cell_rhs(i);
- };
+ system_rhs(local_dof_indices[i]) += cell_rhs(i);
+ };
+
+
+ map<int,double> boundary_values;
+ VectorTools::interpolate_boundary_values (dof_handler,
+ 0,
+ ZeroFunction<2>(),
+ boundary_values);
+ MatrixTools<2>::apply_boundary_values (boundary_values,
+ system_matrix,
+ solution,
+ system_rhs);
};
data_out.add_data_vector (solution, "solution");
data_out.build_patches ();
- ofstream output ("solution.eps");
- data_out.write_eps (output);
+ ofstream output ("solution.gpl");
+ data_out.write_gnuplot (output);
};
+#include <base/function.h>
#include <base/quadrature_lib.h>
#include <grid/tria.h>
#include <grid/tria_accessor.h>
#include <fe/fe_values.h>
#include <dofs/dof_tools.h>
#include <numerics/data_out.h>
+#include <numerics/vectors.h>
+#include <numerics/matrices.h>
#include <lac/vector.h>
#include <lac/full_matrix.h>
};
+
void LaplaceProblem::assemble_system ()
{
QGauss3<2> quadrature_formula;
cell->get_dof_indices (local_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
- system_matrix.add (i, j, cell_matrix(i,j));
+ system_matrix.add (local_dof_indices[i],
+ local_dof_indices[j],
+ cell_matrix(i,j));
for (unsigned int i=0; i<dofs_per_cell; ++i)
- system_rhs(i) += cell_rhs(i);
- };
+ system_rhs(local_dof_indices[i]) += cell_rhs(i);
+ };
+
+
+ map<int,double> boundary_values;
+ VectorTools::interpolate_boundary_values (dof_handler,
+ 0,
+ ZeroFunction<2>(),
+ boundary_values);
+ MatrixTools<2>::apply_boundary_values (boundary_values,
+ system_matrix,
+ solution,
+ system_rhs);
};
data_out.add_data_vector (solution, "solution");
data_out.build_patches ();
- ofstream output ("solution.eps");
- data_out.write_eps (output);
+ ofstream output ("solution.gpl");
+ data_out.write_gnuplot (output);
};