Driver code: Testing BlockSelector class.
41 "--test_default_constructor");
43 "--test_constructor_with_param");
45 "--test_select_block_function");
47 "--test_want_block_function");
49 "--test_do_not_want_block_function");
51 "--test_do_not_want_block_function_replace");
53 "--test_set_row_index_function");
55 "--test_set_column_index_function");
75 "--test_default_constructor"))
78 std::ostringstream out_stream_name;
79 out_stream_name <<
"OUTFILE_default_constructor_test";
80 std::ofstream out_file;
81 out_file.open(out_stream_name.str().c_str());
84 out_file << block_selector_default <<
"\n";
91 "--test_constructor_with_param"))
94 std::ostringstream out_stream_name1;
95 out_stream_name1 <<
"OUTFILE_constructor_with_param_wanted";
96 std::ofstream out_file1;
97 out_file1.open(out_stream_name1.str().c_str());
100 out_file1 << block_selector_with_param_wanted <<
"\n";
106 std::ostringstream out_stream_name2;
107 out_stream_name2 <<
"OUTFILE_constructor_with_param_not_wanted";
108 std::ofstream out_file2;
109 out_file2.open(out_stream_name2.str().c_str());
111 BlockSelector block_selector_with_param_not_wanted(3,4,
false);
112 out_file2 << block_selector_with_param_not_wanted <<
"\n";
118 std::ostringstream out_stream_name3;
119 out_stream_name3 <<
"OUTFILE_constructor_with_param_replace";
120 std::ofstream out_file3;
121 out_file3.open(out_stream_name3.str().c_str());
124 BlockSelector block_selector_with_param_replace(5,6,
true,&testmat);
125 out_file3 << block_selector_with_param_replace <<
"\n";
126 block_selector_with_param_replace.null_replacement_block_pt();
133 "--test_select_block_function"))
136 std::ostringstream out_stream_name1;
137 out_stream_name1 <<
"OUTFILE_select_block_wanted";
138 std::ofstream out_file1;
139 out_file1.open(out_stream_name1.str().c_str());
143 out_file1 << block_selector_wanted <<
"\n";
148 std::ostringstream out_stream_name2;
149 out_stream_name2 <<
"OUTFILE_select_block_not_wanted";
150 std::ofstream out_file2;
151 out_file2.open(out_stream_name2.str().c_str());
155 out_file2 << block_selector_not_wanted <<
"\n";
160 std::ostringstream out_stream_name3;
161 out_stream_name3 <<
"OUTFILE_select_block_replace";
162 std::ofstream out_file3;
163 out_file3.open(out_stream_name3.str().c_str());
168 out_file3 << block_selector_replace <<
"\n";
174 "--test_want_block_function"))
177 std::ostringstream out_stream_name;
178 out_stream_name <<
"OUTFILE_want_block";
179 std::ofstream out_file;
180 out_file.open(out_stream_name.str().c_str());
183 block_selector.want_block();
184 out_file << block_selector <<
"\n";
194 "--test_do_not_want_block_function"))
197 std::ostringstream out_stream_name;
198 out_stream_name <<
"OUTFILE_do_not_want_block";
199 std::ofstream out_file;
200 out_file.open(out_stream_name.str().c_str());
203 block_selector.do_not_want_block();
204 out_file << block_selector <<
"\n";
208 "--test_do_not_want_block_function_replace"))
211 std::ostringstream out_stream_name;
212 out_stream_name <<
"OUTFILE_do_not_want_block_replace";
213 std::ofstream out_file;
214 out_file.open(out_stream_name.str().c_str());
218 block_selector.do_not_want_block();
219 out_file << block_selector <<
"\n";
224 "--test_set_row_index_function"))
227 std::ostringstream out_stream_name;
228 out_stream_name <<
"OUTFILE_set_row_index";
229 std::ofstream out_file;
230 out_file.open(out_stream_name.str().c_str());
234 out_file << block_selector <<
"\n";
239 "--test_set_column_index_function"))
242 std::ostringstream out_stream_name;
243 out_stream_name <<
"OUTFILE_set_column_index";
244 std::ofstream out_file;
245 out_file.open(out_stream_name.str().c_str());
249 out_file << block_selector <<
"\n";
254 std::ostringstream err_msg;
255 err_msg <<
"No test is recognised.\n"
256 <<
"Please set the appropriate command line flag."
264 return(EXIT_SUCCESS);
Definition: block_preconditioner.h:124
void null_replacement_block_pt()
Set Replacement_block_pt to null.
Definition: block_preconditioner.h:241
void select_block(const unsigned &row_index, const unsigned &column_index, const bool &wanted, CRDoubleMatrix *replacement_block_pt=0)
Select a block.
Definition: block_preconditioner.h:188
void set_column_index(const unsigned &column_index)
Set the column index.
Definition: block_preconditioner.h:284
void set_row_index(const unsigned &row_index)
Set the row index.
Definition: block_preconditioner.h:272
Definition: matrices.h:888
Definition: oomph_definitions.h:222
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86