The OldSolutionCoefs input functor class can be used with GenericProjector to read solution transfer coefficients on a just-refined-and-coarsened mesh.
More...
|
| OldSolutionCoefs (const libMesh::System &sys_in) |
|
| OldSolutionCoefs (const OldSolutionCoefs &in) |
|
DSNA | eval_at_node (const FEMContext &c, unsigned int i, unsigned int elem_dim, const Node &n, bool extra_hanging_dofs, Real=0.) |
|
DSNA | eval_at_point (const FEMContext &c, unsigned int i, const Point &p, Real=0.) |
|
void | eval_old_dofs (const Elem &elem, unsigned int node_num, unsigned int var_num, std::vector< dof_id_type > &indices, std::vector< DSNA > &values) |
|
void | eval_old_dofs (const Elem &elem, const FEType &fe_type, unsigned int sys_num, unsigned int var_num, std::vector< dof_id_type > &indices, std::vector< DSNA > &values) |
|
template<> |
DynamicSparseNumberArray< Real, dof_id_type > | eval_at_point (const FEMContext &c, unsigned int i, const Point &p, Real) |
|
template<> |
VectorValue< DynamicSparseNumberArray< Real, dof_id_type > > | eval_at_point (const FEMContext &c, unsigned int i, const Point &p, Real) |
|
template<> |
DynamicSparseNumberArray< Real, dof_id_type > | eval_at_node (const FEMContext &c, unsigned int i, unsigned int, const Node &n, bool extra_hanging_dofs, Real) |
|
template<> |
VectorValue< DynamicSparseNumberArray< Real, dof_id_type > > | eval_at_node (const FEMContext &c, unsigned int i, unsigned int elem_dim, const Node &n, bool extra_hanging_dofs, Real) |
|
template<> |
void | get_shape_outputs (FEBase &fe) |
|
template<> |
void | get_shape_outputs (FEBase &fe) |
|
template<> |
void | get_shape_outputs (FEBase &fe) |
|
template<> |
void | get_shape_outputs (FEBase &fe) |
|
void | init_context (FEMContext &c) |
|
bool | is_grid_projection () |
|
template<typename Output, void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
class libMesh::OldSolutionCoefs< Output, point_output >
The OldSolutionCoefs input functor class can be used with GenericProjector to read solution transfer coefficients on a just-refined-and-coarsened mesh.
- Author
- Roy H. Stogner
- Date
- 2017
Definition at line 485 of file system_projection.C.
◆ DSNA
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ OldSolutionCoefs() [1/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ OldSolutionCoefs() [2/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ check_old_context() [1/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ check_old_context() [2/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
Definition at line 565 of file generic_projector.h.
567 LOG_SCOPE (
"check_old_context(c,p)",
"OldSolutionBase");
568 const Elem & elem = c.get_elem();
586 for (
auto & child : elem.child_ref_range())
587 if (child.close_to_point(p, master_tol))
598 if (!elem.old_dof_object)
614 libmesh_assert_equal_to
617 for (
auto & child : elem.child_ref_range())
618 if (child.close_to_point(p, master_tol))
References libMesh::Elem::child_ref_range(), libMesh::FEMContext::get_elem(), libMesh::Elem::hmax(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::DofObject::old_dof_object, libMesh::Elem::parent(), libMesh::Real, and libMesh::Elem::refinement_flag().
◆ eval_at_node() [1/3]
Definition at line 749 of file system_projection.C.
756 LOG_SCOPE (
"RealGradient eval_at_node()",
"OldSolutionCoefs");
770 if (n.old_dof_object &&
771 (!extra_hanging_dofs ||
774 n.old_dof_object->n_vars(
sys.
number()) &&
775 n.old_dof_object->n_comp(
sys.
number(), i))
777 VectorValue<DynamicSparseNumberArray<Real, dof_id_type> > g;
778 for (
unsigned int d = 0; d != elem_dim; ++d)
781 n.old_dof_object->dof_number(
sys.
number(), i, d+1);
784 g(d).raw_index(0) = old_id;
References libMesh::DofObject::dof_number(), libMesh::FEMContext::get_elem(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_vars(), libMesh::DofObject::old_dof_object, and libMesh::Elem::refinement_flag().
◆ eval_at_node() [2/3]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ eval_at_node() [3/3]
Definition at line 703 of file system_projection.C.
710 LOG_SCOPE (
"Real eval_at_node()",
"OldSolutionCoefs");
724 if (n.old_dof_object &&
725 (!extra_hanging_dofs ||
728 n.old_dof_object->n_vars(
sys.
number()) &&
729 n.old_dof_object->n_comp(
sys.
number(), i))
731 DynamicSparseNumberArray<Real, dof_id_type> returnval;
733 n.old_dof_object->dof_number(
sys.
number(), i, 0);
735 returnval.raw_at(0) = 1;
736 returnval.raw_index(0) = old_id;
References libMesh::DofObject::dof_number(), libMesh::FEMContext::get_elem(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_vars(), libMesh::DofObject::old_dof_object, and libMesh::Elem::refinement_flag().
◆ eval_at_point() [1/3]
Definition at line 611 of file system_projection.C.
616 LOG_SCOPE (
"eval_at_point()",
"OldSolutionCoefs");
622 FEGenericBase<Real> * fe =
nullptr;
627 FEGenericBase<Real> * fe_new =
631 const std::vector<std::vector<Real> > & phi = fe_new->get_phi();
632 const std::vector<dof_id_type> & dof_indices =
635 const std::size_t n_dofs = phi.size();
636 libmesh_assert_equal_to(n_dofs, dof_indices.size());
638 DynamicSparseNumberArray<Real, dof_id_type> returnval;
639 returnval.resize(n_dofs);
643 returnval.raw_at(j) = phi[j][0];
644 returnval.raw_index(j) = dof_indices[j];
References libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::index_range(), and libMesh::Real.
◆ eval_at_point() [2/3]
Definition at line 656 of file system_projection.C.
661 LOG_SCOPE (
"eval_at_point()",
"OldSolutionCoefs");
667 FEGenericBase<Real> * fe =
nullptr;
672 FEGenericBase<Real> * fe_new =
676 const std::vector<std::vector<RealGradient> > & dphi = fe_new->get_dphi();
677 const std::vector<dof_id_type> & dof_indices =
680 const std::size_t n_dofs = dphi.size();
681 libmesh_assert_equal_to(n_dofs, dof_indices.size());
683 VectorValue<DynamicSparseNumberArray<Real, dof_id_type> > returnval;
685 for (
unsigned int d = 0; d != LIBMESH_DIM; ++d)
686 returnval(d).resize(n_dofs);
689 for (
int d = 0; d != LIBMESH_DIM; ++d)
691 returnval(d).raw_at(j) = dphi[j][0](d);
692 returnval(d).raw_index(j) = dof_indices[j];
References libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::index_range(), and libMesh::Real.
◆ eval_at_point() [3/3]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ eval_old_dofs() [1/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
Definition at line 541 of file system_projection.C.
548 LOG_SCOPE (
"eval_old_dofs(elem)",
"OldSolutionCoefs");
552 const Elem & old_elem =
554 *elem.parent() : elem;
561 std::vector<dof_id_type> old_dof_indices(nc);
571 const std::pair<unsigned int, unsigned int>
572 vg_and_offset = elem.var_to_vg_and_offset(sys_num,var_num);
573 const unsigned int vg = vg_and_offset.first;
574 const unsigned int vig = vg_and_offset.second;
576 const unsigned int n_comp = elem.n_comp_group(sys_num,vg);
577 libmesh_assert_greater(elem.n_systems(), sys_num);
578 libmesh_assert_greater_equal(n_comp, nc);
580 for (
unsigned int i=0; i<nc; i++)
583 old_elem.old_dof_object->dof_number(sys_num, vg, vig, i, n_comp);
585 elem.dof_number(sys_num, vg, vig, i, n_comp);
589 old_dof_indices[i] = d_old;
594 values.resize(old_dof_indices.size());
599 values[i].raw_at(0) = 1;
600 values[i].raw_index(0) = old_dof_indices[i];
References libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::index_range(), libMesh::libmesh_assert(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::old_dof_object, libMesh::Elem::parent(), libMesh::Elem::refinement_flag(), libMesh::Elem::type(), and libMesh::DofObject::var_to_vg_and_offset().
◆ eval_old_dofs() [2/2]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
Definition at line 514 of file system_projection.C.
520 LOG_SCOPE (
"eval_old_dofs(node)",
"OldSolutionCoefs");
524 std::vector<dof_id_type> old_indices;
528 libmesh_assert_equal_to (old_indices.size(), indices.size());
530 values.resize(old_indices.size());
535 values[i].raw_at(0) = 1;
536 values[i].raw_index(0) = old_indices[i];
References libMesh::index_range().
◆ get_shape_outputs() [1/5]
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ get_shape_outputs() [2/5]
◆ get_shape_outputs() [3/5]
◆ get_shape_outputs() [4/5]
◆ get_shape_outputs() [5/5]
◆ init_context()
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ is_grid_projection()
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ out_of_elem_tol() [1/4]
◆ out_of_elem_tol() [2/4]
◆ out_of_elem_tol() [3/4]
◆ out_of_elem_tol() [4/4]
◆ component_to_var
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ last_elem
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ old_context
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ out_of_elem_tol
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
◆ sys
template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
The documentation for this class was generated from the following file:
unsigned int n_vars() const
virtual bool close_to_point(const Point &p, Real tol) const
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
unsigned char get_elem_dim() const
const Elem & get_elem() const
Accessor for current Elem object.
unsigned int number() const
RefinementState
Enumeration of possible element refinement states.
void old_dof_indices(const Elem &elem, unsigned int n, std::vector< dof_id_type > &di, const unsigned int vn) const
Appends to the vector di the old global degree of freedom indices for elem.node_ref(n),...
static unsigned int n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)
bool has_elem() const
Test for current Elem object.
FEGenericBase< Real > FEBase
void check_old_context(const FEMContext &c)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
DSNA eval_at_point(const FEMContext &c, unsigned int i, const Point &p, Real=0.)
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh.
const Real out_of_elem_tol
void set_algebraic_type(const AlgebraicType atype)
Setting which determines whether to initialize algebraic structures (elem_*) on each element and set ...
const DofMap & get_dof_map() const
const std::set< unsigned char > & elem_dimensions() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static void get_shape_outputs(FEBase &fe)