libMesh::MeshFunction Class Reference

#include <mesh_function.h>

Inheritance diagram for libMesh::MeshFunction:

Public Member Functions

 MeshFunction (const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const std::vector< unsigned int > &vars, const FunctionBase< Number > *master=libmesh_nullptr)
 
 MeshFunction (const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const unsigned int var, const FunctionBase< Number > *master=libmesh_nullptr)
 
 ~MeshFunction ()
 
virtual void init () libmesh_override
 
void init (const Trees::BuildType point_locator_build_type)
 
virtual void clear () libmesh_override
 
virtual UniquePtr< FunctionBase< Number > > clone () const libmesh_override
 
Number operator() (const Point &p, const Real time=0.) libmesh_override
 
std::map< const Elem *, Numberdiscontinuous_value (const Point &p, const Real time=0.)
 
Gradient gradient (const Point &p, const Real time=0.)
 
std::map< const Elem *, Gradientdiscontinuous_gradient (const Point &p, const Real time=0.)
 
Tensor hessian (const Point &p, const Real time=0.)
 
void operator() (const Point &p, const Real time, DenseVector< Number > &output) libmesh_override
 
void operator() (const Point &p, const Real time, DenseVector< Number > &output, const std::set< subdomain_id_type > *subdomain_ids)
 
void discontinuous_value (const Point &p, const Real time, std::map< const Elem *, DenseVector< Number > > &output)
 
void discontinuous_value (const Point &p, const Real time, std::map< const Elem *, DenseVector< Number > > &output, const std::set< subdomain_id_type > *subdomain_ids)
 
void gradient (const Point &p, const Real time, std::vector< Gradient > &output, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr)
 
void discontinuous_gradient (const Point &p, const Real time, std::map< const Elem *, std::vector< Gradient > > &output)
 
void discontinuous_gradient (const Point &p, const Real time, std::map< const Elem *, std::vector< Gradient > > &output, const std::set< subdomain_id_type > *subdomain_ids)
 
void hessian (const Point &p, const Real time, std::vector< Tensor > &output, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr)
 
const PointLocatorBaseget_point_locator (void) const
 
void enable_out_of_mesh_mode (const DenseVector< Number > &value)
 
void enable_out_of_mesh_mode (const Number &value)
 
void disable_out_of_mesh_mode (void)
 
void set_point_locator_tolerance (Real tol)
 
void unset_point_locator_tolerance ()
 
void operator() (const Point &p, DenseVector< Number > &output)
 
virtual Number component (unsigned int i, const Point &p, Real time=0.)
 
bool initialized () const
 
void set_is_time_dependent (bool is_time_dependent)
 
bool is_time_dependent () const
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Member Functions

