Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
Expand Down
3 changes: 1 addition & 2 deletions Superbuild/EigenExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@

SET_PROPERTY(DIRECTORY PROPERTY "EP_BASE" ${ep_base})

# TODO: test on Windows
ExternalProject_Add(Eigen_external
URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz"
URL "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz"
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE ON
Expand Down
2 changes: 1 addition & 1 deletion Superbuild/SpdLogExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SET_PROPERTY(DIRECTORY PROPERTY "EP_BASE" ${ep_base})
# git checkout -q will silence message about detached head (harmless).
ExternalProject_Add(SpdLog_external
GIT_REPOSITORY "https://github.com/gabime/spdlog"
GIT_TAG "v1.3.1"
GIT_TAG "v1.10.0"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ boost::tuple<DenseMatrixHandle, VariableHandle> GenerateROIStatisticsAlgorithm::
const double invalidDouble = std::numeric_limits<double>::quiet_NaN();

/// efficient way to compute std dev. in just one loop over all mesh elements: sqrt ( 1/(n-1) (Sx^2 - avr Sx + n avr^2 )
for (VMesh::Elem::index_type j=0; j < number_of_atlas_materials; ++j)
for (auto j=0; j < number_of_atlas_materials; ++j)
{
double Sx=value_avr[j];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
/// prepare LHS_KNOWNS which is the an input to addknownstolinearsystem (called x) besides the
/// stiffness matrix
lhs_knows = makeShared<DenseMatrix>(mesh_num_nodes, 1);
for (VMesh::Node::index_type idx = 0; idx < mesh_num_nodes; idx++)
{ (*lhs_knows)(idx, 0) = std::numeric_limits<double>::quiet_NaN(); }
for (auto idx = 0; idx < mesh_num_nodes; idx++)
{
(*lhs_knows)(idx, 0) = std::numeric_limits<double>::quiet_NaN();
}
(*lhs_knows)(refnode_number, 0) = 0;

if (fi4.is_pointcloudmesh())
Expand Down Expand Up @@ -363,7 +365,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
/// (Cleaver), this mapping is meant to map the GUI inputs to actual electrode geometry by having
/// a lookup table
int electrode_sponges = elc_sponge_location->nrows();
DenseMatrixHandle lookup(new DenseMatrix(electrode_sponges, 1));
std::vector<long> lookup(electrode_sponges);
DenseMatrixHandle distances(new DenseMatrix(electrode_sponges, 1));
VMesh::Node::index_type didx;
double distance = 0;
Expand All @@ -388,7 +390,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
found_index = j;
}
}
(*lookup)(i, 0) = found_index;
lookup[i] = found_index;
(*distances)(i, 0) = min_dis;
}

Expand Down Expand Up @@ -580,11 +582,11 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
double elc_thickness = 0;
bool found = false;

for (long j = 0; j < lookup->nrows(); j++)
for (auto j = 0; j < lookup.size(); j++)
{
if ((*lookup)(j, 0) == k)
if (lookup[j] == k)
{
elc_thickness = (*elc_sponge_location)((*lookup)(j, 0), 3);
elc_thickness = (*elc_sponge_location)(k, 3);
found = true;
}
}
Expand Down Expand Up @@ -816,7 +818,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
double area = 0.0, prev_elc = 0, tmp_fld_val = 0;
for (VMesh::Elem::index_type l = 0; l < elc_sponge_surf_vmesh->num_elems(); l++)
{
(*elc_elem_typ)(l, 0) = 2; // define triangles to incject currents in TDCS simulations
(*elc_elem_typ)(static_cast<std::uint64_t>(l), 0) = 2; // define triangles to incject currents in TDCS simulations
VMesh::Node::array_type onodes(3);
elc_sponge_surf_vmesh->get_nodes(onodes, l);
elc_sponge_surf_vmesh->get_center(p, onodes[0]);
Expand All @@ -828,7 +830,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
"Reference node is part of electrode definition. Choose another reference node for given "
"electrode surface mesh. ");
}
(*elc_elem_def)(l, 0) = node_ind;
(*elc_elem_def)(static_cast<std::uint64_t>(l), 0) = node_ind;
Point pos;
mesh_vmesh->get_point(pos, node_ind);
double x1 = pos.x(), y1 = pos.y(), z1 = pos.z();
Expand All @@ -842,7 +844,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
"Reference node is part of electrode definition. Choose another reference node for given "
"electrode surface mesh. ");
}
(*elc_elem_def)(l, 1) = node_ind;
(*elc_elem_def)(static_cast<uint64_t>(l), 1) = node_ind;
mesh_vmesh->get_point(pos, node_ind);
double x2 = pos.x(), y2 = pos.y(), z2 = pos.z();
elc_sponge_surf_vmesh->get_center(p, onodes[2]);
Expand All @@ -854,12 +856,12 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
"Reference node is part of electrode definition. Choose another reference node for given "
"electrode surface mesh. ");
}
(*elc_elem_def)(l, 2) = node_ind;
(*elc_elem_def)(static_cast<uint64_t>(l), 2) = node_ind;
mesh_vmesh->get_point(pos, node_ind);
double x3 = pos.x(), y3 = pos.y(), z3 = pos.z();

