libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
libMesh::OldSolutionCoefs< Output, point_output > Class Template Reference

The OldSolutionCoefs input functor class can be used with GenericProjector to read solution transfer coefficients on a just-refined-and-coarsened mesh. More...

Inheritance diagram for libMesh::OldSolutionCoefs< Output, point_output >:
[legend]

Public Types

typedef DSNAOutput< Output >::type DSNA
 
typedef DSNA ValuePushType
 
typedef DSNA FunctorValue
 
typedef TensorTools::MakeReal< Output >::type RealType
 

Public Member Functions

 OldSolutionCoefs (const libMesh::System &sys_in, const std::vector< unsigned int > *vars)
 
 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 time, bool skip_context_check)
 
void eval_mixed_derivatives (const FEMContext &libmesh_dbg_var(c), unsigned int i, unsigned int dim, const Node &n, std::vector< DSNA > &derivs)
 
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)
 
DynamicSparseNumberArray< Real, dof_id_typeeval_at_point (const FEMContext &c, unsigned int i, const Point &p, Real, bool skip_context_check)
 
VectorValue< DynamicSparseNumberArray< Real, dof_id_type > > eval_at_point (const FEMContext &c, unsigned int i, const Point &p, Real, bool skip_context_check)
 
DynamicSparseNumberArray< Real, dof_id_typeeval_at_node (const FEMContext &c, unsigned int i, unsigned int, const Node &n, bool extra_hanging_dofs, Real)
 
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)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void get_shape_outputs (FEAbstract &fe)
 
void init_context (FEMContext &c)
 
bool is_grid_projection ()
 

Static Public Member Functions

static void get_shape_outputs (FEAbstract &fe)
 

Protected Types

typedef TensorTools::MakeBaseNumber< Output >::type DofValueType
 

Protected Member Functions

void check_old_context (const FEMContext &c)
 
bool check_old_context (const FEMContext &c, const Point &p)
 

Protected Attributes

const Elemlast_elem
 
const Systemsys
 
FEMContext old_context
 
std::vector< unsigned intcomponent_to_var
 

Static Protected Attributes

static const Real out_of_elem_tol = 10 * TOLERANCE
 

Detailed Description

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 539 of file system_projection.C.

Member Typedef Documentation

◆ DofValueType

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
typedef TensorTools::MakeBaseNumber<Output>::type libMesh::OldSolutionBase< Output, point_output >::DofValueType
protectedinherited

Definition at line 540 of file generic_projector.h.

◆ DSNA

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
typedef DSNAOutput<Output>::type libMesh::OldSolutionCoefs< Output, point_output >::DSNA

Definition at line 542 of file system_projection.C.

◆ FunctorValue

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
typedef DSNA libMesh::OldSolutionCoefs< Output, point_output >::FunctorValue

Definition at line 544 of file system_projection.C.

◆ RealType

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
typedef TensorTools::MakeReal<Output>::type libMesh::OldSolutionBase< Output, point_output >::RealType
inherited

Definition at line 542 of file generic_projector.h.

◆ ValuePushType

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
typedef DSNA libMesh::OldSolutionCoefs< Output, point_output >::ValuePushType

Definition at line 543 of file system_projection.C.

Constructor & Destructor Documentation

◆ OldSolutionCoefs() [1/2]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
libMesh::OldSolutionCoefs< Output, point_output >::OldSolutionCoefs ( const libMesh::System sys_in,
const std::vector< unsigned int > *  vars 
)
inline

Definition at line 546 of file system_projection.C.

547 :
548 OldSolutionBase<Output, point_output>(sys_in, vars)
549 {
551 }
void set_algebraic_type(const AlgebraicType atype)
Setting which determines whether to initialize algebraic structures (elem_*) on each element and set ...

◆ OldSolutionCoefs() [2/2]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
libMesh::OldSolutionCoefs< Output, point_output >::OldSolutionCoefs ( const OldSolutionCoefs< Output, point_output > &  in)
inline

Definition at line 553 of file system_projection.C.

553 :
554 OldSolutionBase<Output, point_output>(in.sys, in.old_context.active_vars())
555 {
557 }

Member Function Documentation

◆ check_old_context() [1/2]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
void libMesh::OldSolutionBase< Output, point_output >::check_old_context ( const FEMContext c)
inlineprotectedinherited

Definition at line 609 of file generic_projector.h.

