Skip to content

Commit 9b1c628

Browse files
committed
Use libMesh::out in calculator
1 parent ac2e11d commit 9b1c628

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/apps/calculator.C

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ int main(int argc, char ** argv)
169169
const std::string meshname =
170170
assert_argument(cl, "--inmesh", argv[0], std::string(""));
171171

172-
std::cout << "Reading mesh " << meshname << std::endl;
172+
libMesh::out << "Reading mesh " << meshname << std::endl;
173173
old_mesh.read(meshname);
174174

175175
const std::string matname =
176176
cl.follow(std::string(""), "--inmat");
177177

178178
if (matname != "")
179179
{
180-
std::cout << "Reading matrix " << matname << std::endl;
180+
libMesh::out << "Reading matrix " << matname << std::endl;
181181

182182
// For extraction matrices Coreform has been experimenting with
183183
// PETSc solvers which take the transpose of what we expect, so
@@ -189,7 +189,7 @@ int main(int argc, char ** argv)
189189
old_mesh.copy_constraint_rows(*matrix);
190190
}
191191

192-
std::cout << "Mesh:" << std::endl;
192+
libMesh::out << "Mesh:" << std::endl;
193193
old_mesh.print_info();
194194

195195
const std::string solnname = cl.follow(std::string(""), "--insoln");
@@ -211,7 +211,7 @@ int main(int argc, char ** argv)
211211

212212
if (solnname != "")
213213
{
214-
std::cout << "Reading solution " << solnname << std::endl;
214+
libMesh::out << "Reading solution " << solnname << std::endl;
215215

216216
old_es.read(solnname,
217217
EquationSystems::READ_HEADER |
@@ -271,6 +271,9 @@ int main(int argc, char ** argv)
271271
const std::string outsolnname =
272272
cl.follow(default_outsolnname, "--outsoln");
273273

274+
// Output results in high precision
275+
libMesh::out << std::setprecision(std::numeric_limits<Real>::max_digits10);
276+
274277
if (!cl.search("--integral"))
275278
{
276279
// Create a new mesh and a new EquationSystems
@@ -369,7 +372,7 @@ int main(int argc, char ** argv)
369372

370373
Number integral = integrate.integral();
371374
old_mesh.comm().sum(integral);
372-
std::cout << "Integral is " << integral << std::endl;
375+
libMesh::out << "Integral is " << integral << std::endl;
373376
}
374377

375378
return 0;

0 commit comments

Comments
 (0)