Parametrized Background Data Weak

1. Sensors

There is three type of sensors available:


A sensor capturing data around a point within a given radius


A sensor capturing data at a discrete point


A sensor capturing the average data on a surface

The definition of the sensors can be made through a json file:


This json file is then parsed by the class SensorMap:

auto Xh = space_type::New(mesh);
SensorMap<space_type> sigmas(Xh);
auto i = std::ifstream("mysensors.json");
sigmas.loadJson(json::parse(i, nullptr, true, true));

2. Using PBDW

In order to use PBDW, we need a set of sensors and a reduced basis.

auto XR = crbModel->rBFunctionSpace();
auto pbdw = std::make_shared<PBDW<reducedbasis_type>>(soption(""), XR, sigmas, crb->id());

If we want to compute outputs with PBDW, we need a vector of vector representing the linear form and a vector of names for the outputs.
One drawback of PBDW is that the outputs have to be independant of the parameters, since the value of these are unknonw.

std::vector<vector_ptrtype> Fs;
//...fill linear forms
std::vector<std::string> outputNames;
//...fill names
pbdw->setOutputs(Fs, outputNames);

After that, we only need to launch the offline phase:


For the online phase, we need the values of all or a subset of the sensors to compute either the coefficients of the solution in the reduced basis, or the value of the outputs:

Eigen::VectorXd yobs; // observations from all the sensors
auto uN = pbdw->online(yobs); // coefficients of the solution
auto sN = pbdw->outputs(yobs); // values of the outputs
Eigen::VectorXd yobsPartial; // observation of a subset of the sensors
auto uNPartial = pbdw->online(yobsPartial, {1,2,3}); // the second argument is the index of the sensors used
auto sNPartial = pbdw->onlune(yobdsPartial, {{"sensor1","sensor2","sensor3"}}); // the second argument is the names of the sensors used