Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Driver

Background

The Driver.hpp file defines an instance to translate the JSON input's format file into Seismo-VLAB objects. In particular, components in the Geometry Module, Solution Module, and Input/Output Module provided in JSON format are transformed into objects.

The Driver main function are:

In SVL, we use RSJparser.hpp JSON parser, because it resembles the same structure used in python dictionaries. Below is a simple example (extracted from the RSJparser documentation) on how to use RSJparser in an implementation file:

std::string str = "{'RSJ': 'string data', 'keyName': [2,3,5,7]}";
RSJresource my_json(str);
std::cout << my_json["keyName"][2].as<int>() << std::endl; // prints 5
std::cout << my_json["RSJ"].as<std::string>("default string") << std::endl; // prints "string data"
std::cout << my_json["JSON"].as<std::string>("default string") << std::endl; // prints "default string"

The previous format is found extensively in the Driver.hpp which are mostly used in the UpdateMesh() and UpdateAnalysis() functions.

REFERENCE: