Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2003 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}
(2) 
_{Oct}
(2) 
_{Nov}
(27) 
_{Dec}
(31) 

2004 
_{Jan}
(6) 
_{Feb}
(15) 
_{Mar}
(33) 
_{Apr}
(10) 
_{May}
(46) 
_{Jun}
(11) 
_{Jul}
(21) 
_{Aug}
(15) 
_{Sep}
(13) 
_{Oct}
(23) 
_{Nov}
(1) 
_{Dec}
(8) 
2005 
_{Jan}
(27) 
_{Feb}
(57) 
_{Mar}
(86) 
_{Apr}
(23) 
_{May}
(37) 
_{Jun}
(34) 
_{Jul}
(24) 
_{Aug}
(17) 
_{Sep}
(50) 
_{Oct}
(24) 
_{Nov}
(10) 
_{Dec}
(60) 
2006 
_{Jan}
(47) 
_{Feb}
(46) 
_{Mar}
(127) 
_{Apr}
(19) 
_{May}
(26) 
_{Jun}
(62) 
_{Jul}
(47) 
_{Aug}
(51) 
_{Sep}
(61) 
_{Oct}
(42) 
_{Nov}
(50) 
_{Dec}
(33) 
2007 
_{Jan}
(60) 
_{Feb}
(55) 
_{Mar}
(77) 
_{Apr}
(102) 
_{May}
(82) 
_{Jun}
(102) 
_{Jul}
(169) 
_{Aug}
(117) 
_{Sep}
(80) 
_{Oct}
(37) 
_{Nov}
(51) 
_{Dec}
(43) 
2008 
_{Jan}
(71) 
_{Feb}
(94) 
_{Mar}
(98) 
_{Apr}
(125) 
_{May}
(54) 
_{Jun}
(119) 
_{Jul}
(60) 
_{Aug}
(111) 
_{Sep}
(118) 
_{Oct}
(125) 
_{Nov}
(119) 
_{Dec}
(94) 
2009 
_{Jan}
(109) 
_{Feb}
(38) 
_{Mar}
(93) 
_{Apr}
(88) 
_{May}
(29) 
_{Jun}
(57) 
_{Jul}
(53) 
_{Aug}
(48) 
_{Sep}
(68) 
_{Oct}
(151) 
_{Nov}
(23) 
_{Dec}
(35) 
2010 
_{Jan}
(84) 
_{Feb}
(60) 
_{Mar}
(184) 
_{Apr}
(112) 
_{May}
(60) 
_{Jun}
(90) 
_{Jul}
(23) 
_{Aug}
(70) 
_{Sep}
(119) 
_{Oct}
(27) 
_{Nov}
(47) 
_{Dec}
(54) 
2011 
_{Jan}
(22) 
_{Feb}
(19) 
_{Mar}
(92) 
_{Apr}
(93) 
_{May}
(35) 
_{Jun}
(91) 
_{Jul}
(32) 
_{Aug}
(61) 
_{Sep}
(7) 
_{Oct}
(69) 
_{Nov}
(81) 
_{Dec}
(23) 
2012 
_{Jan}
(64) 
_{Feb}
(95) 
_{Mar}
(35) 
_{Apr}
(36) 
_{May}
(63) 
_{Jun}
(98) 
_{Jul}
(70) 
_{Aug}
(171) 
_{Sep}
(149) 
_{Oct}
(64) 
_{Nov}
(67) 
_{Dec}
(126) 
2013 
_{Jan}
(108) 
_{Feb}
(104) 
_{Mar}
(171) 
_{Apr}
(133) 
_{May}
(108) 
_{Jun}
(100) 
_{Jul}
(93) 
_{Aug}
(126) 
_{Sep}
(74) 
_{Oct}
(59) 
_{Nov}
(145) 
_{Dec}
(93) 
2014 
_{Jan}
(38) 
_{Feb}
(45) 
_{Mar}
(26) 
_{Apr}
(41) 
_{May}
(125) 
_{Jun}
(70) 
_{Jul}
(61) 
_{Aug}
(66) 
_{Sep}
(60) 
_{Oct}
(110) 
_{Nov}
(27) 
_{Dec}
(30) 
2015 
_{Jan}
(43) 
_{Feb}
(67) 
_{Mar}
(71) 
_{Apr}
(92) 
_{May}
(39) 
_{Jun}
(15) 
_{Jul}
(46) 
_{Aug}
(63) 
_{Sep}
(84) 
_{Oct}
(82) 
_{Nov}
(69) 
_{Dec}
(45) 
2016 
_{Jan}
(92) 
_{Feb}
(91) 
_{Mar}
(148) 
_{Apr}
(43) 
_{May}
(58) 
_{Jun}
(117) 
_{Jul}
(92) 
_{Aug}
(140) 
_{Sep}
(49) 
_{Oct}
(33) 
_{Nov}
(85) 
_{Dec}
(40) 
2017 
_{Jan}
(41) 
_{Feb}
(36) 
_{Mar}
(49) 
_{Apr}
(41) 
_{May}
(73) 
_{Jun}
(51) 
_{Jul}
(12) 
_{Aug}
(69) 
_{Sep}
(26) 
_{Oct}
(43) 
_{Nov}
(75) 
_{Dec}
(23) 
2018 
_{Jan}
(28) 
_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 


1
(1) 
2

3

4

5
(1) 
6

7

8
(10) 
9
(14) 
10
(12) 
11
(18) 
12
(3) 
13
(3) 
14
(7) 
15
(17) 
16
(9) 
17
(11) 
18
(7) 
19

20

21
(2) 
22
(8) 
23
(12) 
24

25
(3) 
26
(22) 
27
(3) 
28

29
(8) 
30
(7) 
31
(6) 



From: Rahul Sampath <rahul.sampath@gm...>  20100326 21:53:11

I have not used MeshData and may be some of the LibMesh experts in the group can help you with that. However, all you need is a Petsc Vec object for F_nodal since you can simply call Petsc MatMult to form RHS once you have Petsc Mat for MassMatrix and F_nodal. If you know the global DOF id for each mesh node and the corresponding f_value then you can set values into F_nodal using Petsc functions. On Fri, Mar 26, 2010 at 5:43 PM, Karen Lee <kylkaren@...> wrote: > Yeah, this makes perfect sense to me. > > I'm having difficulty with step 2 though. In main, I define a MeshData that > I read in from an input file with the Mesh itself and the associated data. > Basically, F_nodal IS mesh_data.get_data(el.get_node(i))[0], but I don't see > a get_mesh_data function or something similar in the class doc for System... > Nor can I find a way to access the MeshData object associated with the mesh > once I have the mesh object pointer... > > > > > On Fri, Mar 26, 2010 at 5:38 PM, Rahul Sampath <rahul.sampath@...> > wrote: >> >> Here are the steps to solve Laplacian u(x,y,z) = f(x,y,z): >> >> 1. Form A = Assembly( A_elem ) where A_elem = integral(dPhi_i*dPhi_j) >> 2. Form F_nodal = f(x_i,y_i,z_i) at all mesh nodes >> 3. Form MassMatrix = Assembly( M_elem ) where M_elem = integral(Phi_k, >> Phi_j) >> 4. Form RHS = MassMatrix*F_nodal >> 5. Solve A U_nodal = RHS for U_nodal >> >> >> >> On Fri, Mar 26, 2010 at 5:26 PM, Karen Lee <kylkaren@...> wrote: >> > This would be for the interpolation only right? >> > >> > So if I use this GlobalRHS, and construct my LHS based on the actual >> > problem >> > I want to solve (just a Poisson, so I would be using dphi), it would be >> > equivalent to solving the problem with the RHS being interpolated? >> > >> > Karen >> > >> > >> > On Fri, Mar 26, 2010 at 5:23 PM, Rahul Sampath <rahul.sampath@...> >> > wrote: >> >> >> >> To be more precise: >> >> >> >> GlobalMassMatrix = Sum_over_elements{ >> >> integral_over_current_element_using_quadrature(phi_i*phi_j) } >> >> >> >> GlobalRHS = GlobalMassMatrix*Nodal_F_Vector >> >> >> >> On Fri, Mar 26, 2010 at 5:22 PM, Rahul Sampath >> >> <rahul.sampath@...> >> >> wrote: >> >> > This is what I meant: >> >> > >> >> > MassMatrix = integral(phi_i*phi_j) >> >> > >> >> > RHS = MassMatrix*Nodal_F_Vector >> >> > >> >> > >> >> > On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> >> >> > wrote: >> >> >> Sorry, I think I was probably confused. I guess you just meant that >> >> >> I >> >> >> can >> >> >> simply use integral of f_i phi_i phi_j as my RHS, and my original >> >> >> LHS >> >> >> as my >> >> >> LHS, and that would already be effectively an interpolation? Please >> >> >> let >> >> >> me >> >> >> know if this is the correct way to think about it instead of the >> >> >> long >> >> >> message I sent with lots of code... >> >> >> >> >> >> My 2 questions regarding access to data would still remain: >> >> >> >> >> >> 1) I am still having problems accessing MeshData from the assemble >> >> >> function. I would like to do something like >> >> >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable >> >> >> for >> >> >> node i with an element, i from 0 to 3, but I'm not sure how to >> >> >> access >> >> >> mesh_data from my System. (I should use Linear Implicit System so I >> >> >> can >> >> >> have >> >> >> the matrix on the lhs right?) >> >> >> >> >> >> 2) The other question is, for Fe, do I integrate over all the >> >> >> quadrature >> >> >> points of phi_i and phi_j with f_i being a constant? >> >> >> >> >> >> Thank you so much!!! >> >> >> Karen >> >> >> >> >> >> >> >> >> On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> >> >> >> wrote: >> >> >>> >> >> >>> Thanks Rahul. Your responses have clarified things for me. >> >> >>> >> >> >>> I am still having problems accessing MeshData from the assemble >> >> >>> function >> >> >>> (which is only supposed to have 2 arguments right?) >> >> >>> >> >> >>> I can do: >> >> >>> >> >> >>> void assemble_load(EquationSystems& es, >> >> >>> const std::string& system_name) >> >> >>> { >> >> >>> >> >> >>> libmesh_assert (system_name == "load"); >> >> >>> >> >> >>> >> >> >>> const MeshBase& mesh = es.get_mesh(); >> >> >>> printf("mesh_data obtained"); >> >> >>> >> >> >>> ...... >> >> >>> >> >> >>> But I'm not sure how I can get the MeshData object that I created >> >> >>> in >> >> >>> main >> >> >>> that's attached to the mesh I created. In the look iterating over >> >> >>> the >> >> >>> elements el, I know that I have to use something like >> >> >>> mesh_data.get_data(el.get_node(i))[0] to get the first data >> >> >>> variable >> >> >>> for >> >> >>> node i with an element, i from 0 to 3, but I'm not sure how to >> >> >>> access >> >> >>> mesh_data from my System. (I should use Linear Implicit System so I >> >> >>> can have >> >> >>> the matrix on the lhs right?) >> >> >>> >> >> >>> My code is based on example 3, and the relevant part is this (not >> >> >>> sure >> >> >>> if >> >> >>> it's correct): >> >> >>> >> >> >>> for ( ; el != end_el ; ++el) >> >> >>> { >> >> >>> const Elem* elem = *el; >> >> >>> >> >> >>> dof_map.dof_indices (elem, dof_indices); >> >> >>> >> >> >>> fe>reinit (elem); >> >> >>> >> >> >>> Ke.resize (dof_indices.size(), >> >> >>> dof_indices.size()); >> >> >>> >> >> >>> Fe.resize (dof_indices.size()); >> >> >>> >> >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> >> >>> { >> >> >>> >> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >> >>> for (unsigned int j=0; j<phi.size(); j++) >> >> >>> { >> >> >>> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); >> >> >>> } >> >> >>> >> >> >>> { >> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >> >>> { >> >> >>> for (unsigned int k=0; k<phi.size(); k++) >> >> >>> { >> >> >>> Fe(i) += >> >> >>> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; >> >> >>> >> >> >>> } >> >> >>> } >> >> >>> } >> >> >>> .... >> >> >>> >> >> >>> The other question is, for Fe, do I integrate over all the >> >> >>> quadrature >> >> >>> points of phi_i and phi_j with f_i being a constant? >> >> >>> >> >> >>> Then once I get this solution (the variable name is "R", let's >> >> >>> say), I >> >> >>> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] >> >> >>> and >> >> >>> do >> >> >>> something like this (of course this is another system that I'm >> >> >>> adding >> >> >>> to >> >> >>> EquationSystems): >> >> >>> >> >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> >> >>> { >> >> >>> >> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >> >>> >> >> >>> >> >> >>> for (unsigned int j=0; j<phi.size(); j++) >> >> >>> { >> >> >>> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); >> >> >>> >> >> >>> >> >> >>> } >> >> >>> >> >> >>> { >> >> >>> const Real x = q_point[qp](0); >> >> >>> const Real y = q_point[qp](1); >> >> >>> const Real z = q_point[qp](2); >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> const Real fxy = R(x,y,z); >> >> >>> >> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >> >>> >> >> >>> >> >> >>> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; >> >> >>> } >> >> >>> } >> >> >>> >> >> >>> I'm not sure how to access anything in a Variable object though... >> >> >>> Let's >> >> >>> say "R" being a a variable I add to the first system to get the RHS >> >> >>> interpolation, and "u" is the variable I add to the second equation >> >> >>> system, >> >> >>> which is the actual solution I'm after... I just know that I can >> >> >>> output the >> >> >>> values of the solution at various nodal points in a file, but am >> >> >>> not >> >> >>> sure >> >> >>> what to do with the data structure and how I can extract values at >> >> >>> different >> >> >>> arbitrary locations. >> >> >>> >> >> >>> Apologies for the lengthy email... >> >> >>> >> >> >>> Thanks, >> >> >>> Karen >> >> >>> >> >> >>> >> >> >>> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath >> >> >>> <rahul.sampath@...> >> >> >>> wrote: >> >> >>>> >> >> >>>> Hi Karen: >> >> >>>> >> >> >>>> Take a look at any Nonlinear example problem. Whenever you want to >> >> >>>> use >> >> >>>> any solution vector in your residual computation, you will need to >> >> >>>> interpolate the nodal values using the FEM shape functions for >> >> >>>> this >> >> >>>> element and then do the integration. It is very similar to what >> >> >>>> you >> >> >>>> want to do. That is why I suggested the Mass matrix trick. It is >> >> >>>> very >> >> >>>> simple to implement and fast too especially if you want to change >> >> >>>> f >> >> >>>> often. You can use the same Mass matrix with differen f. The catch >> >> >>>> is >> >> >>>> that you are using your FE shape functions for your interpolation. >> >> >>>> As >> >> >>>> long as you are happy with linear interpolation for f this should >> >> >>>> do. >> >> >>>> If you want to interpolate f with a higher order polynomial than >> >> >>>> your >> >> >>>> FE shape function then this wont work. >> >> >>>> >> >> >>>> Btw, if I was not clear earlier: >> >> >>>> You have to form a global Mass matrix by integrating phi_i phi_j >> >> >>>> over >> >> >>>> all elements and doing a typically FEM assembly. Then you can >> >> >>>> simply >> >> >>>> multiply this global Mass matrix with you global nodal vector for >> >> >>>> f. >> >> >>>> >> >> >>>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> >> >> >>>> wrote: >> >> >>>> > Hi Rahul, I'm not completely sure what you mean. >> >> >>>> > >> >> >>>> > I would like to form my RHS by integrating f_i Phi_i (I guess >> >> >>>> > there's >> >> >>>> > no >> >> >>>> > need to multiply Phi_j? But you can correct me) for each >> >> >>>> > element. >> >> >>>> > >> >> >>>> > In order to do so, I need values of f at various quadrature >> >> >>>> > points. >> >> >>>> > I >> >> >>>> > have f >> >> >>>> > at various nodal values. The question is, how do I get this >> >> >>>> > linear >> >> >>>> > interpolation... >> >> >>>> > >> >> >>>> > Do you mean that, for each element, I form the mass matrix by >> >> >>>> > the >> >> >>>> > xyz >> >> >>>> > values >> >> >>>> > of the nodes (and a constant 1) and solve for the coefficient by >> >> >>>> > saying >> >> >>>> > \sum_j A_ij y_j= f_i, where: >> >> >>>> > >> >> >>>> > A = [1 x1 y1 z1; >> >> >>>> > 1 x2 y2 z2; >> >> >>>> > 1 x3 y3 z3; >> >> >>>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 >> >> >>>> > corresponds >> >> >>>> > to >> >> >>>> > the constant value, and 2, 3, 4 corresponds to the gradient in >> >> >>>> > the >> >> >>>> > x, >> >> >>>> > y, z >> >> >>>> > directions respectively)? >> >> >>>> > >> >> >>>> > Thanks, >> >> >>>> > Karen >> >> >>>> > >> >> >>>> > >> >> >>>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath >> >> >>>> > <rahul.sampath@...> >> >> >>>> > wrote: >> >> >>>> >> >> >> >>>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You >> >> >>>> >> could >> >> >>>> >> form a Mass matrix and then multiply with your vector of nodal >> >> >>>> >> values. >> >> >>>> >> >> >> >>>> >> Rahul >> >> >>>> >> >> >> >>>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee >> >> >>>> >> <kylkaren@...> >> >> >>>> >> wrote: >> >> >>>> >> > I'm afraid you misunderstood. I don't have the function that >> >> >>>> >> > when >> >> >>>> >> > given >> >> >>>> >> > x, >> >> >>>> >> > y, z values gives me the function value. What I do have is >> >> >>>> >> > just >> >> >>>> >> > the >> >> >>>> >> > values >> >> >>>> >> > at the nodes of the mesh, which need to be linearly >> >> >>>> >> > interpolated >> >> >>>> >> > such >> >> >>>> >> > that I >> >> >>>> >> > will have something like exact_function. which gives me the >> >> >>>> >> > value >> >> >>>> >> > when >> >> >>>> >> > supplied with any x, y, z. >> >> >>>> >> > >> >> >>>> >> > >> >> >>>> >> > >> >> >>>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> >> >> >>>> >> > wrote: >> >> >>>> >> > >> >> >>>> >> >> Karen Lee wrote: >> >> >>>> >> >> >> >> >>>> >> >>> I guess I'm not clear how to do this: Load data as a >> >> >>>> >> >>> solution >> >> >>>> >> >>> into >> >> >>>> >> >>> that, >> >> >>>> >> >>> and >> >> >>>> >> >>> query >> >> >>>> >> >>> it when you're integrating your real system. >> >> >>>> >> >>> >> >> >>>> >> >>> I have: >> >> >>>> >> >>> Mesh mesh(3); >> >> >>>> >> >>> MeshData mesh_data(mesh); >> >> >>>> >> >>> mesh_data.activate(); >> >> >>>> >> >>> mesh.read (mesh_file, &mesh_data); >> >> >>>> >> >>> mesh_data.read(mesh_file); >> >> >>>> >> >>> EquationSystems equation_systems (mesh); >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >> >> >>>> >> >>> equation_systems.get_system("RHS").add_variable("R", >> >> >>>> >> >>> FIRST); >> >> >>>> >> >>> >> >> >>>> >> >>> After that, I'm not clear how exactly to load data as a >> >> >>>> >> >>> solution >> >> >>>> >> >>> in >> >> >>>> >> >>> the >> >> >>>> >> >>> code. My goal is to get a linearly interpolated function of >> >> >>>> >> >>> my >> >> >>>> >> >>> data on >> >> >>>> >> >>> the >> >> >>>> >> >>> nodes (in the form of exact_solution, such that I get the >> >> >>>> >> >>> function >> >> >>>> >> >>> value >> >> >>>> >> >>> out >> >> >>>> >> >>> when supplying x, y and z). >> >> >>>> >> >>> >> >> >>>> >> >>> Hope that clarifies things, and sorry for the multiple >> >> >>>> >> >>> emails... >> >> >>>> >> >>> >> >> >>>> >> >>> Karen >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>>  >> >> >>>> >> >>> Download Intel® Parallel Studio Eval >> >> >>>> >> >>> Try the new software tools for yourself. Speed compiling, >> >> >>>> >> >>> find >> >> >>>> >> >>> bugs >> >> >>>> >> >>> proactively, and finetune applications for parallel >> >> >>>> >> >>> performance. >> >> >>>> >> >>> See why Intel Parallel Studio got high marks during beta. >> >> >>>> >> >>> http://p.sf.net/sfu/intelswdev >> >> >>>> >> >>> _______________________________________________ >> >> >>>> >> >>> Libmeshusers mailing list >> >> >>>> >> >>> Libmeshusers@... >> >> >>>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >>> >> >> >>>> >> >> so you already have the function, which is obtained from >> >> >>>> >> >> your >> >> >>>> >> >> discreted >> >> >>>> >> >> data? >> >> >>>> >> >> then just put the function as the exact_function. >> >> >>>> >> >> I think you are trying the 3D case, start from a 2d will be >> >> >>>> >> >> easier. >> >> >>>> >> >> >> >> >>>> >> >> Liang >> >> >>>> >> >> >> >> >>>> >> > >> >> >>>> >> > >> >> >>>> >> > >> >> >>>> >> > >> >> >>>> >> >  >> >> >>>> >> > Download Intel® Parallel Studio Eval >> >> >>>> >> > Try the new software tools for yourself. Speed compiling, >> >> >>>> >> > find >> >> >>>> >> > bugs >> >> >>>> >> > proactively, and finetune applications for parallel >> >> >>>> >> > performance. >> >> >>>> >> > See why Intel Parallel Studio got high marks during beta. >> >> >>>> >> > http://p.sf.net/sfu/intelswdev >> >> >>>> >> > _______________________________________________ >> >> >>>> >> > Libmeshusers mailing list >> >> >>>> >> > Libmeshusers@... >> >> >>>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >> >>>> >> > >> >> >>>> > >> >> >>>> > >> >> >>> >> >> >> >> >> >> >> >> > >> > >> > > > 
From: Karen Lee <kylkaren@gm...>  20100326 21:43:59

