Skip to content

(AngleBasedLSCM) Improve construction of A and B matrices #3

@csparker247

Description

@csparker247

Summary

The A and B matrix assembly in AngleBasedLSCM::Compute is a large block of nearly-identical per-vertex conditionals repeated three times per face (for e0, e1, e2). This is hard to read and maintain.

Proposed Fix

Extract a helper lambda inside Compute:

auto addContrib = [&](std::size_t row, const EdgePtr& e, T c, T s) {
    if (e->vertex == p0)      { /* push to tripletsB (fixed p0) */ }
    else if (e->vertex == p1) { /* push to tripletsB (fixed p1) */ }
    else {
        auto freeIdx = freeIdxTable.at(e->vertex->idx);
        /* push to tripletsA (free) */
    }
};

Replace the three repeated per-vertex blocks with calls to addContrib. Add comments linking the structure to the equations in Lévy et al. (2002).

Acceptance Criteria

  • No behavioral change — all existing tests pass with bit-identical results
  • Face loop body is visibly shorter

Conductor Track

A6


Migrated from GitLab issue #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions