Actually, code PointType p = viennagrid::default_point_accessor(*viennagrid::find(mesh, VertexIDType(cell_point_ID)); doesn't work. It should be PointType p = viennagrid::default_point_accessor(mesh)(*viennagrid::find(mesh, VertexIDType(cell_point_ID)));
Hello, Karli. Thanks for the answer, it seems this is what I was looking for. Best regards, Cyril
Hello, what is an elegant way to get coordinates of a mesh vertex by its id? For the time being, I've implemented it like this: typedef viennagrid::triangular_2d_mesh MeshType; typedef viennagrid::result_of::vertex<MeshType>::type VertexType; typedef viennagrid::result_of::point<MeshType>::type PointType; typedef viennagrid::result_of::id<VertexType>::type VertexIDType; unsigned int cell_point_ID = 5; PointType p = viennagrid::find(mesh, VertexIDType(cell_point_ID))[0].appendix(); which looks awkward....
GMRES of ViennaCL works great. The stupid error was connected with results plotting.
Thanks for the answer. I have to think over it.
Hello Karli, I've tried your solver parameters and got the same wrong solution. I didn't mention in the first massage that I've already "played" with different parameters of the solver but without success. I've also tried to solve with transposed stiffness matrix and without preconditioner. Why GMRES solves test case 1 though MATLAB tells me that my matrix has zero determinant? Thanks, Cyril
Hello. Thanks for one more great library. I'm trying to solve a system of linear equations originating from convection equation (cell-centered finite volume method). I get the right solution for a simple test case: Fig. 1. Test case 1. Parameters of matrix K (K C = L): dimensions 3148x3148, nonsymmetric, cond.number=152, rank=3148, det=0 (MATLAB command det(A) gives such a result) But I get the wrong solution for a little more complex test case: Fig. 2. Test case 2. Parameters of matrix K (K C =...
Hello. Thanks for one more great library. I'm trying to solve a system of linear equations originating from convection equation (cell-centered finite volume method). I get the right solution for a simple test case: Fig. 1. Test case 1. Parameters of matrix K (K C = L): dimensions 3148x3148, nonsymmetric, cond.number=152, rank=3148, det=0 (MATLAB command det(A) gives such a result) But I get the wrong solution for a little more complex test case: Fig. 2. Test case 2. Parameters of matrix K (K C =...
Thanks for the clarification!
Probably the section "8.2 Element Storage in Mesh and Segment" of ViennaGrid's manual answers my question. It is written that For segments, only handles to the global element objects in the mesh are stored. Since uniqueness of elements is required in segments as well, an internal storage scheme of type std::set<ElementHandleType> is chosen for non-cells, where ElementType denotes the type of the elements. I think that for storing edge ranges of particular boundaries it's supposed to use std::map<int,...
Probably the section "8.2 Element Storage in Mesh and Segment" of ViennaGrid's manual answers my question. It is written that For segments, only handles to the global element objects in the mesh are stored. Since uniqueness of elements is required in segments as well, an internal storage scheme of type std::set<ElementHandleType> is chosen for non-cells, where ElementType denotes the type of the elements. I think that for storing edge ranges of particular boundaries it's supposed to use std::map<int,...
Hello. The problem concerns boundary conditions (cell-centered finite volume method for convection equation). Let the following mesh is given: Fig. 1. Mesh To set up boundary conditions I'd like to iterate through edges which belong to boundary 0, 1, ..., 3 (see fig. 1). I am going to implement it the following way: typedef viennagrid::triangular_2d_mesh MeshType; typedef viennagrid::result_of::handle<MeshType, viennagrid::edge_tag>::type EdgeHandleType; std::map<int, std::deque<EdgeHandleType> >...
Hello. The problem concerns boundary conditions. Let the following mesh is given: Fig. 1. Mesh To set up boundary conditions I'd like to iterate through edges which belong to boundary 0, 1, ..., 3 (see fig. 1). I am going to implement it the following way: typedef viennagrid::triangular_2d_mesh MeshType; typedef viennagrid::result_of::handle<MeshType, viennagrid::edge_tag>::type EdgeHandleType; std::map<int, std::deque<EdgeHandleType> > edge_selection_ranges; std::deque<EdgeHandleType>::iterator...
Hello. The problem concerns static_array class. It seems compiler doesn't like when static_array object is used as argument of a function from STL. Consider the following example: #include <iostream> #include "viennagrid/storage/static_array.hpp" int main() { viennagrid::static_array<int, 2> A; viennagrid::static_array<int, 2> B; A[0] = 1; A[1] = 2; B[0] = 1; B[1] = 2; if (A==B) std::cout << "A==B" << std::endl; else std::cout << "A!=B" << std::endl; std::cin.get(); return EXIT_SUCCESS; } Compiler...
Hello. The problem concerns static_array class. It seems compiler doesn't like when static_array object is used as argument of a function from STL. Consider the following example: #include <iostream> #include "viennagrid/storage/static_array.hpp" int main() { viennagrid::static_array<int, 2> A; viennagrid::static_array<int, 2> B; A[0] = 1; A[1] = 2; B[0] = 1; B[1] = 2; if (A==B) std::cout << "A==B" << std::endl; else std::cout << "A!=B" << std::endl; std::cin.get(); return EXIT_SUCCESS; } It gives...
Nevermind. The answer was found on the page http://viennagrid.sourceforge.net/viennagrid-iterators.html : // First part same as before: typedef result_of::edge_range<MeshType>::type EdgeRange; typedef result_of::iterator<EdgeRange>::type EdgeIterator; EdgeRange edges(mesh); for (EdgeIterator eit = edges.begin(); eit != edges.end(); ++eit) { // Get the types: typedef result_of::edge<MeshType>::type EdgeType; typedef result_of::vertex_range<EdgeType>::type VertexOnEdgeRange; typedef result_of::iterator<VertexOnEdgeRange>::type...
Nevermind. The answer was found on the page http://viennagrid.sourceforge.net/viennagrid-iterators.html: // First part same as before: typedef result_of::edge_range<MeshType>::type EdgeRange; typedef result_of::iterator<EdgeRange>::type EdgeIterator; EdgeRange edges(mesh); for (EdgeIterator eit = edges.begin(); eit != edges.end(); ++eit) { // Get the types: typedef result_of::edge<MeshType>::type EdgeType; typedef result_of::vertex_range<EdgeType>::type VertexOnEdgeRange; typedef result_of::iterator<VertexOnEdgeRange>::type...
Hello. First of all, thanks for the library. I'd like to iterate through all vertices of a given edge (the purpose is to get IDs of vertices). I slightly modified the example "mesh_setup.cpp" to illustrate the problem: /* ======================================================================= Copyright (c) 2011-2014, Institute for Microelectronics, Institute for Analysis and Scientific Computing, TU Wien. ----------------- ViennaGrid - The Vienna Grid Library ----------------- License: MIT (X11),...
Hello. First of all, thanks for the library. I'd like to iterate through all vertices of a given edge (the purpose is to get IDs of vertices). I slightly modify the example "mesh_setup.cpp" to illustrate the problem: /* ======================================================================= Copyright (c) 2011-2014, Institute for Microelectronics, Institute for Analysis and Scientific Computing, TU Wien. ----------------- ViennaGrid - The Vienna Grid Library ----------------- License: MIT (X11), see...