-
Notifications
You must be signed in to change notification settings - Fork 54
Add fta code #272
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
Add fta code #272
Conversation
1. replace all functions defined in the head files with dummy functions. 2. add six header files (.h files) into the directory "/mastodon/include/utils/" for FTA.
add source files (.C) into the directory "/mastodon/src/utils/" for FTA
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont use namespace std and always use the std:: prefix for std library functions.
@@ -0,0 +1,35 @@ | |||
/*H********************************************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all.h. Most of these are already included in MASTODON and MOOSE and may not be needed. If you need a specific library in Quantification.C, for example, include that in Quantification.h.
#define _FAULT_TREE_H | ||
|
||
#include "all.h" | ||
#include "parser.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also replace parser with existing CSV reader utilities in MOOSE. You can find a sample usage in the Fragility Vectorpostprocessor which reads . This is at src/vectorpostprocessors/Fragility.C. Please refer to the calcDemandsFromFile method in this file - specifically, lines 232 - 235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Chandu,
We have one problem here. The existing parser in Mastodon converts csv information into double type. But in our fault tree code, we have logic.csv file which has information about fault tree logic (event names, operators (AND/OR)). Can you please point us to any parser which outputs string type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @ssbodda, you're right, DelimitedReader is only meant for type Real data with text headers. In that case, I think it is better to do the parsing by yourself. Instead of having a separate parser class, I recommend you parse it in one of the methods in the faulttreeanalysis file. The filename still has to go in as an input, but we can deal with that later. If possible, I even recommend you use some predefined values for the faulttree logic and the basic events and we can tell you about parsing later. For now, if you can get the unit tests working, that would be great.
Hello:
We first replace the functions defined in the class of the head files and then add header files (.h files) and source files (.C) of FTA code into mastodon code. There are six head files and two source files in total.
Thank you.
Best regards.
Pragya Vaishanav and Hugo Guang-Yu Nie