-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field on node and its evaluator #457
Comments
Hi Ruixiong, If I understand correctly, you have a field that you compute at the quadrature points, but you would like to have one version of it at the nodes, and save it, correct? I think you have a few choices:
In all these cases, you will also need a SaveStateField evaluator. |
Thanks for the detailed explaination! I think the 3rd option might be the one I wanna check out. Just to be more specific, I'm looking for the historical max value of my primary solution. Since temperature may go up and drop periodically, but I want to record the peak value of all time, and use this node based value later in some evaluators. So this involves no residual term and cannot be solved with exactly the same governing equation as in Option #3. So I was wondering how to implement this And for other options, I need different values on different vertices, since I would like to interpolate those nodal values on to edge to do calculation later. Please let me know if anything new come up. And meanwhile I'll check the StokesFOBase Thanks and have a nice day! |
If that's what you need, then you can implement your evaluator easily. Say you call it
Note: I'm assuming you're not really interested in the max of the field during Jacobian/Tangent/DistParamDeriv evaluation types, so you should probably have an empty implementation, and only have an implementation for the Residual case. Much like SaveStateField does. P.s: FYI, StokesFOBase is not the easiest class to read, to be fair. I did it since we were starting to get a lot of code duplication, hard to maintain. But it may be not so easy to read. |
Also, if/when you think your question has been answered, don't forget to close the issue. Thanks. |
Hi thanks a lot for the suggestion! I tried to implement it in this way, something's still little bit wrong, so can I ask a few questions? Here's how I did it: In problem.hpp:
In Tmax.hpp:
In Tmax_Def.hpp:
Above is generally what I added so far, it is compiled but not running successfully.
I do apologize to ask questions in this detail, but this is all I could figure out after repetitively examining the code and similar examples. I'll really appreciate the help, thanks! |
@RuixiongHu : option 4 described by @bartgol sounds like the ProjectIPtoNodalField response in LCM. Basically what this response does is take fields at quadrature points (stresses, equivalent plastic strain, etc.) and projects them onto the nodes. This is done by constructing a mass-like matrix and solving a linear system. The attached paper details the method. You may want to have a look to see if you can adapt the response to what you want to do. |
@RuixiongHu I think Albany lingo can be a bit confusing. A few comments:
This is telling PHX that, if the evaluator evaluates something (which is true only if EvalT=PHAL::Residual), then it should make sure that that evaluator is evaluated.
So in short, this is the recipe:
Extra Note: if you are using a STK mesh, then you also need to declare the field in the |
@bartgol Thanks for the explanation! I've implemented all the above suggestion. It's running but still falls into the same problem, I observed that: It enters all other evaluators perfectly, but never output the message that it enters the new evaluator, until it shows segmentation fault. I'm sure that the code is running perfectly before I add this new things in. So here's my thought :
However, for my understanding, even though calculation is done based on integration point, but Temperature as a DOF will automatically have value on node point. Is this correct? If not (meaning I have to explicitly declare DOF on node like before), while registering primary solution to be also on node, how could I pass the correct calculation result onto it, given that it does not know this nodal field called Temperature is exactly the DOF I'm solving, since therer's already a Temperature on qp point that is enough to complete a simulation. I'll really appreciate your answer, thanks! |
Maybe it's nothing but...have you tried register the evaluator before the if statement? I'm not sure if requesting a field that has not yet an evaluator that evaluates it leads to the correct result. I would register the evaluator first, then request for its field. |
Regarding point 2, if your solution field is called 'Temperature', then there should be already an evaluator for that. As a check, you should add |
Thanks for the reply! Yes I did register the evaluator before the if statement, and this Here is the full block:
If everything seems correct I'll use the Graph Visualization function. Thanks for all your detailed help! Have a good one |
Ah, it just occurred to me, that SaveStateField by default assumes the field to be cell centered. Try to add
right after registering the state (and before creating the evaluator). It's a poor implementation on my side (I added that), since the PHX layout (with its tags) should already be enough to determine what kind of field it is. |
Thanks! I've added this, but it shows me error:
And while I was searching I figured out another example doing this nodal field, it also always has a Thanks! |
Ah! What kind of discretization are you using? |
I think it's PUMI? The discretization software is Simmetrix and the partitiond mesh is in smb format. |
Hello, hope you guys had a great weekend! During this time, except for trying to add PUMI support for the nodal field, I also tried to use a brief STK mesh to test the evaluators I added so far, and I've figured out some questions that I would really appreciate some answers.
I would like to know if doing this is reasonable to test the evaluators I added so far? I also see the examples in LandIce/Hydrology/input_steady.yaml. But in that case the discretization method is Gmsh, and input terms are somewhat different. So I'm bit confused which one to use as examples.
I would really appreciate any type of reply, |
Hi Ruixiong, in reverse order:
|
Hi Luca, Thanks a lot for you reply.
Thanks and hope to hear from you |
Re: Dag. That's odd. What version of dot are you using? I have 2.30 and it works. Re: field not found in the mesh. The 'Required Field Info' section is only for element node fields (scalar, vector, or tensor), so don't add |
Thanks for the reply! Ah, should I use webdot for that dot command? or graphviz, I thought it's graphviz 2.4, but I see there's a webdot 2.3 under it. Here's thee discretization section ` Discretization:
` I wasn't using exactly the hydrology mesh is because that's a 2D mesh. This is a mesh in /test/small/Necking3DSTKAdapt All the terms here, Temperature and Tmax aree DOF, while others are state variable. Type wise, only Tmax is explicitly initialized as These are pretty much all the fields in the simulation. I checked in the problem.hpp file which evaluator called I used Thanks a lot! |
graphviz is what I use. 2.4 should be plenty good. I don't understand why it gives you that error. Meanwhile, a possible clarification: you cannot save to the mesh a qp_scalar field. Well, technically you can, but it's messy and not much useful for visualization. If you specify 'Elem Scalar', then the field must have layout More precisely, these are the field layouts that corresponds to the 'Field Type' specs in the input file:
There is also support for layered fields, but that's not relevant in your case, I think. So to summarize: if you specify, say, an |
Hello all,
This is Ruixiong Hu, grad student from RPI, I'm taking over the 3D Manufacturing (AMP) project based on Albany. This is a pure 3D thermal conduction problem. I've been working on understanding the code for a while and could understand the general structure and most of tasks regarding parameter and its evaluator.
Currently I'm working on storing a historical max Temperature field on node point. Since from our observation parameters are all based and stored on quadrature point, we decided to create another solution field Tmax, to store this historical value. So I created a new DOF Tmax in the same way of Temperature. This is just a field without residual, which is slightly different than the template problems so I have some questions about how to implement the idea:
Does it have to be accompanied with a residual field? Since this Tmax will not be calculated by residual from governing equation, but merely compare the max value of the primary solution Temperature. It shows error of missing Tmax residual evaluator .
I would like to know where and how to write a evaluator to achieve this
max(T,Tmax)
function. Usually parameters are calculated inside evaluators by single equation, and DOF field is calculated through residual. But how can I calculate this DOF field through a evaluator type of file with one function, instead of getting it by solving another common residual term.I'm a relative new user of Albany and also programming so I would really appreciate any type of help. Please let me know if anything above is wrong or if there's any other easier way already existed in Albany.
Thanks and have a good one
Ruixiong
The text was updated successfully, but these errors were encountered: