From: <ss...@pu...> - 2018-07-09 02:55:25
|
Hello, all. To find the maximum solution value, I try to print a solution vector, e.g., displacement vector in linear elasticity, as text extension. However, I was able to find only the solution with the exodus extension. This exodus extension is useful to visualize with a program like "ParaView," but it is complicated to compare results directly. So I want to print solution with ".txt" as follows: (node) (solution) 1 0.1122 2 0.5454 . 3224 0.5722 If there are multiple solutions such as 2D elasticity (displacements for x and y directions), I want to print a text file as (node) (x) (y) 1 0.1122 0.5556 2 0.5454 0.5878 . 3224 0.5722 0.4125 Could you please tell me some ways or ideas? If it is impossible, I want to print the maximum solution value in "Terminal" using "std::cout << . << std::endl" at least. I always thank you for your help. Regards, SKang |
From: David K. <dav...@ak...> - 2018-07-09 12:12:15
|
On Sun, Jul 8, 2018 at 10:53 PM, <ss...@pu...> wrote: > Hello, all. > > > > To find the maximum solution value, I try to print a solution vector, e.g., > displacement vector in linear elasticity, as text extension. > > However, I was able to find only the solution with the exodus extension. > > > > This exodus extension is useful to visualize with a program like > "ParaView," > but it is complicated to compare results directly. > > So I want to print solution with ".txt" as follows: > > > > (node) (solution) > > 1 0.1122 > > 2 0.5454 > > . > > 3224 0.5722 > > > > If there are multiple solutions such as 2D elasticity (displacements for x > and y directions), I want to print a text file as > > > > (node) (x) (y) > > 1 0.1122 0.5556 > > 2 0.5454 0.5878 > > . > > 3224 0.5722 0.4125 > > > > Could you please tell me some ways or ideas? > > If it is impossible, I want to print the maximum solution value in > "Terminal" using "std::cout << . << std::endl" at least. > > > > I always thank you for your help. > I gather you're asking how to write to a .txt file? That is a C++ question, not specifically related to libMesh. I suggest you look on the web for a tutorial for I/O, e.g. http://www.cplusplus.com/doc/tutorial/files/ Best, David |
From: <ss...@pu...> - 2018-07-10 00:46:14
|
Thank you for your reply, David I think my question was unclear. My final goal is the same as the question. However, before I print solutions using “cout” or “I/O,” I do not know which variable the solution vector is stored in. In other words, which variable can I use to load solutions of a PDE in RB codes? I also want to know which variable stores nodes that match the above solutions. I look forward your reply. Regards, SKang From: David Knezevic <dav...@ak...> Sent: Monday, July 9, 2018 9:12 PM To: 강신성 <ss...@pu...> Cc: libmesh-users <lib...@li...> Subject: Re: [Libmesh-users] [RB] Print solution vector as ".txt" On Sun, Jul 8, 2018 at 10:53 PM, <ss...@pu... <mailto:ss...@pu...> > wrote: Hello, all. To find the maximum solution value, I try to print a solution vector, e.g., displacement vector in linear elasticity, as text extension. However, I was able to find only the solution with the exodus extension. This exodus extension is useful to visualize with a program like "ParaView," but it is complicated to compare results directly. So I want to print solution with ".txt" as follows: (node) (solution) 1 0.1122 2 0.5454 . 3224 0.5722 If there are multiple solutions such as 2D elasticity (displacements for x and y directions), I want to print a text file as (node) (x) (y) 1 0.1122 0.5556 2 0.5454 0.5878 . 3224 0.5722 0.4125 Could you please tell me some ways or ideas? If it is impossible, I want to print the maximum solution value in "Terminal" using "std::cout << . << std::endl" at least. I always thank you for your help. I gather you're asking how to write to a .txt file? That is a C++ question, not specifically related to libMesh. I suggest you look on the web for a tutorial for I/O, e.g. http://www.cplusplus.com/doc/tutorial/files/ Best, David |
From: David K. <dav...@ak...> - 2018-07-10 00:52:17
|
On Mon, Jul 9, 2018 at 8:43 PM, <ss...@pu...> wrote: > Thank you for your reply, David > > > > I think my question was unclear. > > > > My final goal is the same as the question. > > However, before I print solutions using “cout” or “I/O,” I do not know > which variable the solution vector is stored in. > > In other words, which variable can I use to load solutions of a PDE in RB > codes? > > I also want to know which variable stores nodes that match the above > solutions. > > > > I look forward your reply. > I'm not sure I understand what you're asking, but in general I'd suggest you review the reduced_basis examples carefully since that should cover what you're asking about. For example, see the "online stage" of reduced_basis_ex1, where we do "rb_con.load_rb_solution()". This loads the RB solution into the "solution" vector of the RBConstruction object. Best, David > > > *From:* David Knezevic <dav...@ak...> > *Sent:* Monday, July 9, 2018 9:12 PM > *To:* 강신성 <ss...@pu...> > *Cc:* libmesh-users <lib...@li...> > *Subject:* Re: [Libmesh-users] [RB] Print solution vector as ".txt" > > > > On Sun, Jul 8, 2018 at 10:53 PM, <ss...@pu...> wrote: > > Hello, all. > > > > To find the maximum solution value, I try to print a solution vector, e.g., > displacement vector in linear elasticity, as text extension. > > However, I was able to find only the solution with the exodus extension. > > > > This exodus extension is useful to visualize with a program like > "ParaView," > but it is complicated to compare results directly. > > So I want to print solution with ".txt" as follows: > > > > (node) (solution) > > 1 0.1122 > > 2 0.5454 > > . > > 3224 0.5722 > > > > If there are multiple solutions such as 2D elasticity (displacements for x > and y directions), I want to print a text file as > > > > (node) (x) (y) > > 1 0.1122 0.5556 > > 2 0.5454 0.5878 > > . > > 3224 0.5722 0.4125 > > > > Could you please tell me some ways or ideas? > > If it is impossible, I want to print the maximum solution value in > "Terminal" using "std::cout << . << std::endl" at least. > > > > I always thank you for your help. > > > > > > I gather you're asking how to write to a .txt file? That is a C++ > question, not specifically related to libMesh. I suggest you look on the > web for a tutorial for I/O, e.g. http://www.cplusplus.com/ > doc/tutorial/files/ > > > > Best, > David > |
From: <ss...@pu...> - 2018-07-10 01:21:17
|
Thank you very much! The “rb_con.load_rb_solution()” is the answer I want. I have not seen RB examples because I mistakenly thought that there was only content with exodus extension in examples. So I have only looked at LibMesh documentation and have searched a “solution” keyword. Thanks again for your kind answers to minor questions. Regards, SKang From: David Knezevic <dav...@ak...> Sent: Tuesday, July 10, 2018 9:52 AM To: 강신성 <ss...@pu...> Cc: libmesh-users <lib...@li...> Subject: Re: [Libmesh-users] [RB] Print solution vector as ".txt" On Mon, Jul 9, 2018 at 8:43 PM, <ss...@pu... <mailto:ss...@pu...> > wrote: Thank you for your reply, David I think my question was unclear. My final goal is the same as the question. However, before I print solutions using “cout” or “I/O,” I do not know which variable the solution vector is stored in. In other words, which variable can I use to load solutions of a PDE in RB codes? I also want to know which variable stores nodes that match the above solutions. I look forward your reply. I'm not sure I understand what you're asking, but in general I'd suggest you review the reduced_basis examples carefully since that should cover what you're asking about. For example, see the "online stage" of reduced_basis_ex1, where we do "rb_con.load_rb_solution()". This loads the RB solution into the "solution" vector of the RBConstruction object. Best, David From: David Knezevic <dav...@ak... <mailto:dav...@ak...> > Sent: Monday, July 9, 2018 9:12 PM To: 강신성 <ss...@pu... <mailto:ss...@pu...> > Cc: libmesh-users <lib...@li... <mailto:lib...@li...> > Subject: Re: [Libmesh-users] [RB] Print solution vector as ".txt" On Sun, Jul 8, 2018 at 10:53 PM, <ss...@pu... <mailto:ss...@pu...> > wrote: Hello, all. To find the maximum solution value, I try to print a solution vector, e.g., displacement vector in linear elasticity, as text extension. However, I was able to find only the solution with the exodus extension. This exodus extension is useful to visualize with a program like "ParaView," but it is complicated to compare results directly. So I want to print solution with ".txt" as follows: (node) (solution) 1 0.1122 2 0.5454 . 3224 0.5722 If there are multiple solutions such as 2D elasticity (displacements for x and y directions), I want to print a text file as (node) (x) (y) 1 0.1122 0.5556 2 0.5454 0.5878 . 3224 0.5722 0.4125 Could you please tell me some ways or ideas? If it is impossible, I want to print the maximum solution value in "Terminal" using "std::cout << . << std::endl" at least. I always thank you for your help. I gather you're asking how to write to a .txt file? That is a C++ question, not specifically related to libMesh. I suggest you look on the web for a tutorial for I/O, e.g. http://www.cplusplus.com/doc/tutorial/files/ Best, David |