MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / initialize

Method initialize

SRC/recorder/MPCORecorder.cpp:4832–4941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4830}
4831
4832int MPCORecorder::initialize()
4833{
4834 /*
4835 error flags
4836 */
4837 int retval = 0;
4838 herr_t status = 0;
4839 /*
4840 initialize only once
4841 */
4842 if (m_data->initialized)
4843 return retval;
4844 /*
4845 get the dimension of the problem
4846 */
4847 if (m_data->info.domain == 0) {
4848 opserr << "MPCORecorder error: null domain\n";
4849 exit(-1);
4850 }
4851 if (m_data->info.num_dimensions < 1) {
4852 NodeIter& node_iter = m_data->info.domain->getNodes();
4853 Node* current_node = 0;
4854 while ((current_node = node_iter()) != 0) {
4855 int trial_dim = current_node->getCrds().Size();
4856 if (m_data->info.num_dimensions < 1) {
4857 m_data->info.num_dimensions = trial_dim;
4858 }
4859 else {
4860 if (m_data->info.num_dimensions != trial_dim) {
4861 opserr << "MPCORecorder error: nodes with different dimensions, this is not supported\n";
4862 exit(-1);
4863 }
4864 }
4865 }
4866 if (m_data->info.num_dimensions < 1 || m_data->info.num_dimensions > 3) {
4867 opserr << "MPCORecorder error: invalid spatial dimension. expected 1 2 or 3, given: " << m_data->info.num_dimensions << "\n";
4868 exit(-1);
4869 }
4870 }
4871 /*
4872 create property lists (enable link creation order tracking)
4873 */
4874 m_data->info.h_file_proplist = h5::plist::crate(h5::plist::FileCreate);
4875 status = h5::plist::setLinkCreationOrder(m_data->info.h_file_proplist, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
4876 m_data->info.h_group_proplist = h5::plist::crate(h5::plist::GroupCreate);
4877 status = h5::plist::setLinkCreationOrder(m_data->info.h_group_proplist, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
4878 /*
4879 open or create the output file
4880 */
4881 std::string the_filename;
4882 {
4883 std::vector<std::string> filename_words;
4884 utils::strings::split(m_data->filename, '.', filename_words, true);
4885 if (filename_words.size() == 0)
4886 filename_words.push_back("DefaultName");
4887 if (filename_words.back() != "mpco")
4888 filename_words.push_back("mpco");
4889 std::stringstream ss_filename;

Callers

nothing calls this directly

Calls 15

exitFunction · 0.85
crateFunction · 0.85
setLinkCreationOrderFunction · 0.85
splitFunction · 0.85
setLibVerBoundsFunction · 0.85
startSWMRFunction · 0.85
createAndWriteFunction · 0.85
closeFunction · 0.85
getNodesMethod · 0.80
getCrdsMethod · 0.80
push_backMethod · 0.80
createFunction · 0.70

Tested by

no test coverage detected