const Elemfind_element (const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
 
std::set< const Elem * > find_elements (const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
 

Protected Attributes

const EquationSystems_eqn_systems
 
const NumericVector< Number > & _vector
 
const DofMap_dof_map
 
const std::vector< unsigned int > _system_vars
 
PointLocatorBase_point_locator
 
bool _out_of_mesh_mode
 
DenseVector< Number_out_of_mesh_value
 
const FunctionBase_master
 
bool _initialized
 
bool _is_time_dependent
 
const Parallel::Communicator_communicator
 

Detailed Description

This class provides function-like objects for data distributed over a mesh.

Author
Daniel Dreyer
Date
2003

Definition at line 53 of file mesh_function.h.

Constructor & Destructor Documentation

libMesh::MeshFunction::MeshFunction ( const EquationSystems eqn_systems,
const NumericVector< Number > &  vec,
const DofMap dof_map,
const std::vector< unsigned int > &  vars,
const FunctionBase< Number > *  master = libmesh_nullptr 
)

Constructor for mesh based functions with vectors as return value. Optionally takes a master function. If the MeshFunction is to be evaluated outside of the local partition of the mesh, then both the mesh in eqn_systems and the coefficient vector vec should be serialized.

Definition at line 43 of file mesh_function.C.

Referenced by clone().

47  :
48  FunctionBase<Number> (master),
49  ParallelObject (eqn_systems),
50  _eqn_systems (eqn_systems),
51  _vector (vec),
52  _dof_map (dof_map),
53  _system_vars (vars),
55  _out_of_mesh_mode (false),
57 {
58 }
ParallelObject(const Parallel::Communicator &comm_in)
const EquationSystems & _eqn_systems
const NumericVector< Number > & _vector
PointLocatorBase * _point_locator
const DofMap & _dof_map
const class libmesh_nullptr_t libmesh_nullptr
DenseVector< Number > _out_of_mesh_value
const std::vector< unsigned int > _system_vars
libMesh::MeshFunction::MeshFunction ( const EquationSystems eqn_systems,
const NumericVector< Number > &  vec,
const DofMap dof_map,
const unsigned int  var,
const FunctionBase< Number > *  master = libmesh_nullptr 
)

Constructor for mesh based functions with a number as return value. Optionally takes a master function. If the MeshFunction is to be evaluated outside of the local partition of the mesh, then both the mesh in eqn_systems and the coefficient vector vec should be serialized.

Definition at line 62 of file mesh_function.C.

66  :
67  FunctionBase<Number> (master),
68  ParallelObject (eqn_systems),
69  _eqn_systems (eqn_systems),
70  _vector (vec),
71  _dof_map (dof_map),
72  _system_vars (1,var),
74  _out_of_mesh_mode (false),
76 {
77  // std::vector<unsigned int> buf (1);
78  // buf[0] = var;
79  // _system_vars (buf);
80 }
ParallelObject(const Parallel::Communicator &comm_in)
const EquationSystems & _eqn_systems
const NumericVector< Number > & _vector
PointLocatorBase * _point_locator
const DofMap & _dof_map
const class libmesh_nullptr_t libmesh_nullptr
DenseVector< Number > _out_of_mesh_value
const std::vector< unsigned int > _system_vars
libMesh::MeshFunction::~MeshFunction ( )

Destructor.

Definition at line 88 of file mesh_function.C.

References libMesh::FunctionBase< Number >::_master, _point_locator, and libmesh_nullptr.

89 {
90  // only delete the point locator when we are the master
91  if (this->_master == libmesh_nullptr)
92  delete this->_point_locator;
93 }
PointLocatorBase * _point_locator
const FunctionBase * _master
const class libmesh_nullptr_t libmesh_nullptr

Member Function Documentation

void libMesh::MeshFunction::clear ( )
virtual

Clears the function.

Reimplemented from libMesh::FunctionBase< Number >.

Definition at line 154 of file mesh_function.C.

References libMesh::FunctionBase< Number >::_initialized, libMesh::FunctionBase< Number >::_master, _point_locator, and libmesh_nullptr.

Referenced by init().

155 {
156  // only delete the point locator when we are the master
157  if ((this->_point_locator != libmesh_nullptr) && (this->_master == libmesh_nullptr))
158  {
159  delete this->_point_locator;
161  }
162  this->_initialized = false;
163 }
PointLocatorBase * _point_locator
const FunctionBase * _master
const class libmesh_nullptr_t libmesh_nullptr
UniquePtr< FunctionBase< Number > > libMesh::MeshFunction::clone ( ) const
virtual
Returns
A new copy of the function.

The new copy uses the original as a master function to enable simultaneous evaluations of the copies in different threads.

Note
This implies the copy should not be used after the original is destroyed.

Implements libMesh::FunctionBase< Number >.

Definition at line 167 of file mesh_function.C.

References _dof_map, _eqn_systems, _system_vars, _vector, libMesh::FunctionBase< Output >::init(), libMesh::FunctionBase< Number >::initialized(), and MeshFunction().

Referenced by init().

168 {
169  FunctionBase<Number> * mf_clone =
171 
172  if (this->initialized())
173  mf_clone->init();
174 
175  return UniquePtr< FunctionBase<Number> >(mf_clone);
176 }
const EquationSystems & _eqn_systems
const NumericVector< Number > & _vector
const DofMap & _dof_map
MeshFunction(const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const std::vector< unsigned int > &vars, const FunctionBase< Number > *master=libmesh_nullptr)
Definition: mesh_function.C:43
const std::vector< unsigned int > _system_vars
const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 87 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_petsc_snes_jacobian(), libMesh::__libmesh_petsc_snes_postcheck(), libMesh::__libmesh_petsc_snes_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::ParmetisPartitioner::_do_repartition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), libMesh::ImplicitSystem::add_matrix(), libMesh::System::add_vector(), libMesh::EigenSparseLinearSolver< T >::adjoint_solve(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::DofMap::attach_matrix(), libMesh::Parallel::BinSorter< KeyType, IdxType >::binsort(), libMesh::Parallel::Sort< KeyType, IdxType >::binsort(), libMesh::MeshCommunication::broadcast(), libMesh::SparseMatrix< T >::build(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Parallel::Histogram< KeyType, IdxType >::build_histogram(), libMesh::PetscNonlinearSolver< T >::build_mat_null_space(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::DistributedVector< T >::clone(), libMesh::EigenSparseVector< T >::clone(), libMesh::LaspackVector< T >::clone(), libMesh::EpetraVector< T >::clone(), libMesh::PetscVector< T >::clone(), libMesh::EpetraVector< T >::close(), libMesh::Parallel::Sort< KeyType, IdxType >::communicate_bins(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::EpetraVector< T >::EpetraVector(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::EquationSystems::get_solution(), libMesh::LocationMap< T >::init(), libMesh::PetscDiffSolver::init(), libMesh::TimeSolver::init(), libMesh::TopologyMap::init(), libMesh::TaoOptimizationSolver< T >::init(), libMesh::PetscNonlinearSolver< T >::init(), libMesh::DistributedVector< T >::init(), libMesh::EpetraVector< T >::init(), libMesh::PetscVector< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::ParmetisPartitioner::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::DistributedVector< T >::max(), libMesh::FEMSystem::mesh_position_set(), libMesh::MeshSerializer::MeshSerializer(), libMesh::DistributedVector< T >::min(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::MetisPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::SparseMatrix< T >::print(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshRefinement::test_level_one(), libMesh::MeshRefinement::test_unflagged(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::DistributedVector< T >::zero_clone(), libMesh::EigenSparseVector< T >::zero_clone(), libMesh::LaspackVector< T >::zero_clone(), libMesh::EpetraVector< T >::zero_clone(), and libMesh::PetscVector< T >::zero_clone().

88  { return _communicator; }
const Parallel::Communicator & _communicator
virtual Number libMesh::FunctionBase< Number >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
virtualinherited
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
void libMesh::MeshFunction::disable_out_of_mesh_mode ( void  )

Disables out-of-mesh mode. This is also the default.

Definition at line 799 of file mesh_function.C.

References _out_of_mesh_mode, _point_locator, libMesh::PointLocatorBase::disable_out_of_mesh_mode(), libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by init().

800 {
801  libmesh_assert (this->initialized());
803  _out_of_mesh_mode = false;
804 }
virtual void disable_out_of_mesh_mode()=0
PointLocatorBase * _point_locator
libmesh_assert(j)
std::map< const Elem *, Gradient > libMesh::MeshFunction::discontinuous_gradient ( const Point p,
const Real  time = 0. 
)
Returns
A map of first derivatives (gradients) of variable 0 at point p and for time. map is from element to Gradient and accounts for double defined values on faces if the gradient is discontinuous

Definition at line 215 of file mesh_function.C.

References libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by discontinuous_gradient(), and init().

217 {
218  libmesh_assert (this->initialized());
219 
220  std::map<const Elem *, std::vector<Gradient> > buffer;
221  this->discontinuous_gradient (p, time, buffer);
222  std::map<const Elem *, Gradient> return_value;
223  for (std::map<const Elem *, std::vector<Gradient> >::const_iterator it = buffer.begin(); it != buffer.end(); ++it)
224  return_value[it->first] = it->second[0];
225  // NOTE: If no suitable element is found, then the map return_value is empty. This
226  // puts burden on the user of this function but I don't really see a better way.
227  return return_value;
228 }
libmesh_assert(j)
std::map< const Elem *, Gradient > discontinuous_gradient(const Point &p, const Real time=0.)
void libMesh::MeshFunction::discontinuous_gradient ( const Point p,
const Real  time,
std::map< const Elem *, std::vector< Gradient > > &  output 
)

Similar to gradient, but with the difference that multiple values on faces are explicitly permitted. This is useful for evaluating gradients on faces where the values to the left and right are different.

Definition at line 510 of file mesh_function.C.

References discontinuous_gradient(), and libmesh_nullptr.

513 {
514  this->discontinuous_gradient (p, time, output, libmesh_nullptr);
515 }
const class libmesh_nullptr_t libmesh_nullptr
std::map< const Elem *, Gradient > discontinuous_gradient(const Point &p, const Real time=0.)
void libMesh::MeshFunction::discontinuous_gradient ( const Point p,
const Real  time,
std::map< const Elem *, std::vector< Gradient > > &  output,
const std::set< subdomain_id_type > *  subdomain_ids 
)

Similar to gradient, but with the difference that multiple values on faces are explicitly permitted. This is useful for evaluating gradients on faces where the values to the left and right are different.

Definition at line 519 of file mesh_function.C.

References _dof_map, _out_of_mesh_mode, _out_of_mesh_value, _system_vars, libMesh::TypeVector< T >::add_scaled(), libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::dim(), libMesh::DofMap::dof_indices(), find_elements(), libMesh::FunctionBase< Number >::initialized(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::libmesh_assert(), libMesh::DenseVector< T >::size(), and libMesh::DofMap::variable_type().

523 {
524  libmesh_assert (this->initialized());
525 
526  // clear the output map
527  output.clear();
528 
529  // get the candidate elements
530  std::set<const Elem *> candidate_element = this->find_elements(p,subdomain_ids);
531 
532  // loop through all candidates, if the set is empty this function will return an
533  // empty map
534  for (std::set<const Elem *>::const_iterator it = candidate_element.begin(); it != candidate_element.end(); ++it)
535  {
536  const Elem * element = (*it);
537 
538  const unsigned int dim = element->dim();
539 
540  // define a temporary vector to store all values
541  std::vector<Gradient> temp_output (cast_int<unsigned int>(this->_system_vars.size()));
542 
543  /*
544  * Get local coordinates to feed these into compute_data().
545  * Note that the fe_type can safely be used from the 0-variable,
546  * since the inverse mapping is the same for all FEFamilies
547  */
548  const Point mapped_point (FEInterface::inverse_map (dim,
549  this->_dof_map.variable_type(0),
550  element,
551  p));
552 
553 
554  // loop over all vars
555  std::vector<Point> point_list (1, mapped_point);
556  for (std::size_t index = 0 ; index < this->_system_vars.size(); ++index)
557  {
558  /*
559  * the data for this variable
560  */
561  const unsigned int var = _system_vars[index];
562 
563  if (var == libMesh::invalid_uint)
564  {
566  index < _out_of_mesh_value.size());
567  temp_output[index] = Gradient(_out_of_mesh_value(index));
568  continue;
569  }
570 
571  const FEType & fe_type = this->_dof_map.variable_type(var);
572 
573  UniquePtr<FEBase> point_fe (FEBase::build(dim, fe_type));
574  const std::vector<std::vector<RealGradient> > & dphi = point_fe->get_dphi();
575  point_fe->reinit(element, &point_list);
576 
577  // where the solution values for the var-th variable are stored
578  std::vector<dof_id_type> dof_indices;
579  this->_dof_map.dof_indices (element, dof_indices, var);
580 
581  Gradient grad(0.);
582 
583  for (std::size_t i = 0; i < dof_indices.size(); ++i)
584  grad.add_scaled(dphi[i][0], this->_vector(dof_indices[i]));
585 
586  temp_output[index] = grad;
587 
588  // next variable
589  }
590 
591  // Insert temp_output into output
592  output[element] = temp_output;
593  }
594 }
const unsigned int invalid_uint
Definition: libmesh.h:184
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1686
const DofMap & _dof_map
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
NumberVectorValue Gradient
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
std::set< const Elem * > find_elements(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
const std::vector< unsigned int > _system_vars
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2005
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
std::map< const Elem *, Number > libMesh::MeshFunction::discontinuous_value ( const Point p,
const Real  time = 0. 
)
Returns
A map of values of variable 0 at point p and for time.

The std::map is from element to Number and accounts for doubly-defined values on faces if discontinuous variables are used.

Definition at line 190 of file mesh_function.C.

References libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by discontinuous_value(), and init().

192 {
193  libmesh_assert (this->initialized());
194 
195  std::map<const Elem *, DenseVector<Number> > buffer;
196  this->discontinuous_value (p, time, buffer);
197  std::map<const Elem *, Number> return_value;
198  for (std::map<const Elem *, DenseVector<Number> >::const_iterator it = buffer.begin(); it != buffer.end(); ++it)
199  return_value[it->first] = it->second(0);
200  // NOTE: If no suitable element is found, then the map return_value is empty. This
201  // puts burden on the user of this function but I don't really see a better way.
202  return return_value;
203 }
libmesh_assert(j)
std::map< const Elem *, Number > discontinuous_value(const Point &p, const Real time=0.)
void libMesh::MeshFunction::discontinuous_value ( const Point p,
const Real  time,
std::map< const Elem *, DenseVector< Number > > &  output 
)

Similar to operator() with the same parameter list, but with the difference that multiple values on faces are explicitly permitted. This is useful for discontinuous shape functions that are evaluated on faces.

Definition at line 338 of file mesh_function.C.

References discontinuous_value(), and libmesh_nullptr.

341 {
342  this->discontinuous_value (p, time, output, libmesh_nullptr);
343 }
const class libmesh_nullptr_t libmesh_nullptr
std::map< const Elem *, Number > discontinuous_value(const Point &p, const Real time=0.)
void libMesh::MeshFunction::discontinuous_value ( const Point p,
const Real  time,
std::map< const Elem *, DenseVector< Number > > &  output,
const std::set< subdomain_id_type > *  subdomain_ids 
)

Similar to operator() with the same parameter list, but with the difference that multiple values on faces are explicitly permitted. This is useful for discontinuous shape functions that are evaluated on faces.

Build an FEComputeData that contains both input and output data for the specific compute_data method.

Definition at line 347 of file mesh_function.C.

References _dof_map, _eqn_systems, _out_of_mesh_mode, _out_of_mesh_value, _system_vars, _vector, libMesh::FEInterface::compute_data(), data, libMesh::Elem::dim(), libMesh::DofMap::dof_indices(), find_elements(), libMesh::FunctionBase< Number >::initialized(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::libmesh_assert(), libMesh::FEComputeData::shape, libMesh::DenseVector< T >::size(), and libMesh::DofMap::variable_type().

351 {
352  libmesh_assert (this->initialized());
353 
354  // clear the output map
355  output.clear();
356 
357  // get the candidate elements
358  std::set<const Elem *> candidate_element = this->find_elements(p,subdomain_ids);
359 
360  // loop through all candidates, if the set is empty this function will return an
361  // empty map
362  for (std::set<const Elem *>::const_iterator it = candidate_element.begin(); it != candidate_element.end(); ++it)
363  {
364  const Elem * element = (*it);
365 
366  const unsigned int dim = element->dim();
367 
368  // define a temporary vector to store all values
369  DenseVector<Number> temp_output (cast_int<unsigned int>(this->_system_vars.size()));
370 
371  /*
372  * Get local coordinates to feed these into compute_data().
373  * Note that the fe_type can safely be used from the 0-variable,
374  * since the inverse mapping is the same for all FEFamilies
375  */
376  const Point mapped_point (FEInterface::inverse_map (dim,
377  this->_dof_map.variable_type(0),
378  element,
379  p));
380 
381 
382  // loop over all vars
383  for (std::size_t index=0; index < this->_system_vars.size(); index++)
384  {
385  /*
386  * the data for this variable
387  */
388  const unsigned int var = _system_vars[index];
389 
390  if (var == libMesh::invalid_uint)
391  {
393  index < _out_of_mesh_value.size());
394  temp_output(index) = _out_of_mesh_value(index);
395  continue;
396  }
397 
398  const FEType & fe_type = this->_dof_map.variable_type(var);
399 
404  {
405  FEComputeData data (this->_eqn_systems, mapped_point);
406 
407  FEInterface::compute_data (dim, fe_type, element, data);
408 
409  // where the solution values for the var-th variable are stored
410  std::vector<dof_id_type> dof_indices;
411  this->_dof_map.dof_indices (element, dof_indices, var);
412 
413  // interpolate the solution
414  {
415  Number value = 0.;
416 
417  for (std::size_t i=0; i<dof_indices.size(); i++)
418  value += this->_vector(dof_indices[i]) * data.shape[i];
419 
420  temp_output(index) = value;
421  }
422 
423  }
424 
425  // next variable
426  }
427 
428  // Insert temp_output into output
429  output[element] = temp_output;
430  }
431 }
const EquationSystems & _eqn_systems
const NumericVector< Number > & _vector
const unsigned int invalid_uint
Definition: libmesh.h:184
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1686
const DofMap & _dof_map
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
static void compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
Definition: fe_interface.C:808
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
std::set< const Elem * > find_elements(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
IterBase * data
const std::vector< unsigned int > _system_vars
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2005
void libMesh::MeshFunction::enable_out_of_mesh_mode ( const DenseVector< Number > &  value)

Enables out-of-mesh mode. In this mode, if asked for a point that is not contained in any element, the MeshFunction will return the given value instead of crashing. This mode is off per default. If you use a master mesh function and you want to enable this mode, you will have to enable it for the master mesh function as well and for all mesh functions that have the same master mesh function. You may, however, specify different values.

Definition at line 784 of file mesh_function.C.

References _out_of_mesh_mode, _out_of_mesh_value, _point_locator, libMesh::PointLocatorBase::enable_out_of_mesh_mode(), libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by enable_out_of_mesh_mode(), and init().

785 {
786  libmesh_assert (this->initialized());
788  _out_of_mesh_mode = true;
789  _out_of_mesh_value = value;
790 }
PointLocatorBase * _point_locator
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
virtual void enable_out_of_mesh_mode()=0
void libMesh::MeshFunction::enable_out_of_mesh_mode ( const Number value)

Enables out-of-mesh mode. In this mode, if asked for a point that is not contained in any element, the MeshFunction will return the given value instead of crashing. This mode is off per default. If you use a master mesh function and you want to enable this mode, you will have to enable it for the master mesh function as well and for all mesh functions that have the same master mesh function. You may, however, specify different values.

Definition at line 792 of file mesh_function.C.

References enable_out_of_mesh_mode().

793 {
794  DenseVector<Number> v(1);
795  v(0) = value;
796  this->enable_out_of_mesh_mode(v);
797 }
void enable_out_of_mesh_mode(const DenseVector< Number > &value)
const Elem * libMesh::MeshFunction::find_element ( const Point p,
const std::set< subdomain_id_type > *  subdomain_ids = libmesh_nullptr 
) const
protected

Helper function to reduce code duplication

Definition at line 674 of file mesh_function.C.

References libMesh::FunctionBase< Number >::_master, _out_of_mesh_mode, _point_locator, _vector, end, libMesh::Elem::find_point_neighbors(), libmesh_nullptr, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::SERIAL, and libMesh::NumericVector< T >::type().

Referenced by gradient(), hessian(), init(), and operator()().

676 {
677  /* Ensure that in the case of a master mesh function, the
678  out-of-mesh mode is enabled either for both or for none. This is
679  important because the out-of-mesh mode is also communicated to
680  the point locator. Since this is time consuming, enable it only
681  in debug mode. */
682 #ifdef DEBUG
683  if (this->_master != libmesh_nullptr)
684  {
685  const MeshFunction * master =
686  cast_ptr<const MeshFunction *>(this->_master);
687  if (_out_of_mesh_mode!=master->_out_of_mesh_mode)
688  libmesh_error_msg("ERROR: If you use out-of-mesh-mode in connection with master mesh " \
689  << "functions, you must enable out-of-mesh mode for both the master and the slave mesh function.");
690  }
691 #endif
692 
693  // locate the point in the other mesh
694  const Elem * element = this->_point_locator->operator()(p,subdomain_ids);
695 
696  // If we have an element, but it's not a local element, then we
697  // either need to have a serialized vector or we need to find a
698  // local element sharing the same point.
699  if (element &&
700  (element->processor_id() != this->processor_id()) &&
701  _vector.type() != SERIAL)
702  {
703  // look for a local element containing the point
704  std::set<const Elem *> point_neighbors;
705  element->find_point_neighbors(p, point_neighbors);
706  element = libmesh_nullptr;
707  std::set<const Elem *>::const_iterator it = point_neighbors.begin();
708  const std::set<const Elem *>::const_iterator end = point_neighbors.end();
709  for (; it != end; ++it)
710  {
711  const Elem * elem = *it;
712  if (elem->processor_id() == this->processor_id())
713  {
714  element = elem;
715  break;
716  }
717  }
718  }
719 
720  return element;
721 }
const NumericVector< Number > & _vector
PointLocatorBase * _point_locator
const FunctionBase * _master
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
ParallelType type() const
MeshFunction(const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const std::vector< unsigned int > &vars, const FunctionBase< Number > *master=libmesh_nullptr)
Definition: mesh_function.C:43
processor_id_type processor_id() const
std::set< const Elem * > libMesh::MeshFunction::find_elements ( const Point p,
const std::set< subdomain_id_type > *  subdomain_ids = libmesh_nullptr 
) const
protected
Returns
All elements that are close to a point p.

This is similar to find_element() but covers cases where p is on the boundary.

Definition at line 723 of file mesh_function.C.

References libMesh::FunctionBase< Number >::_master, _out_of_mesh_mode, _point_locator, _vector, end, libMesh::Elem::find_point_neighbors(), libmesh_nullptr, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::SERIAL, and libMesh::NumericVector< T >::type().

Referenced by discontinuous_gradient(), discontinuous_value(), and init().

725 {
726  /* Ensure that in the case of a master mesh function, the
727  out-of-mesh mode is enabled either for both or for none. This is
728  important because the out-of-mesh mode is also communicated to
729  the point locator. Since this is time consuming, enable it only
730  in debug mode. */
731 #ifdef DEBUG
732  if (this->_master != libmesh_nullptr)
733  {
734  const MeshFunction * master =
735  cast_ptr<const MeshFunction *>(this->_master);
736  if (_out_of_mesh_mode!=master->_out_of_mesh_mode)
737  libmesh_error_msg("ERROR: If you use out-of-mesh-mode in connection with master mesh " \
738  << "functions, you must enable out-of-mesh mode for both the master and the slave mesh function.");
739  }
740 #endif
741 
742  // locate the point in the other mesh
743  std::set<const Elem *> candidate_elements;
744  std::set<const Elem *> final_candidate_elements;
745  this->_point_locator->operator()(p,candidate_elements,subdomain_ids);
746  for (std::set<const Elem *>::const_iterator elem_it = candidate_elements.begin(); elem_it != candidate_elements.end(); ++elem_it)
747  {
748  const Elem * element = (*elem_it);
749  // If we have an element, but it's not a local element, then we
750  // either need to have a serialized vector or we need to find a
751  // local element sharing the same point.
752  if (element &&
753  (element->processor_id() != this->processor_id()) &&
754  _vector.type() != SERIAL)
755  {
756  // look for a local element containing the point
757  std::set<const Elem *> point_neighbors;
758  element->find_point_neighbors(p, point_neighbors);
759  std::set<const Elem *>::const_iterator it = point_neighbors.begin();
760  const std::set<const Elem *>::const_iterator end = point_neighbors.end();
761  for (; it != end; ++it)
762  {
763  const Elem * elem = *it;
764  if (elem->processor_id() == this->processor_id())
765  {
766  final_candidate_elements.insert(elem);
767  break;
768  }
769  }
770  }
771  else
772  final_candidate_elements.insert(element);
773  }
774 
775  return final_candidate_elements;
776 }
const NumericVector< Number > & _vector
PointLocatorBase * _point_locator
const FunctionBase * _master
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
ParallelType type() const
MeshFunction(const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const std::vector< unsigned int > &vars, const FunctionBase< Number > *master=libmesh_nullptr)
Definition: mesh_function.C:43
processor_id_type processor_id() const
const PointLocatorBase & libMesh::MeshFunction::get_point_locator ( void  ) const
Returns
The current PointLocator object, for use elsewhere.
Note
The MeshFunction object must be initialized before this is called.

Definition at line 778 of file mesh_function.C.

References _point_locator, libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by init().

779 {
780  libmesh_assert (this->initialized());
781  return *_point_locator;
782 }
PointLocatorBase * _point_locator
libmesh_assert(j)
Gradient libMesh::MeshFunction::gradient ( const Point p,
const Real  time = 0. 
)
Returns
The first derivatives of variable 0 at point p and for time, which defaults to zero.

Definition at line 205 of file mesh_function.C.

References libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by libMesh::ExactErrorEstimator::find_squared_element_error(), and init().

207 {
208  libmesh_assert (this->initialized());
209 
210  std::vector<Gradient> buf (1);
211  this->gradient(p, time, buf);
212  return buf[0];
213 }
Gradient gradient(const Point &p, const Real time=0.)
libmesh_assert(j)
void libMesh::MeshFunction::gradient ( const Point p,
const Real  time,
std::vector< Gradient > &  output,
const std::set< subdomain_id_type > *  subdomain_ids = libmesh_nullptr 
)

Computes gradients at coordinate p and for time time, which defaults to zero, optionally restricting the point to the passed subdomain_ids. This is useful in cases where there are multiple dimensioned elements, for example.

Definition at line 435 of file mesh_function.C.

References _dof_map, _out_of_mesh_mode, _out_of_mesh_value, _system_vars, libMesh::TypeVector< T >::add_scaled(), libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::dim(), libMesh::DofMap::dof_indices(), find_element(), libMesh::FunctionBase< Number >::initialized(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::libmesh_assert(), libMesh::DenseVector< T >::size(), and libMesh::DofMap::variable_type().

439 {
440  libmesh_assert (this->initialized());
441 
442  const Elem * element = this->find_element(p,subdomain_ids);
443 
444  if (!element)
445  {
446  output.resize(0);
447  }
448  else
449  {
450  // resize the output vector to the number of output values
451  // that the user told us
452  output.resize (this->_system_vars.size());
453 
454 
455  {
456  const unsigned int dim = element->dim();
457 
458 
459  /*
460  * Get local coordinates to feed these into compute_data().
461  * Note that the fe_type can safely be used from the 0-variable,
462  * since the inverse mapping is the same for all FEFamilies
463  */
464  const Point mapped_point (FEInterface::inverse_map (dim,
465  this->_dof_map.variable_type(0),
466  element,
467  p));
468 
469  std::vector<Point> point_list (1, mapped_point);
470 
471  // loop over all vars
472  for (std::size_t index=0; index < this->_system_vars.size(); index++)
473  {
474  /*
475  * the data for this variable
476  */
477  const unsigned int var = _system_vars[index];
478 
479  if (var == libMesh::invalid_uint)
480  {
482  index < _out_of_mesh_value.size());
483  output[index] = Gradient(_out_of_mesh_value(index));
484  continue;
485  }
486 
487  const FEType & fe_type = this->_dof_map.variable_type(var);
488 
489  UniquePtr<FEBase> point_fe (FEBase::build(dim, fe_type));
490  const std::vector<std::vector<RealGradient> > & dphi = point_fe->get_dphi();
491  point_fe->reinit(element, &point_list);
492 
493  // where the solution values for the var-th variable are stored
494  std::vector<dof_id_type> dof_indices;
495  this->_dof_map.dof_indices (element, dof_indices, var);
496 
497  // interpolate the solution
498  Gradient grad(0.);
499 
500  for (std::size_t i=0; i<dof_indices.size(); i++)
501  grad.add_scaled(dphi[i][0], this->_vector(dof_indices[i]));
502 
503  output[index] = grad;
504  }
505  }
506  }
507 }
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
const unsigned int invalid_uint
Definition: libmesh.h:184
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1686
const DofMap & _dof_map
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
NumberVectorValue Gradient
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
const std::vector< unsigned int > _system_vars
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2005
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Tensor libMesh::MeshFunction::hessian ( const Point p,
const Real  time = 0. 
)
Returns
The second derivatives of variable 0 at point p and for time, which defaults to zero.

Definition at line 231 of file mesh_function.C.

References libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by libMesh::ExactErrorEstimator::find_squared_element_error(), and init().

233 {
234  libmesh_assert (this->initialized());
235 
236  std::vector<Tensor> buf (1);
237  this->hessian(p, time, buf);
238  return buf[0];
239 }
libmesh_assert(j)
Tensor hessian(const Point &p, const Real time=0.)
void libMesh::MeshFunction::hessian ( const Point p,
const Real  time,
std::vector< Tensor > &  output,
const std::set< subdomain_id_type > *  subdomain_ids = libmesh_nullptr 
)

Computes gradients at coordinate p and for time time, which defaults to zero, optionally restricting the point to the passed subdomain_ids. This is useful in cases where there are multiple dimensioned elements, for example.

Definition at line 599 of file mesh_function.C.

References _dof_map, _out_of_mesh_mode, _out_of_mesh_value, _system_vars, libMesh::TypeTensor< T >::add_scaled(), libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::dim(), libMesh::DofMap::dof_indices(), find_element(), libMesh::FunctionBase< Number >::initialized(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::libmesh_assert(), libMesh::DenseVector< T >::size(), and libMesh::DofMap::variable_type().

603 {
604  libmesh_assert (this->initialized());
605 
606  const Elem * element = this->find_element(p,subdomain_ids);
607 
608  if (!element)
609  {
610  output.resize(0);
611  }
612  else
613  {
614  // resize the output vector to the number of output values
615  // that the user told us
616  output.resize (this->_system_vars.size());
617 
618 
619  {
620  const unsigned int dim = element->dim();
621 
622 
623  /*
624  * Get local coordinates to feed these into compute_data().
625  * Note that the fe_type can safely be used from the 0-variable,
626  * since the inverse mapping is the same for all FEFamilies
627  */
628  const Point mapped_point (FEInterface::inverse_map (dim,
629  this->_dof_map.variable_type(0),
630  element,
631  p));
632 
633  std::vector<Point> point_list (1, mapped_point);
634 
635  // loop over all vars
636  for (std::size_t index=0; index < this->_system_vars.size(); index++)
637  {
638  /*
639  * the data for this variable
640  */
641  const unsigned int var = _system_vars[index];
642 
643  if (var == libMesh::invalid_uint)
644  {
646  index < _out_of_mesh_value.size());
647  output[index] = Tensor(_out_of_mesh_value(index));
648  continue;
649  }
650  const FEType & fe_type = this->_dof_map.variable_type(var);
651 
652  UniquePtr<FEBase> point_fe (FEBase::build(dim, fe_type));
653  const std::vector<std::vector<RealTensor> > & d2phi =
654  point_fe->get_d2phi();
655  point_fe->reinit(element, &point_list);
656 
657  // where the solution values for the var-th variable are stored
658  std::vector<dof_id_type> dof_indices;
659  this->_dof_map.dof_indices (element, dof_indices, var);
660 
661  // interpolate the solution
662  Tensor hess;
663 
664  for (std::size_t i=0; i<dof_indices.size(); i++)
665  hess.add_scaled(d2phi[i][0], this->_vector(dof_indices[i]));
666 
667  output[index] = hess;
668  }
669  }
670  }
671 }
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
const unsigned int invalid_uint
Definition: libmesh.h:184
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1686
void add_scaled(const TypeTensor< T2 > &, const T)
Definition: type_tensor.h:773
const DofMap & _dof_map
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
NumberTensorValue Tensor
const std::vector< unsigned int > _system_vars
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2005
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
virtual void libMesh::MeshFunction::init ( )
inlinevirtual

Override the FunctionBase::init() member function by calling our own and specifying the Trees::NODES method. specifies the method to use when building a PointLocator

Reimplemented from libMesh::FunctionBase< Number >.

Definition at line 96 of file mesh_function.h.

References clear(), clone(), disable_out_of_mesh_mode(), discontinuous_gradient(), discontinuous_value(), enable_out_of_mesh_mode(), find_element(), find_elements(), get_point_locator(), gradient(), hessian(), init(), libmesh_nullptr, libMesh::Trees::NODES, operator()(), libMesh::Real, set_point_locator_tolerance(), and unset_point_locator_tolerance().

Referenced by init().

96 { this->init(Trees::NODES); }
virtual void init() libmesh_override
Definition: mesh_function.h:96
void libMesh::MeshFunction::init ( const Trees::BuildType  point_locator_build_type)

The actual initialization process. Takes an optional argument which specifies the method to use when building a PointLocator

Definition at line 98 of file mesh_function.C.

References _eqn_systems, libMesh::FunctionBase< Number >::_initialized, libMesh::FunctionBase< Number >::_master, _point_locator, _system_vars, libMesh::EquationSystems::get_mesh(), libMesh::libmesh_assert(), libmesh_nullptr, mesh, and libMesh::MeshBase::sub_point_locator().

99 {
100  // are indices of the desired variable(s) provided?
101  libmesh_assert_greater (this->_system_vars.size(), 0);
102 
103  // Don't do twice...
104  if (this->_initialized)
105  {
107  return;
108  }
109 
110  /*
111  * set up the PointLocator: either someone else
112  * is the master (go and get the address of his
113  * point locator) or this object is the master
114  * (build the point locator on our own).
115  */
116  if (this->_master != libmesh_nullptr)
117  {
118  // we aren't the master
119  const MeshFunction * master =
120  cast_ptr<const MeshFunction *>(this->_master);
121 
122  if (master->_point_locator == libmesh_nullptr)
123  libmesh_error_msg("ERROR: When the master-servant concept is used, the master has to be initialized first!");
124 
125  else
126  {
127  this->_point_locator = master->_point_locator;
128  }
129  }
130  else
131  {
132  // we are the master: build the point locator
133 
134  // constant reference to the other mesh
135  const MeshBase & mesh = this->_eqn_systems.get_mesh();
136 
137  // build the point locator. Only \p TREE version available
138  //UniquePtr<PointLocatorBase> ap (PointLocatorBase::build (TREE, mesh));
139  //this->_point_locator = ap.release();
140  // this->_point_locator = new PointLocatorTree (mesh, point_locator_build_type);
141  this->_point_locator = mesh.sub_point_locator().release();
142 
143  // Point locator no longer needs to be initialized.
144  // this->_point_locator->init();
145  }
146 
147 
148  // ready for use
149  this->_initialized = true;
150 }
const EquationSystems & _eqn_systems
PointLocatorBase * _point_locator
MeshBase & mesh
const FunctionBase * _master
const class libmesh_nullptr_t libmesh_nullptr
libmesh_assert(j)
const MeshBase & get_mesh() const
MeshFunction(const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, const std::vector< unsigned int > &vars, const FunctionBase< Number > *master=libmesh_nullptr)
Definition: mesh_function.C:43
const std::vector< unsigned int > _system_vars
bool libMesh::FunctionBase< Number >::initialized ( ) const
inherited
Returns
true when this object is properly initialized and ready for use, false otherwise.

Referenced by clone(), disable_out_of_mesh_mode(), discontinuous_gradient(), discontinuous_value(), enable_out_of_mesh_mode(), get_point_locator(), gradient(), hessian(), and operator()().

bool libMesh::FunctionBase< Number >::is_time_dependent ( ) const
inherited
Returns
true when the function this object represents is actually time-dependent, false otherwise.
processor_id_type libMesh::ParallelObject::n_processors ( ) const
inlineinherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::ParmetisPartitioner::_do_repartition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::MeshCommunication::broadcast(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshBase::get_info(), libMesh::EquationSystems::get_solution(), libMesh::DistributedVector< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

94  { return cast_int<processor_id_type>(_communicator.size()); }
unsigned int size() const
Definition: parallel.h:722
const Parallel::Communicator & _communicator
void libMesh::FunctionBase< Number >::operator() ( const Point p,
DenseVector< Number > &  output 
)
inherited

Evaluation function for time-independent vector-valued functions. Sets output values in the passed-in output DenseVector.

Number libMesh::MeshFunction::operator() ( const Point p,
const Real  time = 0. 
)
virtual
Returns
The value of variable 0 at point p and for time, which defaults to zero.

Implements libMesh::FunctionBase< Number >.

Definition at line 180 of file mesh_function.C.

References libMesh::FunctionBase< Number >::initialized(), and libMesh::libmesh_assert().

Referenced by init(), and operator()().

182 {
183  libmesh_assert (this->initialized());
184 
185  DenseVector<Number> buf (1);
186  this->operator() (p, time, buf);
187  return buf(0);
188 }
Number operator()(const Point &p, const Real time=0.) libmesh_override
libmesh_assert(j)
void libMesh::MeshFunction::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  output 
)
virtual

Computes values at coordinate p and for time time, which defaults to zero, optionally restricting the point to the passed subdomain_ids. This is useful in cases where there are multiple dimensioned elements, for example.

Implements libMesh::FunctionBase< Number >.

Definition at line 242 of file mesh_function.C.

References libmesh_nullptr, and operator()().

245 {
246  this->operator() (p, time, output, libmesh_nullptr);
247 }
const class libmesh_nullptr_t libmesh_nullptr
Number operator()(const Point &p, const Real time=0.) libmesh_override
void libMesh::MeshFunction::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  output,
const std::set< subdomain_id_type > *  subdomain_ids 
)

Computes values at coordinate p and for time time, restricting the point to the passed subdomain_ids. This is useful in cases where there are multiple dimensioned elements, for example.

Build an FEComputeData that contains both input and output data for the specific compute_data method.

Definition at line 249 of file mesh_function.C.

References _dof_map, _eqn_systems, _out_of_mesh_mode, _out_of_mesh_value, _system_vars, _vector, libMesh::FEInterface::compute_data(), data, libMesh::Elem::dim(), libMesh::DofMap::dof_indices(), find_element(), libMesh::FunctionBase< Number >::initialized(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::libmesh_assert(), libMesh::DenseVector< T >::resize(), libMesh::FEComputeData::shape, libMesh::DenseVector< T >::size(), and libMesh::DofMap::variable_type().

253 {
254  libmesh_assert (this->initialized());
255 
256  const Elem * element = this->find_element(p,subdomain_ids);
257 
258  if (!element)
259  {
260  // We'd better be in out_of_mesh_mode if we couldn't find an
261  // element in the mesh
263  output = _out_of_mesh_value;
264  }
265  else
266  {
267  // resize the output vector to the number of output values
268  // that the user told us
269  output.resize (cast_int<unsigned int>
270  (this->_system_vars.size()));
271 
272 
273  {
274  const unsigned int dim = element->dim();
275 
276 
277  /*
278  * Get local coordinates to feed these into compute_data().
279  * Note that the fe_type can safely be used from the 0-variable,
280  * since the inverse mapping is the same for all FEFamilies
281  */
282  const Point mapped_point (FEInterface::inverse_map (dim,
283  this->_dof_map.variable_type(0),
284  element,
285  p));
286 
287 
288  // loop over all vars
289  for (std::size_t index=0; index < this->_system_vars.size(); index++)
290  {
291  /*
292  * the data for this variable
293  */
294  const unsigned int var = _system_vars[index];
295 
296  if (var == libMesh::invalid_uint)
297  {
299  index < _out_of_mesh_value.size());
300  output(index) = _out_of_mesh_value(index);
301  continue;
302  }
303 
304  const FEType & fe_type = this->_dof_map.variable_type(var);
305 
310  {
311  FEComputeData data (this->_eqn_systems, mapped_point);
312 
313  FEInterface::compute_data (dim, fe_type, element, data);
314 
315  // where the solution values for the var-th variable are stored
316  std::vector<dof_id_type> dof_indices;
317  this->_dof_map.dof_indices (element, dof_indices, var);
318 
319  // interpolate the solution
320  {
321  Number value = 0.;
322 
323  for (std::size_t i=0; i<dof_indices.size(); i++)
324  value += this->_vector(dof_indices[i]) * data.shape[i];
325 
326  output(index) = value;
327  }
328 
329  }
330 
331  // next variable
332  }
333  }
334  }
335 }
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=libmesh_nullptr) const
const EquationSystems & _eqn_systems
const NumericVector< Number > & _vector
const unsigned int invalid_uint
Definition: libmesh.h:184
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1686
const DofMap & _dof_map
void resize(const unsigned int n)
Definition: dense_vector.h:350
virtual unsigned int size() const libmesh_override
Definition: dense_vector.h:87
libmesh_assert(j)
DenseVector< Number > _out_of_mesh_value
static void compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
Definition: fe_interface.C:808
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
IterBase * data
const std::vector< unsigned int > _system_vars
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2005
processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 99 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshCommunication::broadcast(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DofMap::build_sparsity(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), find_element(), find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::EquationSystems::get_solution(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::DistributedVector< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MetisPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NumericVector< T >::print_global(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::CheckpointIO::read_header(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::MeshTools::weight(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), and libMesh::ExodusII_IO_Helper::write_timestep().

100  { return cast_int<processor_id_type>(_communicator.rank()); }
const Parallel::Communicator & _communicator
unsigned int rank() const
Definition: parallel.h:720
void libMesh::FunctionBase< Number >::set_is_time_dependent ( bool  is_time_dependent)
inherited

Function to set whether this is a time-dependent function or not. This is intended to be only used by subclasses who cannot natively determine time-dependence. In such a case, this function should be used immediately following construction.

void libMesh::MeshFunction::set_point_locator_tolerance ( Real  tol)

We may want to specify a tolerance for the PointLocator to use, since in some cases the point we want to evaluate at might be slightly outside the mesh (due to numerical rounding issues, for example).

Definition at line 806 of file mesh_function.C.

References _point_locator, and libMesh::PointLocatorBase::set_close_to_point_tol().

Referenced by init().

807 {
809 }
virtual void set_close_to_point_tol(Real close_to_point_tol)
PointLocatorBase * _point_locator
void libMesh::MeshFunction::unset_point_locator_tolerance ( )

Turn off the user-specified PointLocator tolerance.

Definition at line 811 of file mesh_function.C.

References _point_locator, and libMesh::PointLocatorBase::unset_close_to_point_tol().

Referenced by init().

812 {
814 }
PointLocatorBase * _point_locator
virtual void unset_close_to_point_tol()

Member Data Documentation

const DofMap& libMesh::MeshFunction::_dof_map
protected

Need access to the DofMap of the other system.

Definition at line 325 of file mesh_function.h.

Referenced by clone(), discontinuous_gradient(), discontinuous_value(), gradient(), hessian(), and operator()().

const EquationSystems& libMesh::MeshFunction::_eqn_systems
protected

The equation systems handler, from which the data are gathered.

Definition at line 314 of file mesh_function.h.

Referenced by clone(), discontinuous_value(), init(), and operator()().

bool libMesh::FunctionBase< Number >::_initialized
protectedinherited

When init() was called so that everything is ready for calls to operator() (...), then this bool is true.

Definition at line 174 of file function_base.h.

Referenced by clear(), and init().

bool libMesh::FunctionBase< Number >::_is_time_dependent
protectedinherited

Cache whether or not this function is actually time-dependent.

Definition at line 179 of file function_base.h.

const FunctionBase* libMesh::FunctionBase< Number >::_master
protectedinherited

Const pointer to our master, initialized to NULL. There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.

Definition at line 168 of file function_base.h.

Referenced by clear(), find_element(), find_elements(), init(), and ~MeshFunction().

bool libMesh::MeshFunction::_out_of_mesh_mode
protected

true if out-of-mesh mode is enabled. See enable_out_of_mesh_mode() for more details. Default is false.

Definition at line 343 of file mesh_function.h.

Referenced by disable_out_of_mesh_mode(), discontinuous_gradient(), discontinuous_value(), enable_out_of_mesh_mode(), find_element(), find_elements(), gradient(), hessian(), and operator()().

DenseVector<Number> libMesh::MeshFunction::_out_of_mesh_value
protected

Value to return outside the mesh if out-of-mesh mode is enabled. See enable_out_of_mesh_mode() for more details.

Definition at line 349 of file mesh_function.h.

Referenced by discontinuous_gradient(), discontinuous_value(), enable_out_of_mesh_mode(), gradient(), hessian(), and operator()().

PointLocatorBase* libMesh::MeshFunction::_point_locator
protected
const std::vector<unsigned int> libMesh::MeshFunction::_system_vars
protected

The indices of the variables within the other system for which data are to be gathered.

Definition at line 331 of file mesh_function.h.

Referenced by clone(), discontinuous_gradient(), discontinuous_value(), gradient(), hessian(), init(), and operator()().

const NumericVector<Number>& libMesh::MeshFunction::_vector
protected

A reference to the vector that holds the data that is to be interpolated.

Definition at line 320 of file mesh_function.h.

Referenced by clone(), discontinuous_value(), find_element(), find_elements(), and operator()().


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