Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Add fta code #272

wants to merge 2 commits into from

Conversation

HugoNip
Copy link

@HugoNip HugoNip commented Feb 15, 2020

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

Hugo Nie added 2 commits February 15, 2020 16:13
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;
Copy link
Contributor

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**********************************************************************
Copy link
Contributor

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"
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor

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.

@cbolisetti
Copy link
Contributor

In order for the tests to continue, you need to refer to an issue in your commit message. We already have an open issue (#126) about adding FTA capabilities. So you can just add "refs #126" to your commit message.

@HugoNip HugoNip closed this Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants