20 lines
719 B
C++
Executable File
20 lines
719 B
C++
Executable File
#include "generators/scalar_field_generator.h"
|
|
|
|
#include "functions/functions.h"
|
|
#include "generators/function_generator.h"
|
|
#include "simulation/errors.h"
|
|
#include "simulation/jansson_additionals.h"
|
|
|
|
namespace generator {
|
|
std::shared_ptr<ScalarField> buildScalarField(json_t* object) {
|
|
if (json_object_by_path(object, {"ScalarFieldFunctionInZ"})) {
|
|
std::function<double(double, double, double)> z_function = function3D(
|
|
json_object_by_path(object, {"ScalarFieldFunctionInZ", "zFunction"}));
|
|
return std::shared_ptr<ScalarField>(new ScalarFieldFunctionInZ(z_function));
|
|
} else {
|
|
ERROR("This scalar field is not implemented.");
|
|
return nullptr;
|
|
}
|
|
return nullptr;
|
|
}
|
|
}; // namespace generator
|