Yeah, this makes perfect sense to me. I'm having difficulty with step 2 though. In main, I define a MeshData that I read in from an input file with the Mesh itself and the associated data. Basically, F_nodal IS mesh_data.get_data(el.get_node(i))[0], but I don't see a get_mesh_data function or something similar in the class doc for System... Nor can I find a way to access the MeshData object associated with the mesh once I have the mesh object pointer... On Fri, Mar 26, 2010 at 5:38 PM, Rahul Sampath <rahul.sampath@...>wrote: > Here are the steps to solve Laplacian u(x,y,z) = f(x,y,z): > > 1. Form A = Assembly( A_elem ) where A_elem = integral(dPhi_i*dPhi_j) > 2. Form F_nodal = f(x_i,y_i,z_i) at all mesh nodes > 3. Form MassMatrix = Assembly( M_elem ) where M_elem = integral(Phi_k, > Phi_j) > 4. Form RHS = MassMatrix*F_nodal > 5. Solve A U_nodal = RHS for U_nodal > > > > On Fri, Mar 26, 2010 at 5:26 PM, Karen Lee <kylkaren@...> wrote: > > This would be for the interpolation only right? > > > > So if I use this GlobalRHS, and construct my LHS based on the actual > problem > > I want to solve (just a Poisson, so I would be using dphi), it would be > > equivalent to solving the problem with the RHS being interpolated? > > > > Karen > > > > > > On Fri, Mar 26, 2010 at 5:23 PM, Rahul Sampath <rahul.sampath@...> > > wrote: > >> > >> To be more precise: > >> > >> GlobalMassMatrix = Sum_over_elements{ > >> integral_over_current_element_using_quadrature(phi_i*phi_j) } > >> > >> GlobalRHS = GlobalMassMatrix*Nodal_F_Vector > >> > >> On Fri, Mar 26, 2010 at 5:22 PM, Rahul Sampath <rahul.sampath@... > > > >> wrote: > >> > This is what I meant: > >> > > >> > MassMatrix = integral(phi_i*phi_j) > >> > > >> > RHS = MassMatrix*Nodal_F_Vector > >> > > >> > > >> > On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> > wrote: > >> >> Sorry, I think I was probably confused. I guess you just meant that I > >> >> can > >> >> simply use integral of f_i phi_i phi_j as my RHS, and my original LHS > >> >> as my > >> >> LHS, and that would already be effectively an interpolation? Please > let > >> >> me > >> >> know if this is the correct way to think about it instead of the long > >> >> message I sent with lots of code... > >> >> > >> >> My 2 questions regarding access to data would still remain: > >> >> > >> >> 1) I am still having problems accessing MeshData from the assemble > >> >> function. I would like to do something like > >> >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable > >> >> for > >> >> node i with an element, i from 0 to 3, but I'm not sure how to access > >> >> mesh_data from my System. (I should use Linear Implicit System so I > can > >> >> have > >> >> the matrix on the lhs right?) > >> >> > >> >> 2) The other question is, for Fe, do I integrate over all the > >> >> quadrature > >> >> points of phi_i and phi_j with f_i being a constant? > >> >> > >> >> Thank you so much!!! > >> >> Karen > >> >> > >> >> > >> >> On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> > wrote: > >> >>> > >> >>> Thanks Rahul. Your responses have clarified things for me. > >> >>> > >> >>> I am still having problems accessing MeshData from the assemble > >> >>> function > >> >>> (which is only supposed to have 2 arguments right?) > >> >>> > >> >>> I can do: > >> >>> > >> >>> void assemble_load(EquationSystems& es, > >> >>> const std::string& system_name) > >> >>> { > >> >>> > >> >>> libmesh_assert (system_name == "load"); > >> >>> > >> >>> > >> >>> const MeshBase& mesh = es.get_mesh(); > >> >>> printf("mesh_data obtained"); > >> >>> > >> >>> ...... > >> >>> > >> >>> But I'm not sure how I can get the MeshData object that I created in > >> >>> main > >> >>> that's attached to the mesh I created. In the look iterating over > the > >> >>> elements el, I know that I have to use something like > >> >>> mesh_data.get_data(el.get_node(i))[0] to get the first data variable > >> >>> for > >> >>> node i with an element, i from 0 to 3, but I'm not sure how to > access > >> >>> mesh_data from my System. (I should use Linear Implicit System so I > >> >>> can have > >> >>> the matrix on the lhs right?) > >> >>> > >> >>> My code is based on example 3, and the relevant part is this (not > sure > >> >>> if > >> >>> it's correct): > >> >>> > >> >>> for ( ; el != end_el ; ++el) > >> >>> { > >> >>> const Elem* elem = *el; > >> >>> > >> >>> dof_map.dof_indices (elem, dof_indices); > >> >>> > >> >>> fe>reinit (elem); > >> >>> > >> >>> Ke.resize (dof_indices.size(), > >> >>> dof_indices.size()); > >> >>> > >> >>> Fe.resize (dof_indices.size()); > >> >>> > >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) > >> >>> { > >> >>> > >> >>> for (unsigned int i=0; i<phi.size(); i++) > >> >>> for (unsigned int j=0; j<phi.size(); j++) > >> >>> { > >> >>> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); > >> >>> } > >> >>> > >> >>> { > >> >>> for (unsigned int i=0; i<phi.size(); i++) > >> >>> { > >> >>> for (unsigned int k=0; k<phi.size(); k++) > >> >>> { > >> >>> Fe(i) += > >> >>> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; > >> >>> > >> >>> } > >> >>> } > >> >>> } > >> >>> .... > >> >>> > >> >>> The other question is, for Fe, do I integrate over all the > quadrature > >> >>> points of phi_i and phi_j with f_i being a constant? > >> >>> > >> >>> Then once I get this solution (the variable name is "R", let's say), > I > >> >>> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] > and > >> >>> do > >> >>> something like this (of course this is another system that I'm > adding > >> >>> to > >> >>> EquationSystems): > >> >>> > >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) > >> >>> { > >> >>> > >> >>> for (unsigned int i=0; i<phi.size(); i++) > >> >>> > >> >>> > >> >>> for (unsigned int j=0; j<phi.size(); j++) > >> >>> { > >> >>> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); > >> >>> > >> >>> > >> >>> } > >> >>> > >> >>> { > >> >>> const Real x = q_point[qp](0); > >> >>> const Real y = q_point[qp](1); > >> >>> const Real z = q_point[qp](2); > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> const Real fxy = R(x,y,z); > >> >>> > >> >>> for (unsigned int i=0; i<phi.size(); i++) > >> >>> > >> >>> > >> >>> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; > >> >>> } > >> >>> } > >> >>> > >> >>> I'm not sure how to access anything in a Variable object though... > >> >>> Let's > >> >>> say "R" being a a variable I add to the first system to get the RHS > >> >>> interpolation, and "u" is the variable I add to the second equation > >> >>> system, > >> >>> which is the actual solution I'm after... I just know that I can > >> >>> output the > >> >>> values of the solution at various nodal points in a file, but am not > >> >>> sure > >> >>> what to do with the data structure and how I can extract values at > >> >>> different > >> >>> arbitrary locations. > >> >>> > >> >>> Apologies for the lengthy email... > >> >>> > >> >>> Thanks, > >> >>> Karen > >> >>> > >> >>> > >> >>> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath > >> >>> <rahul.sampath@...> > >> >>> wrote: > >> >>>> > >> >>>> Hi Karen: > >> >>>> > >> >>>> Take a look at any Nonlinear example problem. Whenever you want to > >> >>>> use > >> >>>> any solution vector in your residual computation, you will need to > >> >>>> interpolate the nodal values using the FEM shape functions for this > >> >>>> element and then do the integration. It is very similar to what you > >> >>>> want to do. That is why I suggested the Mass matrix trick. It is > very > >> >>>> simple to implement and fast too especially if you want to change f > >> >>>> often. You can use the same Mass matrix with differen f. The catch > is > >> >>>> that you are using your FE shape functions for your interpolation. > As > >> >>>> long as you are happy with linear interpolation for f this should > do. > >> >>>> If you want to interpolate f with a higher order polynomial than > your > >> >>>> FE shape function then this wont work. > >> >>>> > >> >>>> Btw, if I was not clear earlier: > >> >>>> You have to form a global Mass matrix by integrating phi_i phi_j > over > >> >>>> all elements and doing a typically FEM assembly. Then you can > simply > >> >>>> multiply this global Mass matrix with you global nodal vector for > f. > >> >>>> > >> >>>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> > >> >>>> wrote: > >> >>>> > Hi Rahul, I'm not completely sure what you mean. > >> >>>> > > >> >>>> > I would like to form my RHS by integrating f_i Phi_i (I guess > >> >>>> > there's > >> >>>> > no > >> >>>> > need to multiply Phi_j? But you can correct me) for each element. > >> >>>> > > >> >>>> > In order to do so, I need values of f at various quadrature > points. > >> >>>> > I > >> >>>> > have f > >> >>>> > at various nodal values. The question is, how do I get this > linear > >> >>>> > interpolation... > >> >>>> > > >> >>>> > Do you mean that, for each element, I form the mass matrix by the > >> >>>> > xyz > >> >>>> > values > >> >>>> > of the nodes (and a constant 1) and solve for the coefficient by > >> >>>> > saying > >> >>>> > \sum_j A_ij y_j= f_i, where: > >> >>>> > > >> >>>> > A = [1 x1 y1 z1; > >> >>>> > 1 x2 y2 z2; > >> >>>> > 1 x3 y3 z3; > >> >>>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 > >> >>>> > corresponds > >> >>>> > to > >> >>>> > the constant value, and 2, 3, 4 corresponds to the gradient in > the > >> >>>> > x, > >> >>>> > y, z > >> >>>> > directions respectively)? > >> >>>> > > >> >>>> > Thanks, > >> >>>> > Karen > >> >>>> > > >> >>>> > > >> >>>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath > >> >>>> > <rahul.sampath@...> > >> >>>> > wrote: > >> >>>> >> > >> >>>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You > >> >>>> >> could > >> >>>> >> form a Mass matrix and then multiply with your vector of nodal > >> >>>> >> values. > >> >>>> >> > >> >>>> >> Rahul > >> >>>> >> > >> >>>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@... > > > >> >>>> >> wrote: > >> >>>> >> > I'm afraid you misunderstood. I don't have the function that > >> >>>> >> > when > >> >>>> >> > given > >> >>>> >> > x, > >> >>>> >> > y, z values gives me the function value. What I do have is > just > >> >>>> >> > the > >> >>>> >> > values > >> >>>> >> > at the nodes of the mesh, which need to be linearly > interpolated > >> >>>> >> > such > >> >>>> >> > that I > >> >>>> >> > will have something like exact_function. which gives me the > >> >>>> >> > value > >> >>>> >> > when > >> >>>> >> > supplied with any x, y, z. > >> >>>> >> > > >> >>>> >> > > >> >>>> >> > > >> >>>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> > >> >>>> >> > wrote: > >> >>>> >> > > >> >>>> >> >> Karen Lee wrote: > >> >>>> >> >> > >> >>>> >> >>> I guess I'm not clear how to do this: Load data as a > solution > >> >>>> >> >>> into > >> >>>> >> >>> that, > >> >>>> >> >>> and > >> >>>> >> >>> query > >> >>>> >> >>> it when you're integrating your real system. > >> >>>> >> >>> > >> >>>> >> >>> I have: > >> >>>> >> >>> Mesh mesh(3); > >> >>>> >> >>> MeshData mesh_data(mesh); > >> >>>> >> >>> mesh_data.activate(); > >> >>>> >> >>> mesh.read (mesh_file, &mesh_data); > >> >>>> >> >>> mesh_data.read(mesh_file); > >> >>>> >> >>> EquationSystems equation_systems (mesh); > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); > >> >>>> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); > >> >>>> >> >>> > >> >>>> >> >>> After that, I'm not clear how exactly to load data as a > >> >>>> >> >>> solution > >> >>>> >> >>> in > >> >>>> >> >>> the > >> >>>> >> >>> code. My goal is to get a linearly interpolated function of > my > >> >>>> >> >>> data on > >> >>>> >> >>> the > >> >>>> >> >>> nodes (in the form of exact_solution, such that I get the > >> >>>> >> >>> function > >> >>>> >> >>> value > >> >>>> >> >>> out > >> >>>> >> >>> when supplying x, y and z). > >> >>>> >> >>> > >> >>>> >> >>> Hope that clarifies things, and sorry for the multiple > >> >>>> >> >>> emails... > >> >>>> >> >>> > >> >>>> >> >>> Karen > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >>> >  > >> >>>> >> >>> Download Intel® Parallel Studio Eval > >> >>>> >> >>> Try the new software tools for yourself. Speed compiling, > find > >> >>>> >> >>> bugs > >> >>>> >> >>> proactively, and finetune applications for parallel > >> >>>> >> >>> performance. > >> >>>> >> >>> See why Intel Parallel Studio got high marks during beta. > >> >>>> >> >>> http://p.sf.net/sfu/intelswdev > >> >>>> >> >>> _______________________________________________ > >> >>>> >> >>> Libmeshusers mailing list > >> >>>> >> >>> Libmeshusers@... > >> >>>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >>> > >> >>>> >> >> so you already have the function, which is obtained from your > >> >>>> >> >> discreted > >> >>>> >> >> data? > >> >>>> >> >> then just put the function as the exact_function. > >> >>>> >> >> I think you are trying the 3D case, start from a 2d will be > >> >>>> >> >> easier. > >> >>>> >> >> > >> >>>> >> >> Liang > >> >>>> >> >> > >> >>>> >> > > >> >>>> >> > > >> >>>> >> > > >> >>>> >> > >  > >> >>>> >> > Download Intel® Parallel Studio Eval > >> >>>> >> > Try the new software tools for yourself. Speed compiling, find > >> >>>> >> > bugs > >> >>>> >> > proactively, and finetune applications for parallel > >> >>>> >> > performance. > >> >>>> >> > See why Intel Parallel Studio got high marks during beta. > >> >>>> >> > http://p.sf.net/sfu/intelswdev > >> >>>> >> > _______________________________________________ > >> >>>> >> > Libmeshusers mailing list > >> >>>> >> > Libmeshusers@... > >> >>>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers > >> >>>> >> > > >> >>>> > > >> >>>> > > >> >>> > >> >> > >> >> > >> > > > > > > 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 21:38:18

Here are the steps to solve Laplacian u(x,y,z) = f(x,y,z): 1. Form A = Assembly( A_elem ) where A_elem = integral(dPhi_i*dPhi_j) 2. Form F_nodal = f(x_i,y_i,z_i) at all mesh nodes 3. Form MassMatrix = Assembly( M_elem ) where M_elem = integral(Phi_k, Phi_j) 4. Form RHS = MassMatrix*F_nodal 5. Solve A U_nodal = RHS for U_nodal On Fri, Mar 26, 2010 at 5:26 PM, Karen Lee <kylkaren@...> wrote: > This would be for the interpolation only right? > > So if I use this GlobalRHS, and construct my LHS based on the actual problem > I want to solve (just a Poisson, so I would be using dphi), it would be > equivalent to solving the problem with the RHS being interpolated? > > Karen > > > On Fri, Mar 26, 2010 at 5:23 PM, Rahul Sampath <rahul.sampath@...> > wrote: >> >> To be more precise: >> >> GlobalMassMatrix = Sum_over_elements{ >> integral_over_current_element_using_quadrature(phi_i*phi_j) } >> >> GlobalRHS = GlobalMassMatrix*Nodal_F_Vector >> >> On Fri, Mar 26, 2010 at 5:22 PM, Rahul Sampath <rahul.sampath@...> >> wrote: >> > This is what I meant: >> > >> > MassMatrix = integral(phi_i*phi_j) >> > >> > RHS = MassMatrix*Nodal_F_Vector >> > >> > >> > On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> wrote: >> >> Sorry, I think I was probably confused. I guess you just meant that I >> >> can >> >> simply use integral of f_i phi_i phi_j as my RHS, and my original LHS >> >> as my >> >> LHS, and that would already be effectively an interpolation? Please let >> >> me >> >> know if this is the correct way to think about it instead of the long >> >> message I sent with lots of code... >> >> >> >> My 2 questions regarding access to data would still remain: >> >> >> >> 1) I am still having problems accessing MeshData from the assemble >> >> function. I would like to do something like >> >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable >> >> for >> >> node i with an element, i from 0 to 3, but I'm not sure how to access >> >> mesh_data from my System. (I should use Linear Implicit System so I can >> >> have >> >> the matrix on the lhs right?) >> >> >> >> 2) The other question is, for Fe, do I integrate over all the >> >> quadrature >> >> points of phi_i and phi_j with f_i being a constant? >> >> >> >> Thank you so much!!! >> >> Karen >> >> >> >> >> >> On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> wrote: >> >>> >> >>> Thanks Rahul. Your responses have clarified things for me. >> >>> >> >>> I am still having problems accessing MeshData from the assemble >> >>> function >> >>> (which is only supposed to have 2 arguments right?) >> >>> >> >>> I can do: >> >>> >> >>> void assemble_load(EquationSystems& es, >> >>> const std::string& system_name) >> >>> { >> >>> >> >>> libmesh_assert (system_name == "load"); >> >>> >> >>> >> >>> const MeshBase& mesh = es.get_mesh(); >> >>> printf("mesh_data obtained"); >> >>> >> >>> ...... >> >>> >> >>> But I'm not sure how I can get the MeshData object that I created in >> >>> main >> >>> that's attached to the mesh I created. In the look iterating over the >> >>> elements el, I know that I have to use something like >> >>> mesh_data.get_data(el.get_node(i))[0] to get the first data variable >> >>> for >> >>> node i with an element, i from 0 to 3, but I'm not sure how to access >> >>> mesh_data from my System. (I should use Linear Implicit System so I >> >>> can have >> >>> the matrix on the lhs right?) >> >>> >> >>> My code is based on example 3, and the relevant part is this (not sure >> >>> if >> >>> it's correct): >> >>> >> >>> for ( ; el != end_el ; ++el) >> >>> { >> >>> const Elem* elem = *el; >> >>> >> >>> dof_map.dof_indices (elem, dof_indices); >> >>> >> >>> fe>reinit (elem); >> >>> >> >>> Ke.resize (dof_indices.size(), >> >>> dof_indices.size()); >> >>> >> >>> Fe.resize (dof_indices.size()); >> >>> >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> >>> { >> >>> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >>> for (unsigned int j=0; j<phi.size(); j++) >> >>> { >> >>> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); >> >>> } >> >>> >> >>> { >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >>> { >> >>> for (unsigned int k=0; k<phi.size(); k++) >> >>> { >> >>> Fe(i) += >> >>> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; >> >>> >> >>> } >> >>> } >> >>> } >> >>> .... >> >>> >> >>> The other question is, for Fe, do I integrate over all the quadrature >> >>> points of phi_i and phi_j with f_i being a constant? >> >>> >> >>> Then once I get this solution (the variable name is "R", let's say), I >> >>> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] and >> >>> do >> >>> something like this (of course this is another system that I'm adding >> >>> to >> >>> EquationSystems): >> >>> >> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> >>> { >> >>> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >>> >> >>> >> >>> for (unsigned int j=0; j<phi.size(); j++) >> >>> { >> >>> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); >> >>> >> >>> >> >>> } >> >>> >> >>> { >> >>> const Real x = q_point[qp](0); >> >>> const Real y = q_point[qp](1); >> >>> const Real z = q_point[qp](2); >> >>> >> >>> >> >>> >> >>> >> >>> const Real fxy = R(x,y,z); >> >>> >> >>> for (unsigned int i=0; i<phi.size(); i++) >> >>> >> >>> >> >>> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; >> >>> } >> >>> } >> >>> >> >>> I'm not sure how to access anything in a Variable object though... >> >>> Let's >> >>> say "R" being a a variable I add to the first system to get the RHS >> >>> interpolation, and "u" is the variable I add to the second equation >> >>> system, >> >>> which is the actual solution I'm after... I just know that I can >> >>> output the >> >>> values of the solution at various nodal points in a file, but am not >> >>> sure >> >>> what to do with the data structure and how I can extract values at >> >>> different >> >>> arbitrary locations. >> >>> >> >>> Apologies for the lengthy email... >> >>> >> >>> Thanks, >> >>> Karen >> >>> >> >>> >> >>> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath >> >>> <rahul.sampath@...> >> >>> wrote: >> >>>> >> >>>> Hi Karen: >> >>>> >> >>>> Take a look at any Nonlinear example problem. Whenever you want to >> >>>> use >> >>>> any solution vector in your residual computation, you will need to >> >>>> interpolate the nodal values using the FEM shape functions for this >> >>>> element and then do the integration. It is very similar to what you >> >>>> want to do. That is why I suggested the Mass matrix trick. It is very >> >>>> simple to implement and fast too especially if you want to change f >> >>>> often. You can use the same Mass matrix with differen f. The catch is >> >>>> that you are using your FE shape functions for your interpolation. As >> >>>> long as you are happy with linear interpolation for f this should do. >> >>>> If you want to interpolate f with a higher order polynomial than your >> >>>> FE shape function then this wont work. >> >>>> >> >>>> Btw, if I was not clear earlier: >> >>>> You have to form a global Mass matrix by integrating phi_i phi_j over >> >>>> all elements and doing a typically FEM assembly. Then you can simply >> >>>> multiply this global Mass matrix with you global nodal vector for f. >> >>>> >> >>>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> >> >>>> wrote: >> >>>> > Hi Rahul, I'm not completely sure what you mean. >> >>>> > >> >>>> > I would like to form my RHS by integrating f_i Phi_i (I guess >> >>>> > there's >> >>>> > no >> >>>> > need to multiply Phi_j? But you can correct me) for each element. >> >>>> > >> >>>> > In order to do so, I need values of f at various quadrature points. >> >>>> > I >> >>>> > have f >> >>>> > at various nodal values. The question is, how do I get this linear >> >>>> > interpolation... >> >>>> > >> >>>> > Do you mean that, for each element, I form the mass matrix by the >> >>>> > xyz >> >>>> > values >> >>>> > of the nodes (and a constant 1) and solve for the coefficient by >> >>>> > saying >> >>>> > \sum_j A_ij y_j= f_i, where: >> >>>> > >> >>>> > A = [1 x1 y1 z1; >> >>>> > 1 x2 y2 z2; >> >>>> > 1 x3 y3 z3; >> >>>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 >> >>>> > corresponds >> >>>> > to >> >>>> > the constant value, and 2, 3, 4 corresponds to the gradient in the >> >>>> > x, >> >>>> > y, z >> >>>> > directions respectively)? >> >>>> > >> >>>> > Thanks, >> >>>> > Karen >> >>>> > >> >>>> > >> >>>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath >> >>>> > <rahul.sampath@...> >> >>>> > wrote: >> >>>> >> >> >>>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You >> >>>> >> could >> >>>> >> form a Mass matrix and then multiply with your vector of nodal >> >>>> >> values. >> >>>> >> >> >>>> >> Rahul >> >>>> >> >> >>>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> >> >>>> >> wrote: >> >>>> >> > I'm afraid you misunderstood. I don't have the function that >> >>>> >> > when >> >>>> >> > given >> >>>> >> > x, >> >>>> >> > y, z values gives me the function value. What I do have is just >> >>>> >> > the >> >>>> >> > values >> >>>> >> > at the nodes of the mesh, which need to be linearly interpolated >> >>>> >> > such >> >>>> >> > that I >> >>>> >> > will have something like exact_function. which gives me the >> >>>> >> > value >> >>>> >> > when >> >>>> >> > supplied with any x, y, z. >> >>>> >> > >> >>>> >> > >> >>>> >> > >> >>>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> >> >>>> >> > wrote: >> >>>> >> > >> >>>> >> >> Karen Lee wrote: >> >>>> >> >> >> >>>> >> >>> I guess I'm not clear how to do this: Load data as a solution >> >>>> >> >>> into >> >>>> >> >>> that, >> >>>> >> >>> and >> >>>> >> >>> query >> >>>> >> >>> it when you're integrating your real system. >> >>>> >> >>> >> >>>> >> >>> I have: >> >>>> >> >>> Mesh mesh(3); >> >>>> >> >>> MeshData mesh_data(mesh); >> >>>> >> >>> mesh_data.activate(); >> >>>> >> >>> mesh.read (mesh_file, &mesh_data); >> >>>> >> >>> mesh_data.read(mesh_file); >> >>>> >> >>> EquationSystems equation_systems (mesh); >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >> >>>> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >> >>>> >> >>> >> >>>> >> >>> After that, I'm not clear how exactly to load data as a >> >>>> >> >>> solution >> >>>> >> >>> in >> >>>> >> >>> the >> >>>> >> >>> code. My goal is to get a linearly interpolated function of my >> >>>> >> >>> data on >> >>>> >> >>> the >> >>>> >> >>> nodes (in the form of exact_solution, such that I get the >> >>>> >> >>> function >> >>>> >> >>> value >> >>>> >> >>> out >> >>>> >> >>> when supplying x, y and z). >> >>>> >> >>> >> >>>> >> >>> Hope that clarifies things, and sorry for the multiple >> >>>> >> >>> emails... >> >>>> >> >>> >> >>>> >> >>> Karen >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>>  >> >>>> >> >>> Download Intel® Parallel Studio Eval >> >>>> >> >>> Try the new software tools for yourself. Speed compiling, find >> >>>> >> >>> bugs >> >>>> >> >>> proactively, and finetune applications for parallel >> >>>> >> >>> performance. >> >>>> >> >>> See why Intel Parallel Studio got high marks during beta. >> >>>> >> >>> http://p.sf.net/sfu/intelswdev >> >>>> >> >>> _______________________________________________ >> >>>> >> >>> Libmeshusers mailing list >> >>>> >> >>> Libmeshusers@... >> >>>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >> so you already have the function, which is obtained from your >> >>>> >> >> discreted >> >>>> >> >> data? >> >>>> >> >> then just put the function as the exact_function. >> >>>> >> >> I think you are trying the 3D case, start from a 2d will be >> >>>> >> >> easier. >> >>>> >> >> >> >>>> >> >> Liang >> >>>> >> >> >> >>>> >> > >> >>>> >> > >> >>>> >> > >> >>>> >> >  >> >>>> >> > Download Intel® Parallel Studio Eval >> >>>> >> > Try the new software tools for yourself. Speed compiling, find >> >>>> >> > bugs >> >>>> >> > proactively, and finetune applications for parallel >> >>>> >> > performance. >> >>>> >> > See why Intel Parallel Studio got high marks during beta. >> >>>> >> > http://p.sf.net/sfu/intelswdev >> >>>> >> > _______________________________________________ >> >>>> >> > Libmeshusers mailing list >> >>>> >> > Libmeshusers@... >> >>>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >>>> >> > >> >>>> > >> >>>> > >> >>> >> >> >> >> >> > > > 
From: Karen Lee <kylkaren@gm...>  20100326 21:26:33

