*
* @author Guido Kanschat, 2010
*/
- template < int dim, int spacedim=dim>
+ template <int dim, int spacedim=dim>
class DoFInfoBox
{
public:
* Constructor copying the seed
* into all other objects.
*/
- DoFInfoBox(const MeshWorker::DoFInfo<dim, spacedim>& seed);
+ DoFInfoBox(const DoFInfo<dim, spacedim>& seed);
+ /**
+ * Copy constructor, taking
+ * #cell and using it as a seed
+ * in the other constructor.
+ */
+ DoFInfoBox(const DoFInfoBox<dim, spacedim>&);
+
/**
* Reset all the availability flags.
*/
/**
* The data for the cell.
*/
- MeshWorker::DoFInfo<dim> cell;
+ DoFInfo<dim> cell;
/**
* The data for the faces from inside.
*/
- MeshWorker::DoFInfo<dim> interior[GeometryInfo<dim>::faces_per_cell];
+ DoFInfo<dim> interior[GeometryInfo<dim>::faces_per_cell];
/**
* The data for the faces from outside.
*/
- MeshWorker::DoFInfo<dim> exterior[GeometryInfo<dim>::faces_per_cell];
+ DoFInfo<dim> exterior[GeometryInfo<dim>::faces_per_cell];
/**
* A set of flags, indicating
/// vector of FEValues objects
std::vector<boost::shared_ptr<FEVALUESBASE> > fevalv;
public:
+ static const unsigned int dimension = FEVALUESBASE::dimension;
+ static const unsigned int space_dimension = FEVALUESBASE::space_dimension;
+
/**
* Constructor.
*/
IntegrationInfo();
-
+
+ /**
+ * Copy constructor, creating a
+ * clone to be used by
+ * WorksTream::run().
+ */
+ IntegrationInfo(const IntegrationInfo<dim, FEVALUESBASE, spacedim>& other);
+
/**
* Build all internal
* structures, in particular
}
+ template < int dim, int spacedim>
+ inline
+ DoFInfoBox<dim, spacedim>::DoFInfoBox(const DoFInfoBox<dim, spacedim>& other)
+ :
+ cell(other.cell)
+ {
+ for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+ {
+ exterior[i] = other.exterior[i];
+ interior[i] = other.interior[i];
+ interior_face_available[i] = false;
+ exterior_face_available[i] = false;
+ }
+ }
+
+
template < int dim, int spacedim>
inline void
DoFInfoBox<dim, spacedim>::reset ()
global_data(boost::shared_ptr<VectorDataBase<dim, sdim> >(new VectorDataBase<dim, sdim>))
{}
+
+ template<int dim, class FVB, int sdim>
+ IntegrationInfo<dim,FVB,sdim>::IntegrationInfo(const IntegrationInfo<dim,FVB,sdim>& other)
+ :
+ multigrid(other.multigrid),
+ values(other.values),
+ gradients(other.gradients),
+ hessians(other.hessians),
+ global_data(other.global_data),
+ n_components(other.n_components)
+ {
+ fevalv.resize(other.fevalv.size());
+ for (unsigned int i=0;i<other.fevalv.size();++i)
+ {
+ const FVB& p = *other.fevalv[i];
+ const FEValues<dim,sdim>* pc = dynamic_cast<const FEValues<dim,sdim>*>(&p);
+ const FEFaceValues<dim,sdim>* pf = dynamic_cast<const FEFaceValues<dim,sdim>*>(&p);
+ const FESubfaceValues<dim,sdim>* ps = dynamic_cast<const FESubfaceValues<dim,sdim>*>(&p);
+
+ if (pc != 0)
+ fevalv[i] = typename boost::shared_ptr<FVB> (
+ reinterpret_cast<FVB*>(new FEValues<dim,sdim> (pc->get_mapping(), pc->get_fe(),
+ pc->get_quadrature(), pc->get_update_flags())));
+ else if (pf != 0)
+ fevalv[i] = typename boost::shared_ptr<FVB> (
+ new FEFaceValues<dim,sdim> (pf->get_mapping(), pf->get_fe(), pf->get_quadrature(), pf->get_update_flags()));
+ else if (ps != 0)
+ fevalv[i] = typename boost::shared_ptr<FVB> (
+ new FESubfaceValues<dim,sdim> (ps->get_mapping(), ps->get_fe(), ps->get_quadrature(), ps->get_update_flags()));
+ else
+ Assert(false, ExcInternalError());
+ }
+ }
+
template<int dim, class FVB, int sdim>
template <class FEVALUES>
#include <base/config.h>
#include <base/std_cxx1x/function.h>
+#include <base/work_stream.h>
#include <base/template_constraints.h>
#include <grid/tria.h>
#include <numerics/mesh_worker_info.h>
return true;
}
+ template<int dim, int sdim, class A>
+ void assemble(const MeshWorker::DoFInfoBox<dim, sdim>& dinfo, A& assembler)
+ {
+ dinfo.assemble(assembler);
+ }
}
}
// Loop over all cells
- for (ITERATOR cell = begin; cell != end; ++cell)
- {
- cell_action(cell, dof_info, info, cell_worker, boundary_worker, face_worker, cells_first);
- dof_info.assemble(assembler);
- }
+ WorkStream::run(begin, end,
+ std_cxx1x::bind(cell_action<INFOBOX, dim, spacedim, ITERATOR>, _1, _3, _2,
+ cell_worker, boundary_worker, face_worker, cells_first),
+ std_cxx1x::bind(internal::assemble<dim,spacedim,ASSEMBLER>, _1, assembler),
+ info, dof_info);
+
+// for (ITERATOR cell = begin; cell != end; ++cell)
+// {
+// cell_action(cell, dof_info, info, cell_worker, boundary_worker, face_worker, cells_first);
+// dof_info.assemble(assembler);
+// }
}
/**