610 {
611 LOG_SCOPE ("check_old_context(c)", "OldSolutionBase");
612 const Elem & elem = c.get_elem();
613 if (last_elem != &elem)
614 {
615 if (elem.refinement_flag() == Elem::JUST_REFINED)
616 {
617 old_context.pre_fe_reinit(sys, elem.parent());
618 }
619 else if (elem.refinement_flag() == Elem::JUST_COARSENED)
620 {
621 libmesh_error();
622 }
623 else
624 {
625 if (!elem.get_old_dof_object())
626 {
627 libmesh_error();
628 }
629
631 }
632
633 last_elem = &elem;
634 }
635 else
636 {
638 }
639 }
@ JUST_COARSENED
Definition elem.h:1450
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
bool has_elem() const
Test for current Elem object.
libmesh_assert(ctx)

References libMesh::FEMContext::get_elem(), libMesh::DofObject::get_old_dof_object(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::parent(), and libMesh::Elem::refinement_flag().

◆ check_old_context() [2/2]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
bool libMesh::OldSolutionBase< Output, point_output >::check_old_context ( const FEMContext c,
const Point p 
)
inlineprotectedinherited

Definition at line 642 of file generic_projector.h.

643 {
644 LOG_SCOPE ("check_old_context(c,p)", "OldSolutionBase");
645 const Elem & elem = c.get_elem();
646 if (last_elem != &elem)
647 {
648 if (elem.refinement_flag() == Elem::JUST_REFINED)
649 {
650 old_context.pre_fe_reinit(sys, elem.parent());
651 }
652 else if (elem.refinement_flag() == Elem::JUST_COARSENED)
653 {
654 // Find the child with this point. Use out_of_elem_tol
655 // (in physical space, which may correspond to a large
656 // tolerance in master space!) to allow for out-of-element
657 // finite differencing of mixed gradient terms. Pray we
658 // have no quadrature locations which are within 1e-5 of
659 // the element subdivision boundary but are not exactly on
660 // that boundary.
661 const Real master_tol = out_of_elem_tol / elem.hmax() * 2;
662
663 for (auto & child : elem.child_ref_range())
664 if (child.close_to_point(p, master_tol))
665 {
667 break;
668 }
669
671 (old_context.get_elem().close_to_point(p, master_tol));
672 }
673 else
674 {
675 if (!elem.get_old_dof_object())
676 return false;
677
679 }
680
681 last_elem = &elem;
682 }
683 else
684 {
686
687 const Real master_tol = out_of_elem_tol / elem.hmax() * 2;
688
689 if (!old_context.get_elem().close_to_point(p, master_tol))
690 {
691 libmesh_assert_equal_to
692 (elem.refinement_flag(), Elem::JUST_COARSENED);
693
694 for (auto & child : elem.child_ref_range())
695 if (child.close_to_point(p, master_tol))
696 {
698 break;
699 }
700
702 (old_context.get_elem().close_to_point(p, master_tol));
703 }
704 }
705
706 return true;
707 }
virtual bool close_to_point(const Point &p, Real tol) const
Definition elem.C:2809
const Elem & get_elem() const
Accessor for current Elem object.
static const Real out_of_elem_tol
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

References libMesh::Elem::child_ref_range(), libMesh::FEMContext::get_elem(), libMesh::DofObject::get_old_dof_object(), libMesh::Elem::hmax(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::parent(), libMesh::Real, and libMesh::Elem::refinement_flag().

◆ eval_at_node() [1/3]

VectorValue< DynamicSparseNumberArray< Real, dof_id_type > > libMesh::OldSolutionCoefs< RealGradient,&FEMContext::point_gradient >::eval_at_node ( const FEMContext c,
unsigned int  i,
unsigned int  elem_dim,
const Node n,
bool  extra_hanging_dofs,
Real   
)
inline

Definition at line 858 of file system_projection.C.

865{
866 LOG_SCOPE ("RealGradient eval_at_node()", "OldSolutionCoefs");
867
868 // Optimize for the common case, where this node was part of the
869 // old solution.
870 //
871 // Be sure to handle cases where the variable wasn't defined on
872 // this node (due to changing subdomain support) or where the
873 // variable has no components on this node (due to Elem order
874 // exceeding FE order) or where the old_dof_object dofs might
875 // correspond to non-vertex dofs (due to extra_hanging_dofs and
876 // refinement)
877
878 const Elem::RefinementState flag = c.get_elem().refinement_flag();
879
880 const DofObject * old_dof_object = n.get_old_dof_object();
881 if (old_dof_object &&
882 (!extra_hanging_dofs ||
883 flag == Elem::JUST_COARSENED ||
884 flag == Elem::DO_NOTHING) &&
885 old_dof_object->n_vars(sys.number()) &&
886 old_dof_object->n_comp(sys.number(), i))
887 {
888 VectorValue<DynamicSparseNumberArray<Real, dof_id_type> > g;
889 for (unsigned int d = 0; d != elem_dim; ++d)
890 {
891 const dof_id_type old_id =
892 old_dof_object->dof_number(sys.number(), i, d+1);
893 g(d).resize(1);
894 g(d).raw_at(0) = 1;
895 g(d).raw_index(0) = old_id;
896 }
897 return g;
898 }
899
900 return this->eval_at_point(c, i, n, 0, false);
901}
RefinementState
Enumeration of possible element refinement states.
Definition elem.h:1446
DSNA eval_at_point(const FEMContext &c, unsigned int i, const Point &p, Real time, bool skip_context_check)
unsigned int number() const
Definition system.h:2393
uint8_t dof_id_type
Definition id_types.h:67

References libMesh::DofObject::dof_number(), libMesh::FEMContext::get_elem(), libMesh::DofObject::get_old_dof_object(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_vars(), 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>
DSNA libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node ( const FEMContext c,
unsigned int  i,
unsigned int  elem_dim,
const Node n,
bool  extra_hanging_dofs,
Real  = 0. 
)

◆ eval_at_node() [3/3]

DynamicSparseNumberArray< Real, dof_id_type > libMesh::OldSolutionCoefs< Real,&FEMContext::point_value >::eval_at_node ( const FEMContext c,
unsigned int  i,
unsigned int  ,
const Node n,
bool  extra_hanging_dofs,
Real   
)
inline

Definition at line 811 of file system_projection.C.

818{
819 LOG_SCOPE ("Real eval_at_node()", "OldSolutionCoefs");
820
821 // Optimize for the common case, where this node was part of the
822 // old solution.
823 //
824 // Be sure to handle cases where the variable wasn't defined on
825 // this node (due to changing subdomain support) or where the
826 // variable has no components on this node (due to Elem order
827 // exceeding FE order) or where the old_dof_object dofs might
828 // correspond to non-vertex dofs (due to extra_hanging_dofs and
829 // refinement)
830
831 const Elem::RefinementState flag = c.get_elem().refinement_flag();
832
833 const DofObject * old_dof_object = n.get_old_dof_object();
834 if (old_dof_object &&
835 (!extra_hanging_dofs ||
836 flag == Elem::JUST_COARSENED ||
837 flag == Elem::DO_NOTHING) &&
838 old_dof_object->n_vars(sys.number()) &&
839 old_dof_object->n_comp(sys.number(), i))
840 {
841 DynamicSparseNumberArray<Real, dof_id_type> returnval;
842 const dof_id_type old_id =
843 old_dof_object->dof_number(sys.number(), i, 0);
844 returnval.resize(1);
845 returnval.raw_at(0) = 1;
846 returnval.raw_index(0) = old_id;
847 return returnval;
848 }
849
850 return this->eval_at_point(c, i, n, 0, false);
851}

References libMesh::DofObject::dof_number(), libMesh::FEMContext::get_elem(), libMesh::DofObject::get_old_dof_object(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_vars(), and libMesh::Elem::refinement_flag().

◆ eval_at_point() [1/3]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
DSNA libMesh::OldSolutionCoefs< Output, point_output >::eval_at_point ( const FEMContext c,
unsigned int  i,
const Point p,
Real  time,
bool  skip_context_check 
)

◆ eval_at_point() [2/3]

DynamicSparseNumberArray< Real, dof_id_type > libMesh::OldSolutionCoefs< Real,&FEMContext::point_value >::eval_at_point ( const FEMContext c,
unsigned int  i,
const Point p,
Real  ,
bool  skip_context_check 
)
inline

Definition at line 715 of file system_projection.C.

721{
722 LOG_SCOPE ("eval_at_point()", "OldSolutionCoefs");
723
724 if (!skip_context_check)
725 if (!this->check_old_context(c, p))
726 return 0;
727
728 // Get finite element object
729 FEGenericBase<Real> * fe = nullptr;
731 (i, fe, this->old_context.get_elem_dim());
732
733 // Build a FE for calculating phi(p)
734 FEGenericBase<Real> * fe_new =
735 this->old_context.build_new_fe(fe, p);
736
737 // Get the values and global indices of the shape functions
738 const std::vector<std::vector<Real> > & phi = fe_new->get_phi();
739 const std::vector<dof_id_type> & dof_indices =
741
742 const std::size_t n_dofs = phi.size();
743 libmesh_assert_equal_to(n_dofs, dof_indices.size());
744
745 DynamicSparseNumberArray<Real, dof_id_type> returnval;
746 returnval.resize(n_dofs);
747
748 for (auto j : index_range(phi))
749 {
750 returnval.raw_at(j) = phi[j][0];
751 returnval.raw_index(j) = dof_indices[j];
752 }
753
754 return returnval;
755}
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 int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
unsigned char get_elem_dim() const
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.
void check_old_context(const FEMContext &c)
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition int_range.h:153
template class LIBMESH_EXPORT FEGenericBase< Real >
Definition fe_base.C:2589

References libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::index_range(), and libMesh::Real.

◆ eval_at_point() [3/3]

VectorValue< DynamicSparseNumberArray< Real, dof_id_type > > libMesh::OldSolutionCoefs< RealGradient,&FEMContext::point_gradient >::eval_at_point ( const FEMContext c,
unsigned int  i,
const Point p,
Real  ,
bool  skip_context_check 
)
inline

Definition at line 762 of file system_projection.C.

768{
769 LOG_SCOPE ("eval_at_point()", "OldSolutionCoefs");
770
771 if (!skip_context_check)
772 if (!this->check_old_context(c, p))
773 return 0;
774
775 // Get finite element object
776 FEGenericBase<Real> * fe = nullptr;
778 (i, fe, this->old_context.get_elem_dim());
779
780 // Build a FE for calculating phi(p)
781 FEGenericBase<Real> * fe_new =
782 this->old_context.build_new_fe(fe, p);
783
784 // Get the values and global indices of the shape functions
785 const std::vector<std::vector<RealGradient> > & dphi = fe_new->get_dphi();
786 const std::vector<dof_id_type> & dof_indices =
788
789 const std::size_t n_dofs = dphi.size();
790 libmesh_assert_equal_to(n_dofs, dof_indices.size());
791
792 VectorValue<DynamicSparseNumberArray<Real, dof_id_type> > returnval;
793
794 for (unsigned int d = 0; d != LIBMESH_DIM; ++d)
795 returnval(d).resize(n_dofs);
796
797 for (auto j : index_range(dphi))
798 for (int d = 0; d != LIBMESH_DIM; ++d)
799 {
800 returnval(d).raw_at(j) = dphi[j][0](d);
801 returnval(d).raw_index(j) = dof_indices[j];
802 }
803
804 return returnval;
805}
void ErrorVector unsigned int

References libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::index_range(), and libMesh::Real.

◆ eval_mixed_derivatives()

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
void libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives ( const FEMContext libmesh_dbg_varc,
unsigned int  i,
unsigned int  dim,
const Node n,
std::vector< DSNA > &  derivs 
)
inline

Definition at line 572 of file system_projection.C.

577 {
578 LOG_SCOPE ("eval_mixed_derivatives", "OldSolutionCoefs");
579
580 // This should only be called on vertices
581 libmesh_assert_less(c.get_elem().get_node_index(&n),
582 c.get_elem().n_vertices());
583
584 // Handle offset from non-scalar components in previous variables
585 libmesh_assert_less(i, this->component_to_var.size());
586 unsigned int var = this->component_to_var[i];
587
588 // We have 1 mixed derivative in 2D, 4 in 3D
589 const unsigned int n_mixed = (dim-1) * (dim-1);
590 derivs.resize(n_mixed);
591
592 // Be sure to handle cases where the variable wasn't defined on
593 // this node (e.g. due to changing subdomain support)
594 const DofObject * old_dof_object = n.get_old_dof_object();
595 if (old_dof_object &&
596 old_dof_object->n_vars(this->sys.number()) &&
597 old_dof_object->n_comp(this->sys.number(), var))
598 {
599 const dof_id_type first_old_id =
600 old_dof_object->dof_number(this->sys.number(), var, dim);
601 std::vector<dof_id_type> old_ids(n_mixed);
602 std::iota(old_ids.begin(), old_ids.end(), first_old_id);
603
604 for (auto d_i : index_range(derivs))
605 {
606 derivs[d_i].resize(1);
607 derivs[d_i].raw_at(0) = 1;
608 derivs[d_i].raw_index(0) = old_ids[d_i];
609 }
610 }
611 else
612 {
613 std::fill(derivs.begin(), derivs.end(), 0);
614 }
615 }
unsigned int dim
std::vector< unsigned int > component_to_var

References dim, libMesh::DofObject::dof_number(), libMesh::DofObject::get_old_dof_object(), libMesh::index_range(), libMesh::DofObject::n_comp(), and libMesh::DofObject::n_vars().

◆ eval_old_dofs() [1/2]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
void libMesh::OldSolutionCoefs< Output, point_output >::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 
)
inline

Definition at line 649 of file system_projection.C.

655 {
656 LOG_SCOPE ("eval_old_dofs(elem)", "OldSolutionCoefs");
657
658 // We're only to be asked for old dofs on elements that can copy
659 // them through DO_NOTHING or through refinement.
660 const Elem & old_elem =
661 (elem.refinement_flag() == Elem::JUST_REFINED) ?
662 *elem.parent() : elem;
663
664 // If there are any element-based DOF numbers, get them
665 const unsigned int nc =
666 FEInterface::n_dofs_per_elem(fe_type, &elem);
667
668 std::vector<dof_id_type> old_dof_indices(nc);
669 indices.resize(nc);
670
671 // We should never have fewer dofs than necessary on an
672 // element unless we're getting indices on a parent element,
673 // and we should never need those indices
674 if (nc != 0)
675 {
676 const DofObject & old_dof_object = old_elem.get_old_dof_object_ref();
677
678 const auto [vg, vig] =
679 elem.var_to_vg_and_offset(sys_num,var_num);
680
681 const unsigned int n_comp = elem.n_comp_group(sys_num,vg);
682 libmesh_assert_greater(elem.n_systems(), sys_num);
683 libmesh_assert_greater_equal(n_comp, nc);
684
685 for (unsigned int i=0; i<nc; i++)
686 {
687 const dof_id_type d_old =
688 old_dof_object.dof_number(sys_num, vg, vig, i, n_comp);
689 const dof_id_type d_new =
690 elem.dof_number(sys_num, vg, vig, i, n_comp);
691 libmesh_assert_not_equal_to (d_old, DofObject::invalid_id);
692 libmesh_assert_not_equal_to (d_new, DofObject::invalid_id);
693
694 old_dof_indices[i] = d_old;
695 indices[i] = d_new;
696 }
697 }
698
699 values.resize(old_dof_indices.size());
700
701 for (auto i : index_range(values))
702 {
703 values[i].resize(1);
704 values[i].raw_at(0) = 1;
705 values[i].raw_index(0) = old_dof_indices[i];
706 }
707 }
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition dof_object.h:473
static unsigned int n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)

References libMesh::DofObject::dof_number(), libMesh::DofObject::get_old_dof_object_ref(), libMesh::index_range(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::Elem::parent(), libMesh::Elem::refinement_flag(), 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>
void libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs ( const Elem elem,
unsigned int  node_num,
unsigned int  var_num,
std::vector< dof_id_type > &  indices,
std::vector< DSNA > &  values 
)
inline

Definition at line 618 of file system_projection.C.

623 {
624 LOG_SCOPE ("eval_old_dofs(node)", "OldSolutionCoefs");
625
626 // We may be reusing a std::vector here, but the following
627 // dof_indices call appends without first clearing.
628 indices.clear();
629
630 this->sys.get_dof_map().dof_indices(elem, node_num, indices, var_num);
631
632 std::vector<dof_id_type> old_indices;
633
634 this->sys.get_dof_map().old_dof_indices(elem, node_num, old_indices, var_num);
635
636 libmesh_assert_equal_to (old_indices.size(), indices.size());
637
638 values.resize(old_indices.size());
639
640 for (auto i : index_range(values))
641 {
642 values[i].resize(1);
643 values[i].raw_at(0) = 1;
644 values[i].raw_index(0) = old_indices[i];
645 }
646 }
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition dof_map.C:2201
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),...
Definition dof_map.C:2478
const DofMap & get_dof_map() const
Definition system.h:2417

References libMesh::index_range().

◆ get_shape_outputs() [1/9]

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
static void libMesh::OldSolutionBase< Output, point_output >::get_shape_outputs ( FEAbstract fe)
staticinherited

◆ get_shape_outputs() [2/9]

void libMesh::OldSolutionBase< Number,&FEMContext::point_value >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 957 of file generic_projector.h.

958{
959 fe.request_phi();
960}

References libMesh::FEAbstract::request_phi().

◆ get_shape_outputs() [3/9]

void libMesh::OldSolutionBase< Gradient,&FEMContext::point_gradient >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 965 of file generic_projector.h.

966{
967 fe.request_dphi();
968}

References libMesh::FEAbstract::request_dphi().

◆ get_shape_outputs() [4/9]

void libMesh::OldSolutionBase< Gradient,&FEMContext::point_value >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 972 of file generic_projector.h.

973{
974 fe.request_phi();
975}

References libMesh::FEAbstract::request_phi().

◆ get_shape_outputs() [5/9]

void libMesh::OldSolutionBase< Tensor,&FEMContext::point_gradient >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 980 of file generic_projector.h.

981{
982 fe.request_dphi();
983}

References libMesh::FEAbstract::request_dphi().

◆ get_shape_outputs() [6/9]

void libMesh::OldSolutionBase< Real,&FEMContext::point_value >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 989 of file generic_projector.h.

990{
991 fe.request_phi();
992}

References libMesh::FEAbstract::request_phi().

◆ get_shape_outputs() [7/9]

void libMesh::OldSolutionBase< RealGradient,&FEMContext::point_gradient >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 997 of file generic_projector.h.

998{
999 fe.request_dphi();
1000}

References libMesh::FEAbstract::request_dphi().

◆ get_shape_outputs() [8/9]

void libMesh::OldSolutionBase< RealGradient,&FEMContext::point_value >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 1004 of file generic_projector.h.

1005{
1006 fe.request_phi();
1007}

References libMesh::FEAbstract::request_phi().

◆ get_shape_outputs() [9/9]

void libMesh::OldSolutionBase< RealTensor,&FEMContext::point_gradient >::get_shape_outputs ( FEAbstract fe)
inlineinherited

Definition at line 1012 of file generic_projector.h.

1013{
1014 fe.request_dphi();
1015}

References libMesh::FEAbstract::request_dphi().

◆ init_context()

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
void libMesh::OldSolutionBase< Output, point_output >::init_context ( FEMContext c)
inlineinherited

Definition at line 580 of file generic_projector.h.

581 {
582 c.set_algebraic_type(FEMContext::DOFS_ONLY);
583
584 const std::set<unsigned char> & elem_dims =
586
587 // Loop over variables and dimensions, to prerequest
588 for (const auto & dim : elem_dims)
589 {
590 FEAbstract * fe = nullptr;
592 for (auto var : *old_context.active_vars())
593 {
596 }
597 else
598 for (auto var : make_range(sys.n_vars()))
599 {
602 }
603 }
604 }
unsigned int n_vars
const std::set< unsigned char > & elem_dimensions() const
const std::vector< unsigned int > * active_vars() const
Return a pointer to the vector of active variables being computed for, or a null pointer if all varia...
static void get_shape_outputs(FEAbstract &fe)
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176

References dim, libMesh::FEMContext::DOFS_ONLY, libMesh::make_range(), and libMesh::FEMContext::set_algebraic_type().

◆ is_grid_projection()

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
bool libMesh::OldSolutionBase< Output, point_output >::is_grid_projection ( )
inlineinherited

Definition at line 606 of file generic_projector.h.

606{ return true; }

Member Data Documentation

◆ component_to_var

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
std::vector<unsigned int> libMesh::OldSolutionBase< Output, point_output >::component_to_var
protectedinherited

Definition at line 713 of file generic_projector.h.

◆ last_elem

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
const Elem* libMesh::OldSolutionBase< Output, point_output >::last_elem
protectedinherited

Definition at line 710 of file generic_projector.h.

◆ old_context

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
FEMContext libMesh::OldSolutionBase< Output, point_output >::old_context
protectedinherited

Definition at line 712 of file generic_projector.h.

◆ out_of_elem_tol

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
const Real libMesh::OldSolutionBase< Output, point_output >::out_of_elem_tol = 10 * TOLERANCE
staticprotectedinherited

Definition at line 715 of file generic_projector.h.

◆ sys

template<typename Output , void(FEMContext::*)(unsigned int, const Point &, Output &, const Real) const point_output>
const System& libMesh::OldSolutionBase< Output, point_output >::sys
protectedinherited

Definition at line 711 of file generic_projector.h.


The documentation for this class was generated from the following file: