writing include file lines in Bulk

77 views
Skip to first unread message

Hugh Briggs

unread,
Jun 9, 2019, 6:15:59 PM6/9/19
to pyNastran Discuss
Steve,
You did good answering my first question, so...
After a few hours of looking, how do I write an INCLUDE file line in my BULK?
I found write_include which makes a line string, but how do I get it in the model bdf?
You showed me nice equivalents for exec (bdf.executive_control_lines = list_of_lines) and cc (bdf.case_control_lines = list_of_lines), but nothing equivalent for bulk. Or a raw line for BULK.
Thanks,
Hugh

Steven Doyle

unread,
Jun 9, 2019, 10:27:46 PM6/9/19
to pyNastran Discuss
>  After a few hours of looking, how do I write an INCLUDE file line in my BULK?   I found write_include which makes a line string, but how do I get it in the model bdf?

You can use the model.reject_lines for INCLUDEs

> Or a raw line for BULK.

You'd use model.reject_lines or model.reject_cards depending on the form you're looking for (if you're dumping lines, it probably doesn't really matter).  You're responsible for managing those lines.  It's not really the intended path through the code.  It's ignored other than for writing data.

Really though if you're adding cards, there are 373 cards supported, so you really shouldn't need to use them outside of INCLUDEs.  There are a whole bunch of methods of the form:
    model.add_*

so:
   model.add_grid(...)
   model.add_cquad4(...)
   model.add_spoint(...)

etc.  Every (or almost every) of those 373 cards has a method.  It also sounds like you don't have an IDE.  That makes it much easier to use the BDF class as it will autofill in the arguments to those methods and help you avoid spending hours looking for what to modify.  the model.object_attributes() and model.object_methods() help as well.

--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/836fb024-609d-4a2c-8df1-8b1ea04be667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hugh Briggs

unread,
Jun 10, 2019, 6:07:12 PM6/10/19
to pyNastran Discuss
Steve, Thanks so much for the quick reply.
I figured out how to use the reject_lines list that you pointed out. I will go with that.
Some explanation of my ....condition.
I'm new to Python and wanted to try the combination of the language and your pyNastran. I have always done this work with Matlab. I'm convinced now you have an excellent alternative.
I started last December and had to figure out both Python and your environment at the same time. I have a complex project and have tried to pick the quickest and simplest path through to a working Nastran problem as possible. I can make it smarter later. We have a large design spread sheet with a system parametric description. I use VBA to export the design in the EU CPACS 3.0 XML format. Then I use pyNastran to build the FEM by reading the xml file. The geometry extraction is pretty straightforward, but building a robust mesh is difficult. The project's goal is to hide as much of the Nastran modeling as possible from the spreadsheet user.
I use Spyder for an IDE. It does provide access to the object methods etc. I also use all the web pages that you expose for how tos and automatic documentation.
I do use the card functions that you provide to build the data deck. They work great.
I partitioned the Nastran deck into chunks in their own file because... different blocks of code are organized to build different pieces. There is a structural file and an aero file. The static structural solves don't need the aero file. There are several top level run decks for the various problems that include the structural deck and the aero deck. There are runs for different static loads, a modal solve, a flutter run, a static aeroelastic run, maybe someday a gust run. This file organization seems to help keep all that manageable, but leads to include files.
I still struggle with higher level language aspects, like figuring out from the hints what is a method on what thingie and what is a list or property. The debugger is very helpful for poking around. But its hard to figure out the high level strategy for using the library this way. Your intro examples help somewhat, but I don't find much guidance for applications like mine that build the entire problem deck from scratch.
My next steps, after getting the various Nastran problems to solve, is to read the answers in the .f06 and .op2 with your library. Like I said, I had always done this with Matlab and a proprietary library. So I am looking for ways similar to how I used to do it back then.
Sincerely,
Hugh

On Sunday, June 9, 2019 at 8:27:46 PM UTC-6, steve wrote:
>  After a few hours of looking, how do I write an INCLUDE file line in my BULK?   I found write_include which makes a line string, but how do I get it in the model bdf?

You can use the model.reject_lines for INCLUDEs

> Or a raw line for BULK.

You'd use model.reject_lines or model.reject_cards depending on the form you're looking for (if you're dumping lines, it probably doesn't really matter).  You're responsible for managing those lines.  It's not really the intended path through the code.  It's ignored other than for writing data.

Really though if you're adding cards, there are 373 cards supported, so you really shouldn't need to use them outside of INCLUDEs.  There are a whole bunch of methods of the form:
    model.add_*

so:
   model.add_grid(...)
   model.add_cquad4(...)
   model.add_spoint(...)

etc.  Every (or almost every) of those 373 cards has a method.  It also sounds like you don't have an IDE.  That makes it much easier to use the BDF class as it will autofill in the arguments to those methods and help you avoid spending hours looking for what to modify.  the model.object_attributes() and model.object_methods() help as well.

On Sun, Jun 9, 2019 at 3:16 PM Hugh Briggs <clarkbr...@gmail.com> wrote:
Steve,
You did good answering my first question, so...
After a few hours of looking, how do I write an INCLUDE file line in my BULK?
I found write_include which makes a line string, but how do I get it in the model bdf?
You showed me nice equivalents for exec (bdf.executive_control_lines = list_of_lines) and cc (bdf.case_control_lines = list_of_lines), but nothing equivalent for bulk. Or a raw line for BULK.
Thanks,
Hugh

--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastra...@googlegroups.com.

Steven Doyle

unread,
Jun 10, 2019, 9:53:57 PM6/10/19
to pyNastran Discuss
Yeah, I can't help you on the geometry part.   PyNastran very intentionally doesn't have any sort of model building capability because it's a hard problem and the project is big enough without that. My company has a similar type of tool and it's definitely a lot of work depending on what level of fidelity you're going for.  Since I'm referencing it anyways you can read up on it here. http://openvsp.org/wiki/lib/exe/fetch.php?media=workshop17:m4_structures_studio.pdf 

What pyNastran is really for is separating the complexity of Nastran from what you're trying to do.  A lot of things really aren't that bad, but understanding what's really required to control them is sometimes challenging (e.g., beam elements and orientation vectors, grabbing a matrix from the OP2). If you just have a model, you can do things like use test_bdf to check if the model makes sense, which is probably my favorite tool.  Passing that pretty much guarantees your model will run.

To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/6918774a-671a-4ee9-843a-888ae35d09af%40googlegroups.com.

Cody Godines

unread,
Jun 27, 2024, 5:45:57 PM6/27/24
to pyNastran Discuss
This is a similar topic.  I see from the thread that we can reject include lines.  From a configuration point of view, not can we read a bdf with include lines BUT process those file as separate model.readbdfs items so that we can compare.  For example, I see an f06 message about a grid point singularity but i forgot which include file model(s) have that node.  I would like to go to this file quickly not open my whole bdf in my preprocessor of choice.   Thank you.

Steven Doyle

unread,
Jun 27, 2024, 5:55:24 PM6/27/24
to pynastra...@googlegroups.com
Please start a new thread.

Reply all
Reply to author
Forward
0 new messages