Пример #1
0
 static void assign_from_expression (mesh_t const & mesh, D & data, T & t, RHS rhs) { 
  // access to the data . Beware, we view it as a *matrix* NOT an array... (crucial for assignment to scalars !) 
  for (size_t u=0; u<mesh.size(); ++u)  { target_view_t( data(tqa::range(),tqa::range(),u)) = rhs(mesh[u]); }
  t = rhs( local::tail::omega(t.shape(),t.size()));
  // if f is an expression, replace the placeholder with a simple tail. If f is a function callable on freq_infty, 
  // it uses the fact that tail_non_view_t can be casted into freq_infty 
 }
Пример #2
0
 static typename gf_t::data_t make_data(mesh_t const &m, target_shape_t) { return std::vector<Target>(m.size()); }
Пример #3
0
void add_face(mesh_t& mesh, const mesh_vertex_coord_t& p1, const mesh_vertex_coord_t& p2, const mesh_vertex_coord_t& p3, const mesh_vertex_coord_t& p4)
{
	mesh.emplace_back(p1, p2, p3);
	mesh.emplace_back(p3, p4, p1);
}
Пример #4
0
 bool at_end() const { return (_index == m->size()); }
Пример #5
0
 operator cast_t() const { return m->index_to_point(_index); }
Пример #6
0
 mesh_point operator-() const {
  return mesh_point{*m, {m->_modulo(-index()[0], 0), m->_modulo(-index()[1], 1), m->_modulo(-index()[2], 2)}};
 }
Пример #7
0
 // explicit is important for g[ {1,2}] to disambiguate the mesh_point_t and the mesh_index_t
 explicit mesh_point(mesh_t const& mesh, mesh_t::index_t const& index)
    : index3_generator(mesh.get_dimensions(), index), m(&mesh) {}
Пример #8
0
 static data_t make(mesh_t const &m, target_shape_t shape, aux_t ml) {
  data_t A(join(m.size_of_components(), shape), ml);
  A() = 0;
  return A;
 }
Пример #9
0
 auto __as_meshpt(mesh_t const &m, typename mesh_t::index_t const &r) { return m.modulo_reduce(r); }
Пример #10
0
 linear_index_t linear_index() const { return m->index_to_linear(index()); }
Пример #11
0
 operator domain_pt_t() const { return m->index_to_point(index()); }
Пример #12
0
 static typename gf_t::data_t make(mesh_t const &m, target_shape_t, aux_t) {
  auto s = m.size_of_components();
  std::vector<Target> v(s[1]);
  return std::vector<std::vector<Target>>(s[0], v);
 }