40 if (master->dim() > slave->dim()) {
41 cout << "Exception: master->dim() > slave->dim()" << endl;
42 //throw((char*) "master->dim > slave->dim");
45 intersection_point_to_vectors(isec->get_point(0),master_shift, slave_shift);
47 arma::vec master_tmp(master_shift), slave_tmp(slave_shift);
48 // cyklus pres body pruniku
49 for (unsigned int i = 1; i < (dim + 1); ++i) {
50 intersection_point_to_vectors(isec->get_point(i),master_tmp, slave_tmp);
51 master_tmp -= master_shift;
52 slave_tmp -= slave_shift;
54 master_map.col(i-1) = master_tmp;
55 slave_map.col(i-1) = slave_tmp;
61 unsigned int IntersectionQuadrature::master_dim()
62 {return master->dim();}
66 unsigned int IntersectionQuadrature::slave_dim()
67 {return slave->dim();}
71 void IntersectionQuadrature::intersection_point_to_vectors(const IntersectionPoint *point, arma::vec &vec1, arma::vec &vec2)
73 const vector<double> &coord_el1 = point->el1_coord();
74 ASSERT_EQ(coord_el1.size() , vec1.n_elem);
75 vec1=arma::vec(coord_el1);
77 const vector<double> &coord_el2 = point->el2_coord();
78 ASSERT_EQ(coord_el2.size() , vec2.n_elem);
79 vec2=arma::vec(coord_el2);
83 arma::vec IntersectionQuadrature::map_to_master(const arma::vec &point) const
85 //dim = dimenze intersec elementu
86 ASSERT_EQ( point.n_elem, dim ).error("Map to slave: point.n_elem != dim \n");
87 int result_dim = master->dim();
88 arma::vec result(result_dim+1);
90 result.subvec(1, result_dim) = (master_map * point + master_shift);
94 arma::vec IntersectionQuadrature::map_to_slave(const arma::vec &point) const
96 ASSERT_EQ( point.n_elem, dim ).error("Map to slave: point.n_elem != dim \n");
97 int result_dim = slave->dim();
98 arma::vec result(result_dim+1);
100 result.subvec(1, result_dim) = (slave_map * point + slave_shift);
104 double IntersectionQuadrature::intersection_true_size() const {
106 static const double factorial[4] = {1.0, 1.0, 2.0, 6.0};
107 return (master->measure() * det(master_map) / factorial[dim]);