This would be for the interpolation only right? So if I use this GlobalRHS, and construct my LHS based on the actual problem I want to solve (just a Poisson, so I would be using dphi), it would be equivalent to solving the problem with the RHS being interpolated? Karen On Fri, Mar 26, 2010 at 5:23 PM, Rahul Sampath <rahul.sampath@...>wrote: > To be more precise: > > GlobalMassMatrix = Sum_over_elements{ > integral_over_current_element_using_quadrature(phi_i*phi_j) } > > GlobalRHS = GlobalMassMatrix*Nodal_F_Vector > > On Fri, Mar 26, 2010 at 5:22 PM, Rahul Sampath <rahul.sampath@...> > wrote: > > This is what I meant: > > > > MassMatrix = integral(phi_i*phi_j) > > > > RHS = MassMatrix*Nodal_F_Vector > > > > > > On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> wrote: > >> Sorry, I think I was probably confused. I guess you just meant that I > can > >> simply use integral of f_i phi_i phi_j as my RHS, and my original LHS as > my > >> LHS, and that would already be effectively an interpolation? Please let > me > >> know if this is the correct way to think about it instead of the long > >> message I sent with lots of code... > >> > >> My 2 questions regarding access to data would still remain: > >> > >> 1) I am still having problems accessing MeshData from the assemble > >> function. I would like to do something like > >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable for > >> node i with an element, i from 0 to 3, but I'm not sure how to access > >> mesh_data from my System. (I should use Linear Implicit System so I can > have > >> the matrix on the lhs right?) > >> > >> 2) The other question is, for Fe, do I integrate over all the quadrature > >> points of phi_i and phi_j with f_i being a constant? > >> > >> Thank you so much!!! > >> Karen > >> > >> > >> On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> wrote: > >>> > >>> Thanks Rahul. Your responses have clarified things for me. > >>> > >>> I am still having problems accessing MeshData from the assemble > function > >>> (which is only supposed to have 2 arguments right?) > >>> > >>> I can do: > >>> > >>> void assemble_load(EquationSystems& es, > >>> const std::string& system_name) > >>> { > >>> > >>> libmesh_assert (system_name == "load"); > >>> > >>> > >>> const MeshBase& mesh = es.get_mesh(); > >>> printf("mesh_data obtained"); > >>> > >>> ...... > >>> > >>> But I'm not sure how I can get the MeshData object that I created in > main > >>> that's attached to the mesh I created. In the look iterating over the > >>> elements el, I know that I have to use something like > >>> mesh_data.get_data(el.get_node(i))[0] to get the first data variable > for > >>> node i with an element, i from 0 to 3, but I'm not sure how to access > >>> mesh_data from my System. (I should use Linear Implicit System so I can > have > >>> the matrix on the lhs right?) > >>> > >>> My code is based on example 3, and the relevant part is this (not sure > if > >>> it's correct): > >>> > >>> for ( ; el != end_el ; ++el) > >>> { > >>> const Elem* elem = *el; > >>> > >>> dof_map.dof_indices (elem, dof_indices); > >>> > >>> fe>reinit (elem); > >>> > >>> Ke.resize (dof_indices.size(), > >>> dof_indices.size()); > >>> > >>> Fe.resize (dof_indices.size()); > >>> > >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) > >>> { > >>> > >>> for (unsigned int i=0; i<phi.size(); i++) > >>> for (unsigned int j=0; j<phi.size(); j++) > >>> { > >>> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); > >>> } > >>> > >>> { > >>> for (unsigned int i=0; i<phi.size(); i++) > >>> { > >>> for (unsigned int k=0; k<phi.size(); k++) > >>> { > >>> Fe(i) += > >>> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; > >>> > >>> } > >>> } > >>> } > >>> .... > >>> > >>> The other question is, for Fe, do I integrate over all the quadrature > >>> points of phi_i and phi_j with f_i being a constant? > >>> > >>> Then once I get this solution (the variable name is "R", let's say), I > >>> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] and > do > >>> something like this (of course this is another system that I'm adding > to > >>> EquationSystems): > >>> > >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) > >>> { > >>> > >>> for (unsigned int i=0; i<phi.size(); i++) > >>> > >>> > >>> for (unsigned int j=0; j<phi.size(); j++) > >>> { > >>> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); > >>> > >>> > >>> } > >>> > >>> { > >>> const Real x = q_point[qp](0); > >>> const Real y = q_point[qp](1); > >>> const Real z = q_point[qp](2); > >>> > >>> > >>> > >>> > >>> const Real fxy = R(x,y,z); > >>> > >>> for (unsigned int i=0; i<phi.size(); i++) > >>> > >>> > >>> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; > >>> } > >>> } > >>> > >>> I'm not sure how to access anything in a Variable object though... > Let's > >>> say "R" being a a variable I add to the first system to get the RHS > >>> interpolation, and "u" is the variable I add to the second equation > system, > >>> which is the actual solution I'm after... I just know that I can > output the > >>> values of the solution at various nodal points in a file, but am not > sure > >>> what to do with the data structure and how I can extract values at > different > >>> arbitrary locations. > >>> > >>> Apologies for the lengthy email... > >>> > >>> Thanks, > >>> Karen > >>> > >>> > >>> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath < > rahul.sampath@...> > >>> wrote: > >>>> > >>>> Hi Karen: > >>>> > >>>> Take a look at any Nonlinear example problem. Whenever you want to use > >>>> any solution vector in your residual computation, you will need to > >>>> interpolate the nodal values using the FEM shape functions for this > >>>> element and then do the integration. It is very similar to what you > >>>> want to do. That is why I suggested the Mass matrix trick. It is very > >>>> simple to implement and fast too especially if you want to change f > >>>> often. You can use the same Mass matrix with differen f. The catch is > >>>> that you are using your FE shape functions for your interpolation. As > >>>> long as you are happy with linear interpolation for f this should do. > >>>> If you want to interpolate f with a higher order polynomial than your > >>>> FE shape function then this wont work. > >>>> > >>>> Btw, if I was not clear earlier: > >>>> You have to form a global Mass matrix by integrating phi_i phi_j over > >>>> all elements and doing a typically FEM assembly. Then you can simply > >>>> multiply this global Mass matrix with you global nodal vector for f. > >>>> > >>>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> > wrote: > >>>> > Hi Rahul, I'm not completely sure what you mean. > >>>> > > >>>> > I would like to form my RHS by integrating f_i Phi_i (I guess > there's > >>>> > no > >>>> > need to multiply Phi_j? But you can correct me) for each element. > >>>> > > >>>> > In order to do so, I need values of f at various quadrature points. > I > >>>> > have f > >>>> > at various nodal values. The question is, how do I get this linear > >>>> > interpolation... > >>>> > > >>>> > Do you mean that, for each element, I form the mass matrix by the > xyz > >>>> > values > >>>> > of the nodes (and a constant 1) and solve for the coefficient by > saying > >>>> > \sum_j A_ij y_j= f_i, where: > >>>> > > >>>> > A = [1 x1 y1 z1; > >>>> > 1 x2 y2 z2; > >>>> > 1 x3 y3 z3; > >>>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 > corresponds > >>>> > to > >>>> > the constant value, and 2, 3, 4 corresponds to the gradient in the > x, > >>>> > y, z > >>>> > directions respectively)? > >>>> > > >>>> > Thanks, > >>>> > Karen > >>>> > > >>>> > > >>>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath > >>>> > <rahul.sampath@...> > >>>> > wrote: > >>>> >> > >>>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could > >>>> >> form a Mass matrix and then multiply with your vector of nodal > values. > >>>> >> > >>>> >> Rahul > >>>> >> > >>>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> > >>>> >> wrote: > >>>> >> > I'm afraid you misunderstood. I don't have the function that when > >>>> >> > given > >>>> >> > x, > >>>> >> > y, z values gives me the function value. What I do have is just > the > >>>> >> > values > >>>> >> > at the nodes of the mesh, which need to be linearly interpolated > >>>> >> > such > >>>> >> > that I > >>>> >> > will have something like exact_function. which gives me the value > >>>> >> > when > >>>> >> > supplied with any x, y, z. > >>>> >> > > >>>> >> > > >>>> >> > > >>>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> > wrote: > >>>> >> > > >>>> >> >> Karen Lee wrote: > >>>> >> >> > >>>> >> >>> I guess I'm not clear how to do this: Load data as a solution > into > >>>> >> >>> that, > >>>> >> >>> and > >>>> >> >>> query > >>>> >> >>> it when you're integrating your real system. > >>>> >> >>> > >>>> >> >>> I have: > >>>> >> >>> Mesh mesh(3); > >>>> >> >>> MeshData mesh_data(mesh); > >>>> >> >>> mesh_data.activate(); > >>>> >> >>> mesh.read (mesh_file, &mesh_data); > >>>> >> >>> mesh_data.read(mesh_file); > >>>> >> >>> EquationSystems equation_systems (mesh); > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); > >>>> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); > >>>> >> >>> > >>>> >> >>> After that, I'm not clear how exactly to load data as a > solution > >>>> >> >>> in > >>>> >> >>> the > >>>> >> >>> code. My goal is to get a linearly interpolated function of my > >>>> >> >>> data on > >>>> >> >>> the > >>>> >> >>> nodes (in the form of exact_solution, such that I get the > function > >>>> >> >>> value > >>>> >> >>> out > >>>> >> >>> when supplying x, y and z). > >>>> >> >>> > >>>> >> >>> Hope that clarifies things, and sorry for the multiple > emails... > >>>> >> >>> > >>>> >> >>> Karen > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> >  > >>>> >> >>> Download Intel® Parallel Studio Eval > >>>> >> >>> Try the new software tools for yourself. Speed compiling, find > >>>> >> >>> bugs > >>>> >> >>> proactively, and finetune applications for parallel > performance. > >>>> >> >>> See why Intel Parallel Studio got high marks during beta. > >>>> >> >>> http://p.sf.net/sfu/intelswdev > >>>> >> >>> _______________________________________________ > >>>> >> >>> Libmeshusers mailing list > >>>> >> >>> Libmeshusers@... > >>>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> > >>>> >> >> so you already have the function, which is obtained from your > >>>> >> >> discreted > >>>> >> >> data? > >>>> >> >> then just put the function as the exact_function. > >>>> >> >> I think you are trying the 3D case, start from a 2d will be > easier. > >>>> >> >> > >>>> >> >> Liang > >>>> >> >> > >>>> >> > > >>>> >> > > >>>> >> > >  > >>>> >> > Download Intel® Parallel Studio Eval > >>>> >> > Try the new software tools for yourself. Speed compiling, find > bugs > >>>> >> > proactively, and finetune applications for parallel performance. > >>>> >> > See why Intel Parallel Studio got high marks during beta. > >>>> >> > http://p.sf.net/sfu/intelswdev > >>>> >> > _______________________________________________ > >>>> >> > Libmeshusers mailing list > >>>> >> > Libmeshusers@... > >>>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers > >>>> >> > > >>>> > > >>>> > > >>> > >> > >> > > > 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 21:24:05

