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 48 of file DTKInterpolationEvaluator.h.

Member Typedef Documentation

◆ FieldContainerType

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

Definition at line 54 of file DTKInterpolationEvaluator.h.

◆ GlobalOrdinal

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

Definition at line 55 of file DTKInterpolationEvaluator.h.

◆ MeshContainerType

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

Definition at line 53 of file DTKInterpolationEvaluator.h.

Constructor & Destructor Documentation

◆ DTKInterpolationEvaluator()

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

Definition at line 29 of file DTKInterpolationEvaluator.C.

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

Member Function Documentation

◆ evaluate()

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

Definition at line 45 of file DTKInterpolationEvaluator.C.

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

Member Data Documentation

◆ _offset

Point libMesh::DTKInterpolationEvaluator::_offset
protected

Definition at line 64 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ current_local_solution

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

Definition at line 65 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ dim

unsigned int libMesh::DTKInterpolationEvaluator::dim
protected

Definition at line 68 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ dof_map

DofMap& libMesh::DTKInterpolationEvaluator::dof_map
protected

Definition at line 69 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ es

EquationSystems& libMesh::DTKInterpolationEvaluator::es
protected

Definition at line 66 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ fe_type

const FEType& libMesh::DTKInterpolationEvaluator::fe_type
protected

Definition at line 71 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ mesh

MeshBase& libMesh::DTKInterpolationEvaluator::mesh
protected

Definition at line 67 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().

◆ sys

System& libMesh::DTKInterpolationEvaluator::sys
protected

Definition at line 63 of file DTKInterpolationEvaluator.h.

◆ var_num

unsigned int libMesh::DTKInterpolationEvaluator::var_num
protected

Definition at line 70 of file DTKInterpolationEvaluator.h.

Referenced by evaluate().


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