Skip to content

Commit

Permalink
Update maxwell_global_rom.cpp
Browse files Browse the repository at this point in the history
Changed saving mesh/sol files to calculate relative errors

Saved mesh/solution files are now in folders titled "maxwell" instead of "example3"
  • Loading branch information
andersonw1 authored Nov 10, 2023
1 parent 16ab29f commit 8f231e1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions examples/prom/maxwell_global_rom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,22 @@ int main(int argc, char *argv[])
ofstream sol_ofs(sol_name.str().c_str());
sol_ofs.precision(8);
x.Save(sol_ofs);

ofstream sol_dofs_ofs(sol_dofs_name.str().c_str());
sol_dofs_ofs.precision(16);
for (int i = 0; i < x.Size(); ++i)
{
sol_dofs_ofs << x[i] << std::endl;
}
}

// 28. Save data in the VisIt format.
DataCollection *dc = NULL;
if (visit)
{
if (offline) dc = new VisItDataCollection("Example3", pmesh);
else if (fom) dc = new VisItDataCollection("Example3_fom", pmesh);
else if (online) dc = new VisItDataCollection("Example3_rom", pmesh);
if (offline) dc = new VisItDataCollection("maxwell", pmesh);
else if (fom) dc = new VisItDataCollection("maxwell_fom", pmesh);
else if (online) dc = new VisItDataCollection("maxwell_rom", pmesh);
dc->SetPrecision(precision);
dc->RegisterField("solution", &x);
dc->Save();
Expand Down

0 comments on commit 8f231e1

Please sign in to comment.