To be more precise: GlobalMassMatrix = Sum_over_elements{ integral_over_current_element_using_quadrature(phi_i*phi_j) } GlobalRHS = GlobalMassMatrix*Nodal_F_Vector On Fri, Mar 26, 2010 at 5:22 PM, Rahul Sampath <rahul.sampath@...> wrote: > This is what I meant: > > MassMatrix = integral(phi_i*phi_j) > > RHS = MassMatrix*Nodal_F_Vector > > > On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> wrote: >> Sorry, I think I was probably confused. I guess you just meant that I can >> simply use integral of f_i phi_i phi_j as my RHS, and my original LHS as my >> LHS, and that would already be effectively an interpolation? Please let me >> know if this is the correct way to think about it instead of the long >> message I sent with lots of code... >> >> My 2 questions regarding access to data would still remain: >> >> 1) I am still having problems accessing MeshData from the assemble >> function. I would like to do something like >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable for >> node i with an element, i from 0 to 3, but I'm not sure how to access >> mesh_data from my System. (I should use Linear Implicit System so I can have >> the matrix on the lhs right?) >> >> 2) The other question is, for Fe, do I integrate over all the quadrature >> points of phi_i and phi_j with f_i being a constant? >> >> Thank you so much!!! >> Karen >> >> >> On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> wrote: >>> >>> Thanks Rahul. Your responses have clarified things for me. >>> >>> I am still having problems accessing MeshData from the assemble function >>> (which is only supposed to have 2 arguments right?) >>> >>> I can do: >>> >>> void assemble_load(EquationSystems& es, >>> const std::string& system_name) >>> { >>> >>> libmesh_assert (system_name == "load"); >>> >>> >>> const MeshBase& mesh = es.get_mesh(); >>> printf("mesh_data obtained"); >>> >>> ...... >>> >>> But I'm not sure how I can get the MeshData object that I created in main >>> that's attached to the mesh I created. In the look iterating over the >>> elements el, I know that I have to use something like >>> mesh_data.get_data(el.get_node(i))[0] to get the first data variable for >>> node i with an element, i from 0 to 3, but I'm not sure how to access >>> mesh_data from my System. (I should use Linear Implicit System so I can have >>> the matrix on the lhs right?) >>> >>> My code is based on example 3, and the relevant part is this (not sure if >>> it's correct): >>> >>> for ( ; el != end_el ; ++el) >>> { >>> const Elem* elem = *el; >>> >>> dof_map.dof_indices (elem, dof_indices); >>> >>> fe>reinit (elem); >>> >>> Ke.resize (dof_indices.size(), >>> dof_indices.size()); >>> >>> Fe.resize (dof_indices.size()); >>> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >>> { >>> >>> for (unsigned int i=0; i<phi.size(); i++) >>> for (unsigned int j=0; j<phi.size(); j++) >>> { >>> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); >>> } >>> >>> { >>> for (unsigned int i=0; i<phi.size(); i++) >>> { >>> for (unsigned int k=0; k<phi.size(); k++) >>> { >>> Fe(i) += >>> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; >>> >>> } >>> } >>> } >>> .... >>> >>> The other question is, for Fe, do I integrate over all the quadrature >>> points of phi_i and phi_j with f_i being a constant? >>> >>> Then once I get this solution (the variable name is "R", let's say), I >>> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] and do >>> something like this (of course this is another system that I'm adding to >>> EquationSystems): >>> >>> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >>> { >>> >>> for (unsigned int i=0; i<phi.size(); i++) >>> >>> >>> for (unsigned int j=0; j<phi.size(); j++) >>> { >>> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); >>> >>> >>> } >>> >>> { >>> const Real x = q_point[qp](0); >>> const Real y = q_point[qp](1); >>> const Real z = q_point[qp](2); >>> >>> >>> >>> >>> const Real fxy = R(x,y,z); >>> >>> for (unsigned int i=0; i<phi.size(); i++) >>> >>> >>> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; >>> } >>> } >>> >>> I'm not sure how to access anything in a Variable object though... Let's >>> say "R" being a a variable I add to the first system to get the RHS >>> interpolation, and "u" is the variable I add to the second equation system, >>> which is the actual solution I'm after... I just know that I can output the >>> values of the solution at various nodal points in a file, but am not sure >>> what to do with the data structure and how I can extract values at different >>> arbitrary locations. >>> >>> Apologies for the lengthy email... >>> >>> Thanks, >>> Karen >>> >>> >>> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath <rahul.sampath@...> >>> wrote: >>>> >>>> Hi Karen: >>>> >>>> Take a look at any Nonlinear example problem. Whenever you want to use >>>> any solution vector in your residual computation, you will need to >>>> interpolate the nodal values using the FEM shape functions for this >>>> element and then do the integration. It is very similar to what you >>>> want to do. That is why I suggested the Mass matrix trick. It is very >>>> simple to implement and fast too especially if you want to change f >>>> often. You can use the same Mass matrix with differen f. The catch is >>>> that you are using your FE shape functions for your interpolation. As >>>> long as you are happy with linear interpolation for f this should do. >>>> If you want to interpolate f with a higher order polynomial than your >>>> FE shape function then this wont work. >>>> >>>> Btw, if I was not clear earlier: >>>> You have to form a global Mass matrix by integrating phi_i phi_j over >>>> all elements and doing a typically FEM assembly. Then you can simply >>>> multiply this global Mass matrix with you global nodal vector for f. >>>> >>>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: >>>> > Hi Rahul, I'm not completely sure what you mean. >>>> > >>>> > I would like to form my RHS by integrating f_i Phi_i (I guess there's >>>> > no >>>> > need to multiply Phi_j? But you can correct me) for each element. >>>> > >>>> > In order to do so, I need values of f at various quadrature points. I >>>> > have f >>>> > at various nodal values. The question is, how do I get this linear >>>> > interpolation... >>>> > >>>> > Do you mean that, for each element, I form the mass matrix by the xyz >>>> > values >>>> > of the nodes (and a constant 1) and solve for the coefficient by saying >>>> > \sum_j A_ij y_j= f_i, where: >>>> > >>>> > A = [1 x1 y1 z1; >>>> > 1 x2 y2 z2; >>>> > 1 x3 y3 z3; >>>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds >>>> > to >>>> > the constant value, and 2, 3, 4 corresponds to the gradient in the x, >>>> > y, z >>>> > directions respectively)? >>>> > >>>> > Thanks, >>>> > Karen >>>> > >>>> > >>>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath >>>> > <rahul.sampath@...> >>>> > wrote: >>>> >> >>>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could >>>> >> form a Mass matrix and then multiply with your vector of nodal values. >>>> >> >>>> >> Rahul >>>> >> >>>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> >>>> >> wrote: >>>> >> > I'm afraid you misunderstood. I don't have the function that when >>>> >> > given >>>> >> > x, >>>> >> > y, z values gives me the function value. What I do have is just the >>>> >> > values >>>> >> > at the nodes of the mesh, which need to be linearly interpolated >>>> >> > such >>>> >> > that I >>>> >> > will have something like exact_function. which gives me the value >>>> >> > when >>>> >> > supplied with any x, y, z. >>>> >> > >>>> >> > >>>> >> > >>>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: >>>> >> > >>>> >> >> Karen Lee wrote: >>>> >> >> >>>> >> >>> I guess I'm not clear how to do this: Load data as a solution into >>>> >> >>> that, >>>> >> >>> and >>>> >> >>> query >>>> >> >>> it when you're integrating your real system. >>>> >> >>> >>>> >> >>> I have: >>>> >> >>> Mesh mesh(3); >>>> >> >>> MeshData mesh_data(mesh); >>>> >> >>> mesh_data.activate(); >>>> >> >>> mesh.read (mesh_file, &mesh_data); >>>> >> >>> mesh_data.read(mesh_file); >>>> >> >>> EquationSystems equation_systems (mesh); >>>> >> >>> >>>> >> >>> >>>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >>>> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >>>> >> >>> >>>> >> >>> After that, I'm not clear how exactly to load data as a solution >>>> >> >>> in >>>> >> >>> the >>>> >> >>> code. My goal is to get a linearly interpolated function of my >>>> >> >>> data on >>>> >> >>> the >>>> >> >>> nodes (in the form of exact_solution, such that I get the function >>>> >> >>> value >>>> >> >>> out >>>> >> >>> when supplying x, y and z). >>>> >> >>> >>>> >> >>> Hope that clarifies things, and sorry for the multiple emails... >>>> >> >>> >>>> >> >>> Karen >>>> >> >>> >>>> >> >>> >>>> >> >>> >>>> >> >>>  >>>> >> >>> Download Intel® Parallel Studio Eval >>>> >> >>> Try the new software tools for yourself. Speed compiling, find >>>> >> >>> bugs >>>> >> >>> proactively, and finetune applications for parallel performance. >>>> >> >>> See why Intel Parallel Studio got high marks during beta. >>>> >> >>> http://p.sf.net/sfu/intelswdev >>>> >> >>> _______________________________________________ >>>> >> >>> Libmeshusers mailing list >>>> >> >>> Libmeshusers@... >>>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >>>> >> >>> >>>> >> >>> >>>> >> >>> >>>> >> >> so you already have the function, which is obtained from your >>>> >> >> discreted >>>> >> >> data? >>>> >> >> then just put the function as the exact_function. >>>> >> >> I think you are trying the 3D case, start from a 2d will be easier. >>>> >> >> >>>> >> >> Liang >>>> >> >> >>>> >> > >>>> >> > >>>> >> >  >>>> >> > Download Intel® Parallel Studio Eval >>>> >> > Try the new software tools for yourself. Speed compiling, find bugs >>>> >> > proactively, and finetune applications for parallel performance. >>>> >> > See why Intel Parallel Studio got high marks during beta. >>>> >> > http://p.sf.net/sfu/intelswdev >>>> >> > _______________________________________________ >>>> >> > Libmeshusers mailing list >>>> >> > Libmeshusers@... >>>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >>>> >> > >>>> > >>>> > >>> >> >> > 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 21:22:32

This is what I meant: MassMatrix = integral(phi_i*phi_j) RHS = MassMatrix*Nodal_F_Vector On Fri, Mar 26, 2010 at 5:11 PM, Karen Lee <kylkaren@...> wrote: > Sorry, I think I was probably confused. I guess you just meant that I can > simply use integral of f_i phi_i phi_j as my RHS, and my original LHS as my > LHS, and that would already be effectively an interpolation? Please let me > know if this is the correct way to think about it instead of the long > message I sent with lots of code... > > My 2 questions regarding access to data would still remain: > > 1) I am still having problems accessing MeshData from the assemble > function. I would like to do something like > mesh_data.get_data(el.get_node(i))[0] to get the first data variable for > node i with an element, i from 0 to 3, but I'm not sure how to access > mesh_data from my System. (I should use Linear Implicit System so I can have > the matrix on the lhs right?) > > 2) The other question is, for Fe, do I integrate over all the quadrature > points of phi_i and phi_j with f_i being a constant? > > Thank you so much!!! > Karen > > > On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> wrote: >> >> Thanks Rahul. Your responses have clarified things for me. >> >> I am still having problems accessing MeshData from the assemble function >> (which is only supposed to have 2 arguments right?) >> >> I can do: >> >> void assemble_load(EquationSystems& es, >> const std::string& system_name) >> { >> >> libmesh_assert (system_name == "load"); >> >> >> const MeshBase& mesh = es.get_mesh(); >> printf("mesh_data obtained"); >> >> ...... >> >> But I'm not sure how I can get the MeshData object that I created in main >> that's attached to the mesh I created. In the look iterating over the >> elements el, I know that I have to use something like >> mesh_data.get_data(el.get_node(i))[0] to get the first data variable for >> node i with an element, i from 0 to 3, but I'm not sure how to access >> mesh_data from my System. (I should use Linear Implicit System so I can have >> the matrix on the lhs right?) >> >> My code is based on example 3, and the relevant part is this (not sure if >> it's correct): >> >> for ( ; el != end_el ; ++el) >> { >> const Elem* elem = *el; >> >> dof_map.dof_indices (elem, dof_indices); >> >> fe>reinit (elem); >> >> Ke.resize (dof_indices.size(), >> dof_indices.size()); >> >> Fe.resize (dof_indices.size()); >> >> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> { >> >> for (unsigned int i=0; i<phi.size(); i++) >> for (unsigned int j=0; j<phi.size(); j++) >> { >> Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); >> } >> >> { >> for (unsigned int i=0; i<phi.size(); i++) >> { >> for (unsigned int k=0; k<phi.size(); k++) >> { >> Fe(i) += >> JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; >> >> } >> } >> } >> .... >> >> The other question is, for Fe, do I integrate over all the quadrature >> points of phi_i and phi_j with f_i being a constant? >> >> Then once I get this solution (the variable name is "R", let's say), I >> hope to use it in place of mesh_data.get_data(el.get_node(k))[0] and do >> something like this (of course this is another system that I'm adding to >> EquationSystems): >> >> for (unsigned int qp=0; qp<qrule.n_points(); qp++) >> { >> >> for (unsigned int i=0; i<phi.size(); i++) >> >> >> for (unsigned int j=0; j<phi.size(); j++) >> { >> Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); >> >> >> } >> >> { >> const Real x = q_point[qp](0); >> const Real y = q_point[qp](1); >> const Real z = q_point[qp](2); >> >> >> >> >> const Real fxy = R(x,y,z); >> >> for (unsigned int i=0; i<phi.size(); i++) >> >> >> Fe2(i) += JxW[qp]*fxy*phi[i][qp]; >> } >> } >> >> I'm not sure how to access anything in a Variable object though... Let's >> say "R" being a a variable I add to the first system to get the RHS >> interpolation, and "u" is the variable I add to the second equation system, >> which is the actual solution I'm after... I just know that I can output the >> values of the solution at various nodal points in a file, but am not sure >> what to do with the data structure and how I can extract values at different >> arbitrary locations. >> >> Apologies for the lengthy email... >> >> Thanks, >> Karen >> >> >> On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath <rahul.sampath@...> >> wrote: >>> >>> Hi Karen: >>> >>> Take a look at any Nonlinear example problem. Whenever you want to use >>> any solution vector in your residual computation, you will need to >>> interpolate the nodal values using the FEM shape functions for this >>> element and then do the integration. It is very similar to what you >>> want to do. That is why I suggested the Mass matrix trick. It is very >>> simple to implement and fast too especially if you want to change f >>> often. You can use the same Mass matrix with differen f. The catch is >>> that you are using your FE shape functions for your interpolation. As >>> long as you are happy with linear interpolation for f this should do. >>> If you want to interpolate f with a higher order polynomial than your >>> FE shape function then this wont work. >>> >>> Btw, if I was not clear earlier: >>> You have to form a global Mass matrix by integrating phi_i phi_j over >>> all elements and doing a typically FEM assembly. Then you can simply >>> multiply this global Mass matrix with you global nodal vector for f. >>> >>> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: >>> > Hi Rahul, I'm not completely sure what you mean. >>> > >>> > I would like to form my RHS by integrating f_i Phi_i (I guess there's >>> > no >>> > need to multiply Phi_j? But you can correct me) for each element. >>> > >>> > In order to do so, I need values of f at various quadrature points. I >>> > have f >>> > at various nodal values. The question is, how do I get this linear >>> > interpolation... >>> > >>> > Do you mean that, for each element, I form the mass matrix by the xyz >>> > values >>> > of the nodes (and a constant 1) and solve for the coefficient by saying >>> > \sum_j A_ij y_j= f_i, where: >>> > >>> > A = [1 x1 y1 z1; >>> > 1 x2 y2 z2; >>> > 1 x3 y3 z3; >>> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds >>> > to >>> > the constant value, and 2, 3, 4 corresponds to the gradient in the x, >>> > y, z >>> > directions respectively)? >>> > >>> > Thanks, >>> > Karen >>> > >>> > >>> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath >>> > <rahul.sampath@...> >>> > wrote: >>> >> >>> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could >>> >> form a Mass matrix and then multiply with your vector of nodal values. >>> >> >>> >> Rahul >>> >> >>> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> >>> >> wrote: >>> >> > I'm afraid you misunderstood. I don't have the function that when >>> >> > given >>> >> > x, >>> >> > y, z values gives me the function value. What I do have is just the >>> >> > values >>> >> > at the nodes of the mesh, which need to be linearly interpolated >>> >> > such >>> >> > that I >>> >> > will have something like exact_function. which gives me the value >>> >> > when >>> >> > supplied with any x, y, z. >>> >> > >>> >> > >>> >> > >>> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: >>> >> > >>> >> >> Karen Lee wrote: >>> >> >> >>> >> >>> I guess I'm not clear how to do this: Load data as a solution into >>> >> >>> that, >>> >> >>> and >>> >> >>> query >>> >> >>> it when you're integrating your real system. >>> >> >>> >>> >> >>> I have: >>> >> >>> Mesh mesh(3); >>> >> >>> MeshData mesh_data(mesh); >>> >> >>> mesh_data.activate(); >>> >> >>> mesh.read (mesh_file, &mesh_data); >>> >> >>> mesh_data.read(mesh_file); >>> >> >>> EquationSystems equation_systems (mesh); >>> >> >>> >>> >> >>> >>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >>> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >>> >> >>> >>> >> >>> After that, I'm not clear how exactly to load data as a solution >>> >> >>> in >>> >> >>> the >>> >> >>> code. My goal is to get a linearly interpolated function of my >>> >> >>> data on >>> >> >>> the >>> >> >>> nodes (in the form of exact_solution, such that I get the function >>> >> >>> value >>> >> >>> out >>> >> >>> when supplying x, y and z). >>> >> >>> >>> >> >>> Hope that clarifies things, and sorry for the multiple emails... >>> >> >>> >>> >> >>> Karen >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>>  >>> >> >>> Download Intel® Parallel Studio Eval >>> >> >>> Try the new software tools for yourself. Speed compiling, find >>> >> >>> bugs >>> >> >>> proactively, and finetune applications for parallel performance. >>> >> >>> See why Intel Parallel Studio got high marks during beta. >>> >> >>> http://p.sf.net/sfu/intelswdev >>> >> >>> _______________________________________________ >>> >> >>> Libmeshusers mailing list >>> >> >>> Libmeshusers@... >>> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >> so you already have the function, which is obtained from your >>> >> >> discreted >>> >> >> data? >>> >> >> then just put the function as the exact_function. >>> >> >> I think you are trying the 3D case, start from a 2d will be easier. >>> >> >> >>> >> >> Liang >>> >> >> >>> >> > >>> >> > >>> >> >  >>> >> > Download Intel® Parallel Studio Eval >>> >> > Try the new software tools for yourself. Speed compiling, find bugs >>> >> > proactively, and finetune applications for parallel performance. >>> >> > See why Intel Parallel Studio got high marks during beta. >>> >> > http://p.sf.net/sfu/intelswdev >>> >> > _______________________________________________ >>> >> > Libmeshusers mailing list >>> >> > Libmeshusers@... >>> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >>> >> > >>> > >>> > >> > > 
From: Karen Lee <kylkaren@gm...>  20100326 21:11:52

