-
Notifications
You must be signed in to change notification settings - Fork 25
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
Variable substitution in XML DOM tree #100
Comments
4b9a347 is a start. It adds an optional argument to the NEML Optionally we could track which keys are used and throw if any are unused. Let me know what you think. |
Apologies this took so long to get to. I guess I don't object to something like this, where we go in and alter the XML string. Let me take a look at the code and get the bindings working. |
Hmm, while I don't object to the approach this seems to be breaking the parse system. Fixing the bindings is trivially easy but the parse tests all fail with an empty substitutions map/dictionary. If you make a PR I can fix the bindings and show you what I mean. |
Yeah, there is more work to be done on this. Not quite ready. Alternative
would be a better XML library with entity support.
…On Tue, Apr 13, 2021, 8:24 PM Mark Messner ***@***.***> wrote:
Hmm, while I don't object to the approach this seems to be breaking the
parse system. Fixing the bindings is trivially easy but the parse tests all
fail with an empty substitutions map/dictionary. If you make a PR I can fix
the bindings and show you what I mean.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRMPVUKY75STLWNT4FPRDTIT4F3ANCNFSM42JQOVEA>
.
|
Ironically I used to use libxml. But MOOSE folk asked me to switch to the header-only library back when Ben first integrated NEML into blackbear... I would be okay going back to a nicer XML library. Past that this is about the only type of solution I can think of. I still need to get around to writing a serialization system, but my plan was just to go back from the objects to XML. So that wouldn't make this any easier. |
How about using Hit? I know switching to a different format is a lot of work. But long-term this could minimize the maintenance cost. |
|
Alternatively, we could dump the problem into MOOSE. It should already possible to write a MOOSE action to construct a NEML model just using the C++ API directly. We could store that model in a Well I guess having a hit serialization/deserialization interface would make that task a whole lot easier in MOOSE anyway. So maybe the two approaches are fundamentally similar. Either way, I'd like to be able to better integrate NEML into MOOSE without loosing the ability to compile it as a stand alone python package and provide UMAT/UMATERIAL inferfaces to Abaqus/ANSYS, because we do have actual users that want that particular interface to the library (ANSYS). It's something to think about how to do, particularly if I can figure out a good way to address the scalar real type issue as well. |
We just started moving model data out of source files into JSON data files. |
In Blackbear we need to be able to specify parameters in the MOSOE input file (this is required for using the stochastic methods module to launch many simulations). We currently use a hack, where a
{variable}
string in the XML code is replaced through string operation in a preprocessing step.The XML spec has the concept of "entities" (
&VARIABLE;
) which unfortunately is not supported by the rapidxml library, so we need to stick with find/replace for now.However, I'd like to perform that find/replace on individual attributes in the DOM tree. This would permit better error checking.
Right now, in Blackbear we cannot do proper error checking for missing or unused substitutions, because we cannot limit the find/replace to only the model subblock that is actually used.
The text was updated successfully, but these errors were encountered: