Skip to content

Commit 2b2d1eb

Browse files
committed
remove default parameter from dense matrix constructor
1 parent 91c8ebc commit 2b2d1eb

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

apps/NeoHookean/neo_hookean.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void neo_hookean(RXMeshStatic& rx, T dx)
4545
const T stiffness_coef = 4e4;
4646
const T tol = 0.01;
4747
const T inv_time_step = T(1) / time_step;
48-
DenseMatrix<T> dbc_stiff(1, 1);
48+
DenseMatrix<T> dbc_stiff(1, 1, LOCATION_ALL);
4949
dbc_stiff(0) = 1000;
5050
dbc_stiff.move(HOST, DEVICE);
5151
const T dhat = 0.01;
@@ -169,10 +169,10 @@ void neo_hookean(RXMeshStatic& rx, T dx)
169169
problem, contact_area, time_step, ground_n, ground_o, dhat, kappa);
170170

171171
DenseMatrix<T, Eigen::RowMajor> dir(
172-
rx, problem.grad.rows(), problem.grad.cols());
172+
rx, problem.grad.rows(), problem.grad.cols(), LOCATION_ALL);
173173

174174
DenseMatrix<T, Eigen::RowMajor> grad(
175-
rx, problem.grad.rows(), problem.grad.cols());
175+
rx, problem.grad.rows(), problem.grad.cols(), LOCATION_ALL);
176176

177177
T line_search_init_step = 0;
178178

include/rxmesh/diff/candidate_pairs.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ struct CandidatePairs
4444
m_variable_dim(hess.K_),
4545
m_pairs_id(DenseMatrix<IndexT, Eigen::ColMajor>(
4646
max_capacity * m_variable_dim * m_variable_dim * 2,
47-
2)),
48-
m_pairs_handle(DenseMatrix<PairT, Eigen::ColMajor>(max_capacity, 1)),
49-
m_current_num_pairs(DenseMatrix<int>(1, 1)),
50-
m_current_num_index(DenseMatrix<int>(1, 1)),
47+
2,
48+
LOCATION_ALL)),
49+
m_pairs_handle(DenseMatrix<PairT, Eigen::ColMajor>(max_capacity,
50+
1,
51+
LOCATION_ALL)),
52+
m_current_num_pairs(DenseMatrix<int>(1, 1, LOCATION_ALL)),
53+
m_current_num_index(DenseMatrix<int>(1, 1, LOCATION_ALL)),
5154
m_context(ctx)
5255
{
5356
reset();

include/rxmesh/diff/diff_scalar_problem.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ struct DiffScalarProblem
5454
bool assmble_hessian,
5555
int expected_vv_candidate_pairs = 0)
5656
: rx(rx),
57-
grad(DenseMatT(rx, rx.get_num_elements<ObjHandleT>(), VariableDim)),
57+
grad(DenseMatT(rx,
58+
rx.get_num_elements<ObjHandleT>(),
59+
VariableDim,
60+
LOCATION_ALL)),
5861
objective(rx.add_vertex_attribute<T>("objective", VariableDim))
5962
{
6063
grad.reset(0, LOCATION_ALL);

include/rxmesh/diff/newton_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct NetwtonSolver
3333
*/
3434
NetwtonSolver(DiffProblemT& p, SolverT* s)
3535
: problem(p),
36-
dir(DenseMatT(p.rx, p.grad.rows(), p.grad.cols())),
36+
dir(DenseMatT(p.rx, p.grad.rows(), p.grad.cols(), LOCATION_ALL)),
3737
temp_objective(
3838
p.rx.add_attribute_like("temp_objective", *p.objective)),
3939
solver(s),

include/rxmesh/matrix/dense_matrix.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ struct DenseMatrix
6161
* of vertices, edges, or faces. With constructor, the user can access
6262
* the matrix using mesh handles
6363
*/
64-
DenseMatrix(const RXMesh& rx,
65-
IndexT num_rows,
66-
IndexT num_cols,
67-
locationT location = LOCATION_ALL)
64+
explicit DenseMatrix(const RXMesh& rx,
65+
IndexT num_rows,
66+
IndexT num_cols,
67+
locationT location)
6868
: m_context(rx.get_context()),
6969
m_num_rows(num_rows),
7070
m_num_cols(num_cols),
@@ -84,9 +84,7 @@ struct DenseMatrix
8484
* So the size (num_rows) can be anything. However, using this constructor
8585
* means that you can not access the matrix using handles
8686
*/
87-
DenseMatrix(IndexT num_rows,
88-
IndexT num_cols,
89-
locationT location = LOCATION_ALL)
87+
explicit DenseMatrix(IndexT num_rows, IndexT num_cols, locationT location)
9088
: m_num_rows(num_rows),
9189
m_num_cols(num_cols),
9290
m_dendescr(NULL),

0 commit comments

Comments
 (0)