www.mooseframework.org
Public Types | Public Member Functions | Protected Attributes | List of all members
libMesh::DTKInterpolationEvaluator Class Reference

A class for performing interplation transfers via DTK. More...

#include <DTKInterpolationEvaluator.h>

Inheritance diagram for libMesh::DTKInterpolationEvaluator:
[legend]

Public Types

typedef DataTransferKit::MeshContainer< long unsigned int > MeshContainerType
 
typedef DataTransferKit::FieldContainer< Number > FieldContainerType
 
typedef DataTransferKit::MeshTraits< MeshContainerType >::global_ordinal_type GlobalOrdinal
 

Public Member Functions

 DTKInterpolationEvaluator (System &in_sys, std::string var_name, const Point &offset)
 
FieldContainerType evaluate (const Teuchos::ArrayRCP< GlobalOrdinal > &elements, const Teuchos::ArrayRCP< double > &coords)
 

Protected Attributes

System & sys
 
Point _offset
 
NumericVector< Number > & current_local_solution
 
EquationSystems & es
 
MeshBase & mesh
 
unsigned int dim
 
DofMap & dof_map
 
unsigned int var_num
 
const FEType & fe_type
 

Detailed Description

A class for performing interplation transfers via DTK.

Definition at line 52 of file DTKInterpolationEvaluator.h.

Member Typedef Documentation

typedef DataTransferKit::FieldContainer<Number> libMesh::DTKInterpolationEvaluator::FieldContainerType

Definition at line 58 of file DTKInterpolationEvaluator.h.

typedef DataTransferKit::MeshTraits<MeshContainerType>::global_ordinal_type libMesh::DTKInterpolationEvaluator::GlobalOrdinal

Definition at line 59 of file DTKInterpolationEvaluator.h.

typedef DataTransferKit::MeshContainer<long unsigned int> libMesh::DTKInterpolationEvaluator::MeshContainerType

Definition at line 57 of file DTKInterpolationEvaluator.h.

Constructor & Destructor Documentation

libMesh::DTKInterpolationEvaluator::DTKInterpolationEvaluator ( System &  in_sys,
std::string  var_name,
const Point &  offset 
)

Definition at line 33 of file DTKInterpolationEvaluator.C.

36  : sys(in_sys),
37  _offset(offset),
38  current_local_solution(*sys.current_local_solution),
39  es(in_sys.get_equation_systems()),
40  mesh(sys.get_mesh()),
41  dim(mesh.mesh_dimension()),
42  dof_map(sys.get_dof_map()),
43  var_num(sys.variable_number(var_name)),
44  fe_type(dof_map.variable_type(var_num))
45 {
46 }
NumericVector< Number > & current_local_solution

Member Function Documentation

DTKInterpolationEvaluator::FieldContainerType libMesh::DTKInterpolationEvaluator::evaluate ( const Teuchos::ArrayRCP< GlobalOrdinal > &  elements,
const Teuchos::ArrayRCP< double > &  coords 
)

Definition at line 49 of file DTKInterpolationEvaluator.C.

51 {
52  GlobalOrdinal num_values = elements.size();
53 
54  Teuchos::ArrayRCP<Number> values(num_values);
55  DataTransferKit::FieldContainer<Number> evaluations(values, 1);
56 
57  for (GlobalOrdinal i = 0; i < num_values; i++)
58  {
59  Elem * elem = mesh.elem(elements[i]);
60 
61  Point p;
62 
63  for (unsigned int j = 0; j < dim; j++)
64  p(j) = coords[(j * num_values) + i] - _offset(j);
65 
66  const Point mapped_point(FEInterface::inverse_map(dim, dof_map.variable_type(0), elem, p));
67 
68  FEComputeData data(es, mapped_point);
69  FEInterface::compute_data(dim, fe_type, elem, data);
70 
71  std::vector<dof_id_type> dof_indices;
72  dof_map.dof_indices(elem, dof_indices, var_num);
73 
74  Number value = 0;
75 
76  for (unsigned int j = 0; j < dof_indices.size(); j++)
77  value += current_local_solution(dof_indices[j]) * data.shape[j];
78 
79  values[i] = value;
80  }
81 
82  return evaluations;
83 }
NumericVector< Number > & current_local_solution
DataTransferKit::MeshTraits< MeshContainerType >::global_ordinal_type GlobalOrdinal

Member Data Documentation

Point libMesh::DTKInterpolationEvaluator::_offset
protected

Definition at line 68 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

NumericVector<Number>& libMesh::DTKInterpolationEvaluator::current_local_solution
protected

Definition at line 69 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

unsigned int libMesh::DTKInterpolationEvaluator::dim
protected

Definition at line 72 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

DofMap& libMesh::DTKInterpolationEvaluator::dof_map
protected

Definition at line 73 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

EquationSystems& libMesh::DTKInterpolationEvaluator::es
protected

Definition at line 70 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

const FEType& libMesh::DTKInterpolationEvaluator::fe_type
protected

Definition at line 75 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

MeshBase& libMesh::DTKInterpolationEvaluator::mesh
protected

Definition at line 71 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

System& libMesh::DTKInterpolationEvaluator::sys
protected

Definition at line 67 of file DTKInterpolationEvaluator.h.

unsigned int libMesh::DTKInterpolationEvaluator::var_num
protected

Definition at line 74 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().


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