-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSON porter for network and simulation import new json model
- Loading branch information
1 parent
28f9138
commit fe10070
Showing
16 changed files
with
430 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(SOURCE_LIST | ||
jsonPorter.hh | ||
) | ||
|
||
set(HEADER_LIST | ||
jsonPorter.h | ||
) | ||
|
||
target_sources(${TARGET_NAME} PUBLIC ${SOURCE_LIST} ${HEADER_LIST}) | ||
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) | ||
target_link_libraries(${TARGET_NAME} PUBLIC lbmLib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <fstream> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
#include "../architecture/Channel.h" | ||
#include "../architecture/FlowRatePump.h" | ||
#include "../architecture/lbmModule.h" | ||
#include "../architecture/Network.h" | ||
#include "../architecture/Node.h" | ||
#include "../architecture/Platform.h" | ||
#include "../architecture/PressurePump.h" | ||
|
||
#include "../simulation/Simulation.h" | ||
|
||
#include "nlohmann/json.hpp" | ||
|
||
namespace porting { | ||
|
||
/** | ||
* @brief Constructor of the Network from a JSON string | ||
* @param json json string | ||
* @return Network network | ||
*/ | ||
template<typename T> | ||
arch::Network<T> networkFromJSON(std::string jsonFile); | ||
|
||
template<typename T> | ||
sim::Simulation<T> simulationFromJSON(std::string jsonFile, arch::Network<T>* network_); | ||
|
||
template<typename T> | ||
void resultToJSON(std::string jsonFile); | ||
|
||
} // namespace porting |
Oops, something went wrong.