Sorry, I think I was probably confused. I guess you just meant that I can simply use integral of f_i phi_i phi_j as my RHS, and my original LHS as my LHS, and that would already be effectively an interpolation? Please let me know if this is the correct way to think about it instead of the long message I sent with lots of code... My 2 questions regarding access to data would still remain: 1) I am still having problems accessing MeshData from the assemble function. I would like to do something like mesh_data.get_data(el.get_node(i))[0] to get the first data variable for node i with an element, i from 0 to 3, but I'm not sure how to access mesh_data from my System. (I should use Linear Implicit System so I can have the matrix on the lhs right?) 2) The other question is, for Fe, do I integrate over all the quadrature points of phi_i and phi_j with f_i being a constant? Thank you so much!!! Karen On Fri, Mar 26, 2010 at 4:57 PM, Karen Lee <kylkaren@...> wrote: > Thanks Rahul. Your responses have clarified things for me. > > I am still having problems accessing MeshData from the assemble function > (which is only supposed to have 2 arguments right?) > > I can do: > > void assemble_load(EquationSystems& es, > const std::string& system_name) > { > > libmesh_assert (system_name == "load"); > > > const MeshBase& mesh = es.get_mesh(); > printf("mesh_data obtained"); > > ...... > > But I'm not sure how I can get the MeshData object that I created in main > that's attached to the mesh I created. In the look iterating over the > elements el, I know that I have to use something like > mesh_data.get_data(el.get_node(i))[0] to get the first data variable for > node i with an element, i from 0 to 3, but I'm not sure how to access > mesh_data from my System. (I should use Linear Implicit System so I can have > the matrix on the lhs right?) > > My code is based on example 3, and the relevant part is this (not sure if > it's correct): > > for ( ; el != end_el ; ++el) > { > const Elem* elem = *el; > > dof_map.dof_indices (elem, dof_indices); > > fe>reinit (elem); > > Ke.resize (dof_indices.size(), > dof_indices.size()); > > Fe.resize (dof_indices.size()); > > > for (unsigned int qp=0; qp<qrule.n_points(); qp++) > { > > for (unsigned int i=0; i<phi.size(); i++) > for (unsigned int j=0; j<phi.size(); j++) > { > Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); > } > > { > for (unsigned int i=0; i<phi.size(); i++) > { > for (unsigned int k=0; k<phi.size(); k++) > { > Fe(i) += > JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; > > } > } > } > .... > > The other question is, for Fe, do I integrate over all the quadrature > points of phi_i and phi_j with f_i being a constant? > > Then once I get this solution (the variable name is "R", let's say), I hope > to use it in place of mesh_data.get_data(el.get_node(k))[0] and do > something like this (of course this is another system that I'm adding to > EquationSystems): > > *for* (*unsigned* *int* qp=0; qp<qrule.n_points(); qp++) > { > > *for* (*unsigned* *int* i=0; i<phi.size(); i++) > > *for* (*unsigned* *int* j=0; j<phi.size(); j++) > { > Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); > > > } > > { > *const* Real x = q_point[qp](0); > *const* Real y = q_point[qp](1); > *const* Real z = q_point[qp](2); > > > > *const* Real fxy = R(x,y,z); > > > *for* (*unsigned* *int* i=0; i<phi.size(); i++) > > Fe2(i) += JxW[qp]*fxy*phi[i][qp]; > } > } > > > I'm not sure how to access anything in a Variable object though... Let's > say "R" being a a variable I add to the first system to get the RHS > interpolation, and "u" is the variable I add to the second equation system, > which is the actual solution I'm after... I just know that I can output the > values of the solution at various nodal points in a file, but am not sure > what to do with the data structure and how I can extract values at different > arbitrary locations. > > Apologies for the lengthy email... > > Thanks, > Karen > > > > On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath <rahul.sampath@...>wrote: > >> Hi Karen: >> >> Take a look at any Nonlinear example problem. Whenever you want to use >> any solution vector in your residual computation, you will need to >> interpolate the nodal values using the FEM shape functions for this >> element and then do the integration. It is very similar to what you >> want to do. That is why I suggested the Mass matrix trick. It is very >> simple to implement and fast too especially if you want to change f >> often. You can use the same Mass matrix with differen f. The catch is >> that you are using your FE shape functions for your interpolation. As >> long as you are happy with linear interpolation for f this should do. >> If you want to interpolate f with a higher order polynomial than your >> FE shape function then this wont work. >> >> Btw, if I was not clear earlier: >> You have to form a global Mass matrix by integrating phi_i phi_j over >> all elements and doing a typically FEM assembly. Then you can simply >> multiply this global Mass matrix with you global nodal vector for f. >> >> On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: >> > Hi Rahul, I'm not completely sure what you mean. >> > >> > I would like to form my RHS by integrating f_i Phi_i (I guess there's no >> > need to multiply Phi_j? But you can correct me) for each element. >> > >> > In order to do so, I need values of f at various quadrature points. I >> have f >> > at various nodal values. The question is, how do I get this linear >> > interpolation... >> > >> > Do you mean that, for each element, I form the mass matrix by the xyz >> values >> > of the nodes (and a constant 1) and solve for the coefficient by saying >> > \sum_j A_ij y_j= f_i, where: >> > >> > A = [1 x1 y1 z1; >> > 1 x2 y2 z2; >> > 1 x3 y3 z3; >> > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds >> to >> > the constant value, and 2, 3, 4 corresponds to the gradient in the x, y, >> z >> > directions respectively)? >> > >> > Thanks, >> > Karen >> > >> > >> > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath < >> rahul.sampath@...> >> > wrote: >> >> >> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could >> >> form a Mass matrix and then multiply with your vector of nodal values. >> >> >> >> Rahul >> >> >> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> >> wrote: >> >> > I'm afraid you misunderstood. I don't have the function that when >> given >> >> > x, >> >> > y, z values gives me the function value. What I do have is just the >> >> > values >> >> > at the nodes of the mesh, which need to be linearly interpolated such >> >> > that I >> >> > will have something like exact_function. which gives me the value >> when >> >> > supplied with any x, y, z. >> >> > >> >> > >> >> > >> >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: >> >> > >> >> >> Karen Lee wrote: >> >> >> >> >> >>> I guess I'm not clear how to do this: Load data as a solution into >> >> >>> that, >> >> >>> and >> >> >>> query >> >> >>> it when you're integrating your real system. >> >> >>> >> >> >>> I have: >> >> >>> Mesh mesh(3); >> >> >>> MeshData mesh_data(mesh); >> >> >>> mesh_data.activate(); >> >> >>> mesh.read (mesh_file, &mesh_data); >> >> >>> mesh_data.read(mesh_file); >> >> >>> EquationSystems equation_systems (mesh); >> >> >>> >> >> >>> >> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >> >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >> >> >>> >> >> >>> After that, I'm not clear how exactly to load data as a solution in >> >> >>> the >> >> >>> code. My goal is to get a linearly interpolated function of my data >> on >> >> >>> the >> >> >>> nodes (in the form of exact_solution, such that I get the function >> >> >>> value >> >> >>> out >> >> >>> when supplying x, y and z). >> >> >>> >> >> >>> Hope that clarifies things, and sorry for the multiple emails... >> >> >>> >> >> >>> Karen >> >> >>> >> >> >>> >> >> >>> >>  >> >> >>> Download Intel® Parallel Studio Eval >> >> >>> Try the new software tools for yourself. Speed compiling, find bugs >> >> >>> proactively, and finetune applications for parallel performance. >> >> >>> See why Intel Parallel Studio got high marks during beta. >> >> >>> http://p.sf.net/sfu/intelswdev >> >> >>> _______________________________________________ >> >> >>> Libmeshusers mailing list >> >> >>> Libmeshusers@... >> >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >> >>> >> >> >>> >> >> >>> >> >> >> so you already have the function, which is obtained from your >> discreted >> >> >> data? >> >> >> then just put the function as the exact_function. >> >> >> I think you are trying the 3D case, start from a 2d will be easier. >> >> >> >> >> >> Liang >> >> >> >> >> > >> >> > >>  >> >> > Download Intel® Parallel Studio Eval >> >> > Try the new software tools for yourself. Speed compiling, find bugs >> >> > proactively, and finetune applications for parallel performance. >> >> > See why Intel Parallel Studio got high marks during beta. >> >> > http://p.sf.net/sfu/intelswdev >> >> > _______________________________________________ >> >> > Libmeshusers mailing list >> >> > Libmeshusers@... >> >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >> > >> > >> > >> > > 
From: Karen Lee <kylkaren@gm...>  20100326 20:57:23

