Skip to content

Commit d95328f

Browse files
committed
Improve default algo updater
1 parent e301142 commit d95328f

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ void AlgorithmParameterList::addParameter(const AlgorithmParameterName& key, con
254254

255255
AlgorithmStatusReporter::AlgorithmStatusReporter()
256256
{
257+
#if DEBUG
257258
setUpdaterFunc(defaultUpdaterFunc_);
259+
#else
260+
setUpdaterFunc([](double x) {});
261+
#endif
258262
}
259263

260264
AlgorithmStatusReporter::UpdaterFunc AlgorithmStatusReporter::defaultUpdaterFunc_([](double r) { std::cout << "Algorithm at " << std::setiosflags(std::ios::fixed) << std::setprecision(2) << r*100 << "% complete" << std::endl;});

src/Core/Algorithms/BrainStimulator/ElectrodeCoilSetupAlgorithm.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,6 @@ boost::tuple<DenseMatrixHandle, FieldHandle, FieldHandle, VariableHandle> Electr
821821
/// use projected point r (that was projected on scalp surface) to differentiate which surface is the one to use
822822
/// but first splitbydomain to get the surface with tha value 1.0
823823
SplitFieldByDomainAlgo algo_splitfieldbydomain;
824-
algo_splitfieldbydomain.setUpdaterFunc(getUpdaterFunc());
825824
algo_splitfieldbydomain.setLogger(getLogger());
826825
FieldList final_electrode_sponge_surf_domainsplit;
827826
algo_splitfieldbydomain.set(SplitFieldByDomainAlgo::SortBySize, true);

src/Core/Algorithms/BrainStimulator/SetupRHSforTDCSandTMSAlgorithm.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ boost::tuple<DenseMatrixHandle, DenseMatrixHandle, DenseMatrixHandle, DenseMatri
489489
/// use SplitFieldByDomainAlgo to find only labeled (based on elc. normal criteria) surfaces
490490
VMesh::Elem::index_type c_ind=0;
491491
SplitFieldByDomainAlgo algo2;
492-
algo2.setUpdaterFunc(getUpdaterFunc());
493492
algo2.setLogger(getLogger());
494493
FieldList output;
495494
algo2.set(SplitFieldByDomainAlgo::SortBySize, true);

src/Core/Algorithms/Legacy/Fields/MeshData/SetMeshNodes.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ SetMeshNodesAlgo::run(FieldHandle input, DenseMatrixHandle matrix, FieldHandle&
7474
{
7575
/// @todo: worth separating out into factory call for mocking purposes? probably not, just keep the concrete dependence
7676
ConvertMeshToIrregularMeshAlgo algo;
77-
algo.setUpdaterFunc(getUpdaterFunc());
7877

7978
if (!algo.run(input,output))
8079
return (false);

src/Core/Algorithms/Legacy/Fields/RefineMesh/RefineMesh.cc

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ RefineMeshAlgo::runImpl(FieldHandle input, FieldHandle& output) const
111111
error("This algorithm does not support point or prism meshes");
112112
return(false);
113113
}
114-
115-
if ((!(fi.is_scalar()))&&(addCon != "all"))
114+
115+
if ((!(fi.is_scalar())) && (addCon != "all"))
116116
{
117117
error("Field data needs to be of scalar type");
118118
return (false);
@@ -122,40 +122,39 @@ RefineMeshAlgo::runImpl(FieldHandle input, FieldHandle& output) const
122122
{
123123
RefineMeshQuadSurfAlgoV algo;
124124
algo.setUpdaterFunc(getUpdaterFunc());
125-
return(algo.runImpl(input,output,addCon,isoVal));
125+
return(algo.runImpl(input, output, addCon, isoVal));
126126
}
127-
127+
128128
if (fi.is_hex_element())
129129
{
130-
bool convex = false;
131-
convex = rMethod == "Expand refinement volume to improve element quality";
130+
bool convex = false;
131+
convex = rMethod == "Expand refinement volume to improve element quality";
132132
RefineMeshHexVolAlgoV algo;
133133
algo.setUpdaterFunc(getUpdaterFunc());
134-
return(algo.runImpl(input,output,convex,addCon,isoVal));
134+
return(algo.runImpl(input, output, convex, addCon, isoVal));
135135
}
136136

137137
if (fi.is_crv_element())
138138
{
139-
RefineMeshCurveAlgoV algo;
140-
algo.setUpdaterFunc(getUpdaterFunc());
141-
return(algo.runImpl(input,output,addCon,isoVal));
139+
RefineMeshCurveAlgoV algo;
140+
algo.setUpdaterFunc(getUpdaterFunc());
141+
return(algo.runImpl(input, output, addCon, isoVal));
142142
}
143-
143+
144144
if (fi.is_tri_element())
145-
{
146-
RefineMeshTriSurfAlgoV algo;
147-
algo.setUpdaterFunc(getUpdaterFunc());
148-
return(algo.runImpl(input,output,addCon,isoVal));
145+
{
146+
RefineMeshTriSurfAlgoV algo;
147+
algo.setUpdaterFunc(getUpdaterFunc());
148+
return(algo.runImpl(input, output, addCon, isoVal));
149149
}
150-
150+
151151
if (fi.is_tet_element())
152152
{
153-
RefineMeshTetVolAlgoV algo;
154-
algo.setUpdaterFunc(getUpdaterFunc());
155-
return(algo.runImpl(input,output,addCon,isoVal));
153+
RefineMeshTetVolAlgoV algo;
154+
algo.setUpdaterFunc(getUpdaterFunc());
155+
return(algo.runImpl(input, output, addCon, isoVal));
156156
}
157157

158158
error("No refinement method has been implemented for this type of mesh");
159159
return (false);
160-
}
161-
160+
}

0 commit comments

Comments
 (0)