20 unsigned int bulk_element_idx)
21 : component_element_idx_(component_element_idx), bulk_element_idx_(bulk_element_idx)
25 template<
unsigned int dimA,
unsigned int dimB>
29 template<
unsigned int dimA,
unsigned int dimB>
34 template<
unsigned int dimA,
unsigned int dimB>
39 for(
unsigned int i = 0; i < iaux.
size(); i++)
46 template<
unsigned int dimA,
unsigned int dimB>
51 template<
unsigned int dimA,
unsigned int dimB>
57 if(i_points_.size() > 1)
58 for(
unsigned int i=0; i < i_points_.size()-1; i++)
60 length += abs(i_points_[i].comp_coords()[0] - i_points_[i+1].comp_coords()[0]);
71 double subtotal = 0.0;
73 if(i_points_.size() > 2)
74 for(
unsigned int j = 2; j < i_points_.size();j++){
76 subtotal += fabs(i_points_[0].comp_coords()(0)*(i_points_[j-1].comp_coords()(1) - i_points_[j].comp_coords()(1)) +
77 i_points_[j-1].comp_coords()(0)*(i_points_[j].comp_coords()(1) - i_points_[0].comp_coords()(1)) +
78 i_points_[j].comp_coords()(0)*(i_points_[0].comp_coords()(1) - i_points_[j-1].comp_coords()(1)));
80 return fabs(subtotal/2);
85 template<
unsigned int dimA,
unsigned int dimB>
89 template<
unsigned int dimA,
unsigned int dimB>
93 template<
unsigned int dimA,
unsigned int dimB>
95 : comp_coords_(p.local_bcoords_A().subvec(1,dimA)), bulk_coords_(p.local_bcoords_B().subvec(1,dimB))
98 template<
unsigned int dimA,
unsigned int dimB>
100 const arma::vec::fixed< dimB >& bulk_coords)
101 : comp_coords_(comp_coords), bulk_coords_(bulk_coords)
106 template<
unsigned int dimA,
unsigned int dimB>
113 double complement = 1.0;
114 for(
unsigned int i=0; i<dimA; i++)
116 c += comp_coords_[i] * (*comp_ele.
node(i+1));
117 complement -= comp_coords_[i];
119 c += complement * (*comp_ele.
node(0));
131 for (
unsigned int i = 0; i < il.
i_points_.size(); i++) {
132 os << i <<
": " << il[i] << endl;
140 for(
unsigned j= 0; j < dimA-1; j++)
144 for(
unsigned j= 0; j < dimB-1; j++)
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
NodeAccessor< 3 > node(unsigned int ni) const
Internal auxiliary class representing intersection object of simplex<dimA> and simplex<dimB>.
unsigned int size() const
Returns number of intersection points.
Common base for intersection object.
unsigned int component_element_idx_
Index of intersecting element in the component.
unsigned int bulk_element_idx_
Index of intersecting element in the bulk.
Class represents intersection of two elements.
double compute_measure() const override
Computes the relative measure of intersection object.
~IntersectionLocal()
Destructor.
IntersectionLocal()
Default constructor.
std::vector< IntersectionPoint< dimA, dimB > > i_points_
Vector of intersection points.
Internal auxiliary class represents an intersection point of simplex<N> and simplex<M>.
Class represents an intersection point of simplex<N> and simplex<M>. It contains barycentric coordina...
~IntersectionPoint()
Destructor.
arma::vec::fixed< dimA > comp_coords_
Local coordinates of an IP on simplex<dimA>.
arma::vec3 coords(ElementAccessor< 3 > comp_ele) const
arma::vec::fixed< dimB > bulk_coords_
Local coordinates of an IP on simplex<dimB>.
IntersectionPoint()
Default constructor.
Internal class representing intersection object.
template ostream & operator<<< 1, 3 >(ostream &os, const IntersectionPoint< 1, 3 > &s)
template ostream & operator<<< 1, 2 >(ostream &os, const IntersectionPoint< 1, 2 > &s)
template ostream & operator<<< 2, 3 >(ostream &os, const IntersectionPoint< 2, 3 > &s)
ostream & operator<<(ostream &os, const IntersectionLocal< dimA, dimB > &il)
template ostream & operator<<< 2, 2 >(ostream &os, const IntersectionPoint< 2, 2 > &s)
Classes with algorithms for computation of intersections of meshes.
Internal class representing intersection point.