Thanks Rahul. Your responses have clarified things for me. I am still having problems accessing MeshData from the assemble function (which is only supposed to have 2 arguments right?) I can do: void assemble_load(EquationSystems& es, const std::string& system_name) { libmesh_assert (system_name == "load"); const MeshBase& mesh = es.get_mesh(); printf("mesh_data obtained"); ...... But I'm not sure how I can get the MeshData object that I created in main that's attached to the mesh I created. In the look iterating over the elements el, I know that I have to use something like mesh_data.get_data(el.get_node(i))[0] to get the first data variable for node i with an element, i from 0 to 3, but I'm not sure how to access mesh_data from my System. (I should use Linear Implicit System so I can have the matrix on the lhs right?) My code is based on example 3, and the relevant part is this (not sure if it's correct): for ( ; el != end_el ; ++el) { const Elem* elem = *el; dof_map.dof_indices (elem, dof_indices); fe>reinit (elem); Ke.resize (dof_indices.size(), dof_indices.size()); Fe.resize (dof_indices.size()); for (unsigned int qp=0; qp<qrule.n_points(); qp++) { for (unsigned int i=0; i<phi.size(); i++) for (unsigned int j=0; j<phi.size(); j++) { Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); } { for (unsigned int i=0; i<phi.size(); i++) { for (unsigned int k=0; k<phi.size(); k++) { Fe(i) += JxW[qp]*mesh_data.get_data(el.get_node(k))[0]*phi[i][qp]phi[k][qp]; } } } .... The other question is, for Fe, do I integrate over all the quadrature points of phi_i and phi_j with f_i being a constant? Then once I get this solution (the variable name is "R", let's say), I hope to use it in place of mesh_data.get_data(el.get_node(k))[0] and do something like this (of course this is another system that I'm adding to EquationSystems): *for* (*unsigned* *int* qp=0; qp<qrule.n_points(); qp++) { *for* (*unsigned* *int* i=0; i<phi.size(); i++) *for* (*unsigned* *int* j=0; j<phi.size(); j++) { Ke2(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]); } { *const* Real x = q_point[qp](0); *const* Real y = q_point[qp](1); *const* Real z = q_point[qp](2); *const* Real fxy = R(x,y,z); *for* (*unsigned* *int* i=0; i<phi.size(); i++) Fe2(i) += JxW[qp]*fxy*phi[i][qp]; } } I'm not sure how to access anything in a Variable object though... Let's say "R" being a a variable I add to the first system to get the RHS interpolation, and "u" is the variable I add to the second equation system, which is the actual solution I'm after... I just know that I can output the values of the solution at various nodal points in a file, but am not sure what to do with the data structure and how I can extract values at different arbitrary locations. Apologies for the lengthy email... Thanks, Karen On Fri, Mar 26, 2010 at 9:15 AM, Rahul Sampath <rahul.sampath@...>wrote: > Hi Karen: > > Take a look at any Nonlinear example problem. Whenever you want to use > any solution vector in your residual computation, you will need to > interpolate the nodal values using the FEM shape functions for this > element and then do the integration. It is very similar to what you > want to do. That is why I suggested the Mass matrix trick. It is very > simple to implement and fast too especially if you want to change f > often. You can use the same Mass matrix with differen f. The catch is > that you are using your FE shape functions for your interpolation. As > long as you are happy with linear interpolation for f this should do. > If you want to interpolate f with a higher order polynomial than your > FE shape function then this wont work. > > Btw, if I was not clear earlier: > You have to form a global Mass matrix by integrating phi_i phi_j over > all elements and doing a typically FEM assembly. Then you can simply > multiply this global Mass matrix with you global nodal vector for f. > > On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: > > Hi Rahul, I'm not completely sure what you mean. > > > > I would like to form my RHS by integrating f_i Phi_i (I guess there's no > > need to multiply Phi_j? But you can correct me) for each element. > > > > In order to do so, I need values of f at various quadrature points. I > have f > > at various nodal values. The question is, how do I get this linear > > interpolation... > > > > Do you mean that, for each element, I form the mass matrix by the xyz > values > > of the nodes (and a constant 1) and solve for the coefficient by saying > > \sum_j A_ij y_j= f_i, where: > > > > A = [1 x1 y1 z1; > > 1 x2 y2 z2; > > 1 x3 y3 z3; > > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds > to > > the constant value, and 2, 3, 4 corresponds to the gradient in the x, y, > z > > directions respectively)? > > > > Thanks, > > Karen > > > > > > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath <rahul.sampath@... > > > > wrote: > >> > >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could > >> form a Mass matrix and then multiply with your vector of nodal values. > >> > >> Rahul > >> > >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> wrote: > >> > I'm afraid you misunderstood. I don't have the function that when > given > >> > x, > >> > y, z values gives me the function value. What I do have is just the > >> > values > >> > at the nodes of the mesh, which need to be linearly interpolated such > >> > that I > >> > will have something like exact_function. which gives me the value when > >> > supplied with any x, y, z. > >> > > >> > > >> > > >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: > >> > > >> >> Karen Lee wrote: > >> >> > >> >>> I guess I'm not clear how to do this: Load data as a solution into > >> >>> that, > >> >>> and > >> >>> query > >> >>> it when you're integrating your real system. > >> >>> > >> >>> I have: > >> >>> Mesh mesh(3); > >> >>> MeshData mesh_data(mesh); > >> >>> mesh_data.activate(); > >> >>> mesh.read (mesh_file, &mesh_data); > >> >>> mesh_data.read(mesh_file); > >> >>> EquationSystems equation_systems (mesh); > >> >>> > >> >>> > >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); > >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); > >> >>> > >> >>> After that, I'm not clear how exactly to load data as a solution in > >> >>> the > >> >>> code. My goal is to get a linearly interpolated function of my data > on > >> >>> the > >> >>> nodes (in the form of exact_solution, such that I get the function > >> >>> value > >> >>> out > >> >>> when supplying x, y and z). > >> >>> > >> >>> Hope that clarifies things, and sorry for the multiple emails... > >> >>> > >> >>> Karen > >> >>> > >> >>> > >> >>> >  > >> >>> Download Intel® Parallel Studio Eval > >> >>> Try the new software tools for yourself. Speed compiling, find bugs > >> >>> proactively, and finetune applications for parallel performance. > >> >>> See why Intel Parallel Studio got high marks during beta. > >> >>> http://p.sf.net/sfu/intelswdev > >> >>> _______________________________________________ > >> >>> Libmeshusers mailing list > >> >>> Libmeshusers@... > >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers > >> >>> > >> >>> > >> >>> > >> >> so you already have the function, which is obtained from your > discreted > >> >> data? > >> >> then just put the function as the exact_function. > >> >> I think you are trying the 3D case, start from a 2d will be easier. > >> >> > >> >> Liang > >> >> > >> > > >> > >  > >> > Download Intel® Parallel Studio Eval > >> > Try the new software tools for yourself. Speed compiling, find bugs > >> > proactively, and finetune applications for parallel performance. > >> > See why Intel Parallel Studio got high marks during beta. > >> > http://p.sf.net/sfu/intelswdev > >> > _______________________________________________ > >> > Libmeshusers mailing list > >> > Libmeshusers@... > >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers > >> > > > > > > 
From: John Peterson <peterson@cf...>  20100326 20:48:36

On Fri, Mar 26, 2010 at 3:16 PM, Andrea Hawkins <andjhawkins@...> wrote: > Is there currently an easy way to get the number of newton iterations > from a PETSc solve? I know PETSc used to return it as a value from > SNESSolve, but newer versions require calling SNESGetIterationNumber. > I would call this myself after the solve, but in the libMesh > PetscNonlinearSolver<T>::solve routine it destroys the SNES object > before I can get to the iteration count. I imagine this would be > really easy to add to the library if there isn't a way around it... Yeah, looks like there's currently no easy way. If you'd like to add code somewhere after SNESGetConvergedReason(_snes,&reason); to store the number of iterations, that would be great. Send us the diffs and we'll check it in to the library.  John 
From: Andrea Hawkins <andjhawkins@gm...>  20100326 20:16:41

Is there currently an easy way to get the number of newton iterations from a PETSc solve? I know PETSc used to return it as a value from SNESSolve, but newer versions require calling SNESGetIterationNumber. I would call this myself after the solve, but in the libMesh PetscNonlinearSolver<T>::solve routine it destroys the SNES object before I can get to the iteration count. I imagine this would be really easy to add to the library if there isn't a way around it... Thanks! Andrea 
From: John Peterson <peterson@cf...>  20100326 20:02:11

On Fri, Mar 26, 2010 at 5:54 AM, Pablo Tassi <pablotassi@...> wrote: > Dear libmesh users and developers, > > I am a new user of libmesh and I was wondering if anyone has used libmesh > for the solution of discontinuous Galerkin applications. > > In particular, I'm interested in hyperbolic problems of shallow water type. > > > To avoid reinventing the wheel, I'd like to ask you if there are some > examples or tips for discontinuous finite element applications with libmesh > (non hyperbolic applications could be also useful). Yes, folks have definitely done it before. We don't have an example checked into SVN, but a while back Lorenzo Botti sent a DG version of ex14 to Ben...if he is able to dig it up in his email he can send it on to you.  John 
From: John Peterson <jwpeterson@gm...>  20100326 19:54:59

On Fri, Mar 26, 2010 at 12:00 PM, Cochran, William K. <cochranwk@...> wrote: > > The assert at mesh/mesh_communication.C:1672 > > libmesh_assert (el_id[e] < mesh.n_elem()); > > has a chance of failing in parallel, given the algorithm: > > if proc == 0 > read mesh > broadcast data > prepare_for_use. > > The element ids of the mesh may not be contiguous when the inequality is asserted. In my example, the mesh has 1326 elements. In serial, a particular element e has el_id[e] = 540. On 2 processes, it is el_id[e] = 1532. Thanks for the info, we'll have to look into it. Just to clarify, are you using the Nemesis reader to read split up Exodus files or are you just reading an Exodus file in parallel. It seems that the element IDs should be the same for the exodus reader no matter how many processors there are, but I may be misremembering something.  John 
From: Cochran, William K. <cochranwk@or...>  20100326 17:00:26

The assert at mesh/mesh_communication.C:1672 libmesh_assert (el_id[e] < mesh.n_elem()); has a chance of failing in parallel, given the algorithm: if proc == 0 read mesh broadcast data prepare_for_use. The element ids of the mesh may not be contiguous when the inequality is asserted. In my example, the mesh has 1326 elements. In serial, a particular element e has el_id[e] = 540. On 2 processes, it is el_id[e] = 1532. Thanks, Bill 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 13:15:49

Hi Karen: Take a look at any Nonlinear example problem. Whenever you want to use any solution vector in your residual computation, you will need to interpolate the nodal values using the FEM shape functions for this element and then do the integration. It is very similar to what you want to do. That is why I suggested the Mass matrix trick. It is very simple to implement and fast too especially if you want to change f often. You can use the same Mass matrix with differen f. The catch is that you are using your FE shape functions for your interpolation. As long as you are happy with linear interpolation for f this should do. If you want to interpolate f with a higher order polynomial than your FE shape function then this wont work. Btw, if I was not clear earlier: You have to form a global Mass matrix by integrating phi_i phi_j over all elements and doing a typically FEM assembly. Then you can simply multiply this global Mass matrix with you global nodal vector for f. On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: > Hi Rahul, I'm not completely sure what you mean. > > I would like to form my RHS by integrating f_i Phi_i (I guess there's no > need to multiply Phi_j? But you can correct me) for each element. > > In order to do so, I need values of f at various quadrature points. I have f > at various nodal values. The question is, how do I get this linear > interpolation... > > Do you mean that, for each element, I form the mass matrix by the xyz values > of the nodes (and a constant 1) and solve for the coefficient by saying > \sum_j A_ij y_j= f_i, where: > > A = [1 x1 y1 z1; > 1 x2 y2 z2; > 1 x3 y3 z3; > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds to > the constant value, and 2, 3, 4 corresponds to the gradient in the x, y, z > directions respectively)? > > Thanks, > Karen > > > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath <rahul.sampath@...> > wrote: >> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could >> form a Mass matrix and then multiply with your vector of nodal values. >> >> Rahul >> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> wrote: >> > I'm afraid you misunderstood. I don't have the function that when given >> > x, >> > y, z values gives me the function value. What I do have is just the >> > values >> > at the nodes of the mesh, which need to be linearly interpolated such >> > that I >> > will have something like exact_function. which gives me the value when >> > supplied with any x, y, z. >> > >> > >> > >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: >> > >> >> Karen Lee wrote: >> >> >> >>> I guess I'm not clear how to do this: Load data as a solution into >> >>> that, >> >>> and >> >>> query >> >>> it when you're integrating your real system. >> >>> >> >>> I have: >> >>> Mesh mesh(3); >> >>> MeshData mesh_data(mesh); >> >>> mesh_data.activate(); >> >>> mesh.read (mesh_file, &mesh_data); >> >>> mesh_data.read(mesh_file); >> >>> EquationSystems equation_systems (mesh); >> >>> >> >>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >> >>> >> >>> After that, I'm not clear how exactly to load data as a solution in >> >>> the >> >>> code. My goal is to get a linearly interpolated function of my data on >> >>> the >> >>> nodes (in the form of exact_solution, such that I get the function >> >>> value >> >>> out >> >>> when supplying x, y and z). >> >>> >> >>> Hope that clarifies things, and sorry for the multiple emails... >> >>> >> >>> Karen >> >>> >> >>> >> >>>  >> >>> Download Intel® Parallel Studio Eval >> >>> Try the new software tools for yourself. Speed compiling, find bugs >> >>> proactively, and finetune applications for parallel performance. >> >>> See why Intel Parallel Studio got high marks during beta. >> >>> http://p.sf.net/sfu/intelswdev >> >>> _______________________________________________ >> >>> Libmeshusers mailing list >> >>> Libmeshusers@... >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >>> >> >>> >> >>> >> >> so you already have the function, which is obtained from your discreted >> >> data? >> >> then just put the function as the exact_function. >> >> I think you are trying the 3D case, start from a 2d will be easier. >> >> >> >> Liang >> >> >> > >> >  >> > Download Intel® Parallel Studio Eval >> > Try the new software tools for yourself. Speed compiling, find bugs >> > proactively, and finetune applications for parallel performance. >> > See why Intel Parallel Studio got high marks during beta. >> > http://p.sf.net/sfu/intelswdev >> > _______________________________________________ >> > Libmeshusers mailing list >> > Libmeshusers@... >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >> > > > 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 12:28:21

