Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full Tensor Implementation #16

Open
4 tasks
VatsalSy opened this issue Nov 23, 2024 · 0 comments
Open
4 tasks

Full Tensor Implementation #16

VatsalSy opened this issue Nov 23, 2024 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@VatsalSy
Copy link
Member

Issue: Full Tensor Implementation as a Pre-requisite to #6 and #12

Description:
As a pre-requisite to issues #6 and #12, it would be beneficial to implement a full tensor framework. The current challenge lies in the incompatibility between 3D implementations and symmetric tensors.

Reference Code:
Link to source code

tensor new_symmetric_tensor (const char * name)
{
  struct { char * x, * y, * z; } ext = {".x.x", ".y.y", ".z.z"};
  tensor t;
  foreach_dimension()
    t.x.x = alloc_block_scalar (name, ext.x, 1);
  #if dimension > 1
    t.x.y = alloc_block_scalar (name, ".x.y", 1);
    t.y.x = t.x.y;
  #endif
  #if dimension > 2
    t.x.z = alloc_block_scalar (name, ".x.z", 1);
    t.z.x = t.x.z;
    t.y.z = alloc_block_scalar (name, ".y.z", 1);
    t.z.y = t.y.z;
  #endif
  /* fixme: boundary conditions don't work!  This is because boundary
     attributes depend on the index and should (but cannot) be
     different for t.x.y and t.y.x */
  init_tensor (t, NULL);
  return t;
}

TODO:

  • Ideally, we would like to consistently use tensor formulation to leverage ease of readability and maintainability.
  • However, this is currently blocked by a limitation in Basilisk's core implementation (see basilisk/src/grid/cartesian-common.h line ~246: "fixme: boundary conditions don't work!").
  • Once this limitation is resolved in Basilisk's core, we can:
  • Convert scalar implementation to use tensors
  • Make the code generally compatible using foreach_dimensions
  • Improve code maintainability and readability
  • Potentially merge with the 2D tensor-based implementation

Related Issues:

@VatsalSy VatsalSy self-assigned this Nov 23, 2024
@VatsalSy VatsalSy added the help wanted Extra attention is needed label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant