42 #include "DTK_IntrepidCellLocalMap.hpp" 47 #include <Intrepid_FieldContainer.hpp> 54 double IntrepidCellLocalMap::measure(
55 const shards::CellTopology &entity_topo,
56 const Intrepid::FieldContainer<double> &entity_coords )
59 IntrepidCell entity_cell( entity_topo, 1 );
65 Intrepid::FieldContainer<double> measure( 1 );
66 entity_cell.getCellMeasures( measure );
72 void IntrepidCellLocalMap::centroid(
73 const shards::CellTopology &entity_topo,
74 const Intrepid::FieldContainer<double> &entity_coords,
75 const Teuchos::ArrayView<double> ¢roid )
78 IntrepidCell entity_cell( entity_topo, 1 );
79 entity_cell.setCellNodeCoordinates( entity_coords );
82 Intrepid::FieldContainer<double> ref_center( 1,
83 entity_coords.dimension( 2 ) );
87 Intrepid::FieldContainer<double> phys_center(
88 1, 1, entity_coords.dimension( 2 ) );
89 entity_cell.mapToCellPhysicalFrame( ref_center, phys_center );
92 centroid.assign( phys_center.getData()() );
98 bool IntrepidCellLocalMap::mapToReferenceFrame(
99 const shards::CellTopology &entity_topo,
100 const Intrepid::FieldContainer<double> &entity_coords,
101 const Teuchos::ArrayView<const double> &point,
102 const Teuchos::ArrayView<double> &reference_point )
105 IntrepidCell entity_cell( entity_topo, 1 );
106 entity_cell.setCellNodeCoordinates( entity_coords );
109 Teuchos::Array<int> array_dims( 2 );
111 array_dims[1] = entity_coords.dimension( 2 );
112 Intrepid::FieldContainer<double> point_container(
113 array_dims, const_cast<double *>( point.getRawPtr() ) );
114 Intrepid::FieldContainer<double> ref_point_container(
115 array_dims, reference_point.getRawPtr() );
116 entity_cell.mapToCellReferenceFrame( point_container, ref_point_container );
125 bool IntrepidCellLocalMap::checkPointInclusion(
126 const shards::CellTopology &entity_topo,
127 const Teuchos::ArrayView<const double> &reference_point,
128 const double tolerance )
131 IntrepidCell entity_cell( entity_topo, 1 );
134 Teuchos::Array<int> array_dims( 2 );
136 array_dims[1] = reference_point.size();
137 Intrepid::FieldContainer<double> ref_point_container(
138 array_dims, const_cast<double *>( reference_point.getRawPtr() ) );
139 return entity_cell.pointInReferenceCell( ref_point_container, tolerance );
144 void IntrepidCellLocalMap::mapToPhysicalFrame(
145 const shards::CellTopology &entity_topo,
146 const Intrepid::FieldContainer<double> &entity_coords,
147 const Teuchos::ArrayView<const double> &reference_point,
148 const Teuchos::ArrayView<double> &point )
151 IntrepidCell entity_cell( entity_topo, 1 );
152 entity_cell.setCellNodeCoordinates( entity_coords );
155 Teuchos::Array<int> ref_array_dims( 2 );
156 ref_array_dims[0] = 1;
157 ref_array_dims[1] = entity_coords.dimension( 2 );
158 Intrepid::FieldContainer<double> ref_point_container(
159 ref_array_dims, const_cast<double *>( reference_point.getRawPtr() ) );
160 Teuchos::Array<int> phys_array_dims( 3 );
161 phys_array_dims[0] = 1;
162 phys_array_dims[1] = 1;
163 phys_array_dims[2] = entity_coords.dimension( 2 );
164 Intrepid::FieldContainer<double> point_container( phys_array_dims,
166 entity_cell.mapToCellPhysicalFrame( ref_point_container, point_container );
static void updateState(IntrepidCell &Intrepid_cell, const MDArray &cell_node_coords)
Free function for updating the cell state for a new set of physical cells in a single call...
static void referenceCellCenter(const shards::CellTopology &cell_topo, Intrepid::FieldContainer< double > ¢er)
Get the center of the reference cell of the given topology.
Assertions and Design-by-Contract for error handling.
Manager for Intrepid cell-level operations.
A stateless class of projection primitive operations.