Typically, If you want to solve the continuous equation L u = f where L is a Laplacian or any PDE operator and f is some forcing function of (x,y,z) using FEM, then you form your algebraic system using weak formulation by multiplying with test functions and integrating (and applying Green's formula or integration by parts) so Phi_j appears on both sides. So typically for your algebraic system A U = F F will be integral f(x,y,z) Phi_j and A will be integral L phi_j and then you do integration by parts etc. Since you want to express f(x,y,z) = f_i Phi_i F = integral f_i Phi_i Phi_j On Fri, Mar 26, 2010 at 12:51 AM, Karen Lee <kylkaren@...> wrote: > Hi Rahul, I'm not completely sure what you mean. > > I would like to form my RHS by integrating f_i Phi_i (I guess there's no > need to multiply Phi_j? But you can correct me) for each element. > > In order to do so, I need values of f at various quadrature points. I have f > at various nodal values. The question is, how do I get this linear > interpolation... > > Do you mean that, for each element, I form the mass matrix by the xyz values > of the nodes (and a constant 1) and solve for the coefficient by saying > \sum_j A_ij y_j= f_i, where: > > A = [1 x1 y1 z1; > 1 x2 y2 z2; > 1 x3 y3 z3; > 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds to > the constant value, and 2, 3, 4 corresponds to the gradient in the x, y, z > directions respectively)? > > Thanks, > Karen > > > On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath <rahul.sampath@...> > wrote: >> >> If you want to form a RHS by integrating f_i Phi_i Phi_j, You could >> form a Mass matrix and then multiply with your vector of nodal values. >> >> Rahul >> >> On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> wrote: >> > I'm afraid you misunderstood. I don't have the function that when given >> > x, >> > y, z values gives me the function value. What I do have is just the >> > values >> > at the nodes of the mesh, which need to be linearly interpolated such >> > that I >> > will have something like exact_function. which gives me the value when >> > supplied with any x, y, z. >> > >> > >> > >> > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: >> > >> >> Karen Lee wrote: >> >> >> >>> I guess I'm not clear how to do this: Load data as a solution into >> >>> that, >> >>> and >> >>> query >> >>> it when you're integrating your real system. >> >>> >> >>> I have: >> >>> Mesh mesh(3); >> >>> MeshData mesh_data(mesh); >> >>> mesh_data.activate(); >> >>> mesh.read (mesh_file, &mesh_data); >> >>> mesh_data.read(mesh_file); >> >>> EquationSystems equation_systems (mesh); >> >>> >> >>> >> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >> >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >> >>> >> >>> After that, I'm not clear how exactly to load data as a solution in >> >>> the >> >>> code. My goal is to get a linearly interpolated function of my data on >> >>> the >> >>> nodes (in the form of exact_solution, such that I get the function >> >>> value >> >>> out >> >>> when supplying x, y and z). >> >>> >> >>> Hope that clarifies things, and sorry for the multiple emails... >> >>> >> >>> Karen >> >>> >> >>> >> >>>  >> >>> Download Intel® Parallel Studio Eval >> >>> Try the new software tools for yourself. Speed compiling, find bugs >> >>> proactively, and finetune applications for parallel performance. >> >>> See why Intel Parallel Studio got high marks during beta. >> >>> http://p.sf.net/sfu/intelswdev >> >>> _______________________________________________ >> >>> Libmeshusers mailing list >> >>> Libmeshusers@... >> >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >>> >> >>> >> >>> >> >> so you already have the function, which is obtained from your discreted >> >> data? >> >> then just put the function as the exact_function. >> >> I think you are trying the 3D case, start from a 2d will be easier. >> >> >> >> Liang >> >> >> > >> >  >> > Download Intel® Parallel Studio Eval >> > Try the new software tools for yourself. Speed compiling, find bugs >> > proactively, and finetune applications for parallel performance. >> > See why Intel Parallel Studio got high marks during beta. >> > http://p.sf.net/sfu/intelswdev >> > _______________________________________________ >> > Libmeshusers mailing list >> > Libmeshusers@... >> > https://lists.sourceforge.net/lists/listinfo/libmeshusers >> > > > 
From: Pablo Tassi <pablotassi@gm...>  20100326 10:55:05

Dear libmesh users and developers, I am a new user of libmesh and I was wondering if anyone has used libmesh for the solution of discontinuous Galerkin applications. In particular, I'm interested in hyperbolic problems of shallow water type. To avoid reinventing the wheel, I'd like to ask you if there are some examples or tips for discontinuous finite element applications with libmesh (non hyperbolic applications could be also useful). Best, Pablo 
From: Karen Lee <kylkaren@gm...>  20100326 04:51:35

Hi Rahul, I'm not completely sure what you mean. I would like to form my RHS by integrating f_i Phi_i (I guess there's no need to multiply Phi_j? But you can correct me) for each element. In order to do so, I need values of f at various quadrature points. I have f at various nodal values. The question is, how do I get this linear interpolation... Do you mean that, for each element, I form the mass matrix by the xyz values of the nodes (and a constant 1) and solve for the coefficient by saying \sum_j A_ij y_j= f_i, where: A = [1 x1 y1 z1; 1 x2 y2 z2; 1 x3 y3 z3; 1 x4 y4 z4] and y_j would be my unknown (where j = 1 corresponds to the constant value, and 2, 3, 4 corresponds to the gradient in the x, y, z directions respectively)? Thanks, Karen On Thu, Mar 25, 2010 at 11:44 PM, Rahul Sampath <rahul.sampath@...>wrote: > If you want to form a RHS by integrating f_i Phi_i Phi_j, You could > form a Mass matrix and then multiply with your vector of nodal values. > > Rahul > > On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> wrote: > > I'm afraid you misunderstood. I don't have the function that when given > x, > > y, z values gives me the function value. What I do have is just the > values > > at the nodes of the mesh, which need to be linearly interpolated such > that I > > will have something like exact_function. which gives me the value when > > supplied with any x, y, z. > > > > > > > > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: > > > >> Karen Lee wrote: > >> > >>> I guess I'm not clear how to do this: Load data as a solution into > that, > >>> and > >>> query > >>> it when you're integrating your real system. > >>> > >>> I have: > >>> Mesh mesh(3); > >>> MeshData mesh_data(mesh); > >>> mesh_data.activate(); > >>> mesh.read (mesh_file, &mesh_data); > >>> mesh_data.read(mesh_file); > >>> EquationSystems equation_systems (mesh); > >>> > >>> > >>> equation_systems.add_system<ExplicitSystem> ("RHS"); > >>> equation_systems.get_system("RHS").add_variable("R", FIRST); > >>> > >>> After that, I'm not clear how exactly to load data as a solution in the > >>> code. My goal is to get a linearly interpolated function of my data on > the > >>> nodes (in the form of exact_solution, such that I get the function > value > >>> out > >>> when supplying x, y and z). > >>> > >>> Hope that clarifies things, and sorry for the multiple emails... > >>> > >>> Karen > >>> > >>> >  > >>> Download Intel® Parallel Studio Eval > >>> Try the new software tools for yourself. Speed compiling, find bugs > >>> proactively, and finetune applications for parallel performance. > >>> See why Intel Parallel Studio got high marks during beta. > >>> http://p.sf.net/sfu/intelswdev > >>> _______________________________________________ > >>> Libmeshusers mailing list > >>> Libmeshusers@... > >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers > >>> > >>> > >>> > >> so you already have the function, which is obtained from your discreted > >> data? > >> then just put the function as the exact_function. > >> I think you are trying the 3D case, start from a 2d will be easier. > >> > >> Liang > >> > > >  > > Download Intel® Parallel Studio Eval > > Try the new software tools for yourself. Speed compiling, find bugs > > proactively, and finetune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intelswdev > > _______________________________________________ > > Libmeshusers mailing list > > Libmeshusers@... > > https://lists.sourceforge.net/lists/listinfo/libmeshusers > > > 
From: Liang <goeasyon@gm...>  20100326 04:05:36

Karen Lee wrote: > I'm afraid you misunderstood. I don't have the function that when > given x, y, z values gives me the function value. What I do have is > just the values at the nodes of the mesh, which need to be linearly > interpolated such that I will have something like exact_function. > which gives me the value when supplied with any x, y, z. > > > > > ohh, sorry for misunderstanding, you may write a interpolation function subroutine to calculate the polynominals of the exact function, but do not assemble the exact_function because it will be very a lot of terms. Newton or Lagrange method should be able to do this linear interpolation, I did 1D interpolation with 20 nodes but have no idea on 3D interpolation. then just bring the x,y,z into your interpolation subroutine and return the exact variable on each node. Liang 
From: Rahul Sampath <rahul.sampath@gm...>  20100326 03:44:33

If you want to form a RHS by integrating f_i Phi_i Phi_j, You could form a Mass matrix and then multiply with your vector of nodal values. Rahul On Thu, Mar 25, 2010 at 11:40 PM, Karen Lee <kylkaren@...> wrote: > I'm afraid you misunderstood. I don't have the function that when given x, > y, z values gives me the function value. What I do have is just the values > at the nodes of the mesh, which need to be linearly interpolated such that I > will have something like exact_function. which gives me the value when > supplied with any x, y, z. > > > > On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: > >> Karen Lee wrote: >> >>> I guess I'm not clear how to do this: Load data as a solution into that, >>> and >>> query >>> it when you're integrating your real system. >>> >>> I have: >>> Mesh mesh(3); >>> MeshData mesh_data(mesh); >>> mesh_data.activate(); >>> mesh.read (mesh_file, &mesh_data); >>> mesh_data.read(mesh_file); >>> EquationSystems equation_systems (mesh); >>> >>> >>> equation_systems.add_system<ExplicitSystem> ("RHS"); >>> equation_systems.get_system("RHS").add_variable("R", FIRST); >>> >>> After that, I'm not clear how exactly to load data as a solution in the >>> code. My goal is to get a linearly interpolated function of my data on the >>> nodes (in the form of exact_solution, such that I get the function value >>> out >>> when supplying x, y and z). >>> >>> Hope that clarifies things, and sorry for the multiple emails... >>> >>> Karen >>> >>>  >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and finetune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intelswdev >>> _______________________________________________ >>> Libmeshusers mailing list >>> Libmeshusers@... >>> https://lists.sourceforge.net/lists/listinfo/libmeshusers >>> >>> >>> >> so you already have the function, which is obtained from your discreted >> data? >> then just put the function as the exact_function. >> I think you are trying the 3D case, start from a 2d will be easier. >> >> Liang >> >  > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and finetune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intelswdev > _______________________________________________ > Libmeshusers mailing list > Libmeshusers@... > https://lists.sourceforge.net/lists/listinfo/libmeshusers > 
From: Karen Lee <kylkaren@gm...>  20100326 03:40:22

I'm afraid you misunderstood. I don't have the function that when given x, y, z values gives me the function value. What I do have is just the values at the nodes of the mesh, which need to be linearly interpolated such that I will have something like exact_function. which gives me the value when supplied with any x, y, z. On Thu, Mar 25, 2010 at 10:54 PM, Liang <goeasyon@...> wrote: > Karen Lee wrote: > >> I guess I'm not clear how to do this: Load data as a solution into that, >> and >> query >> it when you're integrating your real system. >> >> I have: >> Mesh mesh(3); >> MeshData mesh_data(mesh); >> mesh_data.activate(); >> mesh.read (mesh_file, &mesh_data); >> mesh_data.read(mesh_file); >> EquationSystems equation_systems (mesh); >> >> >> equation_systems.add_system<ExplicitSystem> ("RHS"); >> equation_systems.get_system("RHS").add_variable("R", FIRST); >> >> After that, I'm not clear how exactly to load data as a solution in the >> code. My goal is to get a linearly interpolated function of my data on the >> nodes (in the form of exact_solution, such that I get the function value >> out >> when supplying x, y and z). >> >> Hope that clarifies things, and sorry for the multiple emails... >> >> Karen >> >>  >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and finetune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intelswdev >> _______________________________________________ >> Libmeshusers mailing list >> Libmeshusers@... >> https://lists.sourceforge.net/lists/listinfo/libmeshusers >> >> >> > so you already have the function, which is obtained from your discreted > data? > then just put the function as the exact_function. > I think you are trying the 3D case, start from a 2d will be easier. > > Liang > 
From: Liang <goeasyon@gm...>  20100326 02:54:22

Karen Lee wrote: > I guess I'm not clear how to do this: Load data as a solution into that, and > query > it when you're integrating your real system. > > I have: > Mesh mesh(3); > MeshData mesh_data(mesh); > mesh_data.activate(); > mesh.read (mesh_file, &mesh_data); > mesh_data.read(mesh_file); > EquationSystems equation_systems (mesh); > > > equation_systems.add_system<ExplicitSystem> ("RHS"); > equation_systems.get_system("RHS").add_variable("R", FIRST); > > After that, I'm not clear how exactly to load data as a solution in the > code. My goal is to get a linearly interpolated function of my data on the > nodes (in the form of exact_solution, such that I get the function value out > when supplying x, y and z). > > Hope that clarifies things, and sorry for the multiple emails... > > Karen >  > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and finetune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intelswdev > _______________________________________________ > Libmeshusers mailing list > Libmeshusers@... > https://lists.sourceforge.net/lists/listinfo/libmeshusers > > so you already have the function, which is obtained from your discreted data? then just put the function as the exact_function. I think you are trying the 3D case, start from a 2d will be easier. Liang 
From: Karen Lee <kylkaren@gm...>  20100325 22:26:27

I guess I'm not clear how to do this: Load data as a solution into that, and query it when you're integrating your real system. I have: Mesh mesh(3); MeshData mesh_data(mesh); mesh_data.activate(); mesh.read (mesh_file, &mesh_data); mesh_data.read(mesh_file); EquationSystems equation_systems (mesh); equation_systems.add_system<ExplicitSystem> ("RHS"); equation_systems.get_system("RHS").add_variable("R", FIRST); After that, I'm not clear how exactly to load data as a solution in the code. My goal is to get a linearly interpolated function of my data on the nodes (in the form of exact_solution, such that I get the function value out when supplying x, y and z). Hope that clarifies things, and sorry for the multiple emails... Karen 
From: Karen Lee <kylkaren@gm...>  20100325 21:58:06

Sorry, please disregard that code. I meant to put fxy to be the exact solution at particular qp's. However, I realized that it's not defined except at Nodes. I really don't know how to do this... Thanks for your help in advance, Karen On Thu, Mar 25, 2010 at 5:50 PM, Karen Lee <kylkaren@...> wrote: > Dear all, > > I'm trying to store data from _node_data associated with a Mesh on a degree > 1 LAGRANGE basis in the code in order for this _node_data (supposed to be a > smooth function) to be used in the rhs of my Poisson problem. > >> >> Add a second system, an ExplicitSystem, to your EquationSystems. Add >> a single variable to it. Load data as a solution into that, and query >> it when you're integrating your real system. > > > Does it mean I just do something very similar to example 3 (poisson > problem) and use my _node_data as the "exact_solution"? I'm not quite sure > how to set up the problem though... I'm guessing I'm doing a linear > interpolation of my data... In that case, do I just do the following? > (Sorry, I need things spelled out more since I'm getting confused with the > data structures.) > > for (unsigned int qp=0; qp<qrule.n_points(); qp++) > { > > for (unsigned int i=0; i<phi.size(); i++) > for (unsigned int j=0; j<phi.size(); j++) > { > Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); > } > > { > //const Real x = > q_point[qp](0); > //const Real y = > q_point[qp](1); > //const Real eps = > 1.e3; > > const Real fxy = 1; > for (unsigned int i=0; i<phi.size(); i++) > Fe(i) += JxW[qp]*fxy*phi[i][qp]; > } > } > > I tried to assign _node_data directy to _variables, but I guess a Variable > is not supposed to hold any value except to design what the name, ID and FE > type is for the solution of a problem? Please clarify... > > > Also, since I don't have the analytic form of my _node_data. When I define > it will it just become a bunch of if/then statements? (checking for xyz > values and then assigning the appropriate data value...) > > Thanks, > Karen > > 
From: Karen Lee <kylkaren@gm...>  20100325 21:50:49

Dear all, I'm trying to store data from _node_data associated with a Mesh on a degree 1 LAGRANGE basis in the code in order for this _node_data (supposed to be a smooth function) to be used in the rhs of my Poisson problem. > > Add a second system, an ExplicitSystem, to your EquationSystems. Add > a single variable to it. Load data as a solution into that, and query > it when you're integrating your real system. Does it mean I just do something very similar to example 3 (poisson problem) and use my _node_data as the "exact_solution"? I'm not quite sure how to set up the problem though... I'm guessing I'm doing a linear interpolation of my data... In that case, do I just do the following? (Sorry, I need things spelled out more since I'm getting confused with the data structures.) for (unsigned int qp=0; qp<qrule.n_points(); qp++) { for (unsigned int i=0; i<phi.size(); i++) for (unsigned int j=0; j<phi.size(); j++) { Ke(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]); } { //const Real x = q_point[qp](0); //const Real y = q_point[qp](1); //const Real eps = 1.e3; const Real fxy = 1; for (unsigned int i=0; i<phi.size(); i++) Fe(i) += JxW[qp]*fxy*phi[i][qp]; } } I tried to assign _node_data directy to _variables, but I guess a Variable is not supposed to hold any value except to design what the name, ID and FE type is for the solution of a problem? Please clarify... Also, since I don't have the analytic form of my _node_data. When I define it will it just become a bunch of if/then statements? (checking for xyz values and then assigning the appropriate data value...) Thanks, Karen 
From: John Peterson <peterson@cf...>  20100323 20:00:20

On Tue, Mar 23, 2010 at 2:51 PM, Roy Stogner <roystgnr@...> wrote: > > On Tue, 23 Mar 2010, John Peterson wrote: > >> On Tue, Mar 23, 2010 at 2:41 PM, Roy Stogner <roystgnr@...> >> wrote: >> >>> You're right that it's a lowerorder element; I don't recall what the >>> advantage over P1/P0 is supposed to be. >> >> P1/P0 is not LBBstable. Gresho & Sani also say "sometimes locks" and >> "rarely, if ever, usable." Ouch. > > Gah! I must be slipping. I could have sworn there was an LBBstable > way of using discontinuous constants for pressure without adding any > stabilization term. Q1/P0?? Aka Q1Q0. Not LBB stable, but "simple" and "penalty method works". "Mathematicians hate it", "firstorder usually".  John 