$(LIBDIR)/libdeal_II_1d.g$(shared-lib-suffix): $(go-files-1d)
@echo "=====deal.II====1d====debug======$(MT)== Linking library: $(@F)"
+ @echo $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(go-files-1d) $(deplibs.g)
@$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(go-files-1d) $(deplibs.g)
$(LIBDIR)/libdeal_II_1d$(shared-lib-suffix): $(o-files-1d)
$(LIBDIR)/libdeal_II_3d.g$(shared-lib-suffix): $(go-files-3d)
@echo "=====deal.II====3d====debug======$(MT)== Linking library: $(@F)"
+ @echo $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(go-files-3d) $(deplibs.g)
@$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(go-files-3d) $(deplibs.g)
$(LIBDIR)/libdeal_II_3d$(shared-lib-suffix): $(o-files-3d)
@echo "=====deal.II====3d====optimized==$(MT)== Linking library: $(@F)"
+ @echo $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(o-files-3d) $(deplibs.o)
@$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $@ $(o-files-3d) $(deplibs.o)
* <tt>MatrixCreator::create_*</tt> functions which take a right hand side do,
* but without assembling a matrix.
*
+ * <li> Creation of right hand side vectors for point sources:
+ * The @p create_point_source_vector function computes the vector
+ * $f_i = \int_\Omega \delta_0(x-x_0) \phi_i(x) dx$.
+ *
* <li> Creation of boundary right hand side vectors: The
* @p create_boundary_right_hand_side function computes the vector
* $f_i = \int_{\partial\Omega} g(x) \phi_i(x) dx$. This is the
Vector<double> &rhs_vector);
/**
+ * Create a right hand side
+ * vector for a point source at point @p p.
+ * Prior content of the
+ * given @p rhs_vector vector is
+ * deleted.
+ *
+ * See the general documentation of this
+ * class for further information.
+ */
+ template <int dim>
+ static void create_point_source_vector(const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
+ const Point<dim> &p,
+ Vector<double> &rhs_vector);
+
+ /**
+ * Calls the @p create_point_source_vector
+ * function, see above, with
+ * <tt>mapping=MappingQ1@<dim@>()</tt>.
+ */
+ template <int dim>
+ static void create_point_source_vector(const DoFHandler<dim> &dof,
+ const Point<dim> &p,
+ Vector<double> &rhs_vector);
+
+ /**
* Create a right hand side
* vector from boundary
* forces. Prior content of the
Vector<double> &rhs_vector)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
- static const MappingQ1<dim> mapping;
- create_right_hand_side(mapping, dof_handler, quadrature,
+ create_right_hand_side(StaticMappingQ1<dim>::mapping, dof_handler, quadrature,
rhs_function, rhs_vector);
}
+template <int dim>
+void VectorTools::create_point_source_vector (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
+ const Point<dim> &p,
+ Vector<double> &rhs_vector)
+{
+ Assert (rhs_vector.size() == dof_handler.n_dofs(),
+ ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs()));
+ rhs_vector = 0;
+
+ std::pair<typename DoFHandler<dim>::active_cell_iterator, Point<dim> >
+ cell_point =
+ GridTools::find_active_cell_around_point (mapping, dof_handler, p);
+
+ Quadrature<dim> q(GeometryInfo<dim>::project_to_unit_cell(cell_point.second));
+
+ FEValues<dim> fe_values(dof_handler.get_fe(), q, UpdateFlags(update_values));
+ fe_values.reinit(cell_point.first);
+
+ const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
+
+ std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ cell_point.first->get_dof_indices (local_dof_indices);
+
+ for(unsigned int i=0; i<dofs_per_cell; i++)
+ rhs_vector(local_dof_indices[i]) = fe_values.shape_value(i,0);
+}
+
+template <int dim>
+void VectorTools::create_point_source_vector (const DoFHandler<dim> &dof_handler,
+ const Point<dim> &p,
+ Vector<double> &rhs_vector)
+{
+ Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
+ create_point_source_vector(StaticMappingQ1<dim>::mapping, dof_handler,
+ p, rhs_vector);
+}
#if deal_II_dimension != 1
const Quadrature<deal_II_dimension> &,
const Function<deal_II_dimension> &,
Vector<double> &);
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
#if deal_II_dimension != 1
template
<h3>deal.II</h3>
<ol>
+ <li> <p>
+ New: Function <code class="class">VectorTools</code>::<code
+ class="class">create_point_source_vector</code> to calculate the projection
+ of a Dirac pulse on the base functions. This models a point source as
+ used in the calculations of Green's functions and can also be used to
+ extract the value of a finite element solution in a single point.
<li> <p>
Changed: Functions <code class="class">VectorTools</code>::<code
class="member">point_value</code> and <code class="class">VectorTools</code>::<code