(*elc_elem_def)(l, 3) = 0;
(*elc_elem)(l, 0) = field_values[l];
(*elc_elem_def)(static_cast<uint64_t>(l), 3) = 0;
(*elc_elem)(static_cast<uint64_t>(l), 0) = field_values[l];

/// compute surface area of electrode/scalp interface
double area_tmp = y1 * z2 + z1 * y3 + y2 * z3 - z2 * y3 - z1 * y2 - y1 * z3;
Expand Down Expand Up @@ -898,7 +900,7 @@ SetupTDCSAlgorithm::create_lhs(FieldHandle mesh, const std::vector<Variable>& im
"Internal ERROR (should not happen): could not scale contact impedance by electrode "
"surface area (index out of bound). ");
}
(*elc_con_imp)(l, 0) = impedances[tmp_fld_val] * electrode_sponge_areas[tmp_fld_val];
(*elc_con_imp)(static_cast<uint64_t>(l), 0) = impedances[tmp_fld_val] * electrode_sponge_areas[tmp_fld_val];
}

DenseMatrixHandle selectmatrixind(
Expand Down Expand Up @@ -939,7 +941,7 @@ DenseMatrixHandle SetupTDCSAlgorithm::create_rhs(FieldHandle mesh, FieldHandle e
auto mesh_elc_tri_surf = elc_tri_surf->vmesh();
mesh_elc_tri_surf->synchronize(Mesh::NODE_LOCATE_E);
vmesh->synchronize(Mesh::NODE_LOCATE_E);
for (VMesh::Node::index_type l = 0; l < vmesh->num_nodes(); l++) { (*output)(l, 0) = 0; }
for (auto l = 0; l < vmesh->num_nodes(); l++) { (*output)(l, 0) = 0; }
double min_dis = get(Parameters::pointdistancebound).toDouble();
for (VMesh::Node::index_type l = 0; l < mesh_elc_tri_surf->num_nodes(); l++)
{
Expand All @@ -948,14 +950,10 @@ DenseMatrixHandle SetupTDCSAlgorithm::create_rhs(FieldHandle mesh, FieldHandle e
double distance = -1;
VMesh::Node::index_type ind;
vmesh->find_closest_node(distance, q, ind, p);
(*output)(ind, 0) = elcs_wanted[l].toDouble() / 1000.0;
(*output)(static_cast<uint64_t>(ind), 0) = elcs_wanted[l].toDouble() / 1000.0;
if (min_dis < distance)
{
std::ostringstream ostr4;
ostr4 << " The electrode locations (4th module input) are further away from them mesh as "
"provided by the GUI (min. distance bound). "
<< std::endl;
remark(ostr4.str());
remark("The electrode locations (4th module input) are further away from them mesh as provided by the GUI (min. distance bound).\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ TEST(MapFieldDataFromElemToNode, TetMeshTestInterpolateWithFile)

DenseMatrixHandle output(new DenseMatrix(8, 1));

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
result->vfield()->get_value((*output)(idx, 0),idx);
}

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp = 0;
expected_result->vfield()->get_value(tmp,idx);
Expand All @@ -151,14 +151,14 @@ TEST(MapFieldDataFromElemToNode, TetMeshTestMin)

DenseMatrixHandle output(new DenseMatrix(8, 1));

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
result->vfield()->get_value((*output)(idx, 0),idx);
}

DenseMatrixHandle expected_result_min = test_mapfielddatafromelemtonodeFLD_Min();

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp = (*expected_result_min)(idx,0);
EXPECT_NEAR( tmp,(*output)(idx, 0), 1e-16);
Expand All @@ -179,14 +179,14 @@ TEST(MapFieldDataFromElemToNode, TetMeshTestMax)

DenseMatrixHandle output(new DenseMatrix(8, 1));

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
result->vfield()->get_value((*output)(idx, 0),idx);
}

DenseMatrixHandle expected_result_max = test_mapfielddatafromelemtonodeFLD_Max();

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp = (*expected_result_max)(idx,0);
EXPECT_NEAR( tmp,(*output)(idx, 0), 1e-16);
Expand All @@ -207,14 +207,14 @@ TEST(MapFieldDataFromElemToNode, TetMeshTestSum)

DenseMatrixHandle output(new DenseMatrix(8, 1));

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
result->vfield()->get_value((*output)(idx, 0),idx);
}

DenseMatrixHandle expected_result_sum = test_mapfielddatafromelemtonodeFLD_Sum();

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp = (*expected_result_sum)(idx,0);
EXPECT_NEAR( tmp,(*output)(idx, 0), 1e-16);
Expand All @@ -236,14 +236,14 @@ TEST(MapFieldDataFromElemToNode, TetMeshTestMed)

DenseMatrixHandle output(new DenseMatrix(8, 1));

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
result->vfield()->get_value((*output)(idx, 0),idx);
}

DenseMatrixHandle expected_result_med = test_mapfielddatafromelemtonodeFLD_Med();

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp = (*expected_result_med)(idx,0);
EXPECT_NEAR( tmp,(*output)(idx, 0), 1e-16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests,TestInterpolationAverage)

ASSERT_TRUE(result->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp=0;
result->vfield()->get_value(tmp,idx);
Expand All @@ -140,7 +140,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests,TestInterpolationAverage)

ASSERT_TRUE(result2->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result2->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result2->vfield()->num_values(); idx++)
{
double tmp=0;
result2->vfield()->get_value(tmp,idx);
Expand Down Expand Up @@ -181,7 +181,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests, TestMin)

ASSERT_TRUE(result->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp=0;
result->vfield()->get_value(tmp,idx);
Expand All @@ -206,7 +206,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests, TestMax)

ASSERT_TRUE(result->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp=0;
result->vfield()->get_value(tmp,idx);
Expand All @@ -231,7 +231,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests, TestSum)

ASSERT_TRUE(result->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp=0;
result->vfield()->get_value(tmp,idx);
Expand All @@ -256,7 +256,7 @@ TEST(MapFieldDataFromNodeToElemAlgoTests, TestMedian)

ASSERT_TRUE(result->vfield()->num_values() == 6);

for (VMesh::Elem::index_type idx = 0; idx < result->vfield()->num_values(); idx++)
for (auto idx = 0; idx < result->vfield()->num_values(); idx++)
{
double tmp=0;
result->vfield()->get_value(tmp,idx);
Expand Down
2 changes: 0 additions & 2 deletions src/Core/Algorithms/Legacy/Converter/ConvertBundleToField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ bool ConvertBundleToFieldAlgo::runImpl(const BundleHandle& input, FieldHandle& o
omesh->node_reserve(tot_num_nodes);
omesh->elem_reserve(tot_num_elems);

size_type nodes_offset = 0;
size_type elems_offset = 0;
size_type nodes_count = 0;
size_type elems_count = 0;
Expand Down Expand Up @@ -411,7 +410,6 @@ bool ConvertBundleToFieldAlgo::runImpl(const BundleHandle& input, FieldHandle& o
}

elems_offset += elems_count;
nodes_offset += nodes_count;

update_progress_max(p+1, inputs.size());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ CalculateIsInsideFieldAlgo::runImpl(FieldHandle input, FieldHandle objfield, Fie
if (fo.is_tensor()) fo.make_double();
fo.make_constantdata();

bool clean_field = false;

if (!output)
{
output = CreateField(fo,input->mesh());
Expand All @@ -112,7 +110,6 @@ CalculateIsInsideFieldAlgo::runImpl(FieldHandle input, FieldHandle objfield, Fie
error("Could not create output field");
return(false);
}
clean_field = true;
}

// For the moment we calculate everything in doubles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool BuildMatrixOfSurfaceNormalsAlgo::runImpl(FieldHandle input, DenseMatrixHand
return (false);
}

VMesh::Node::index_type k = 0;
int k = 0;
int cnt = 0;
Vector norm;
for (VMesh::Node::index_type i=0; i<num_nodes; ++i)
Expand Down
Loading