Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • Nektar Nektar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 84
    • Issues 84
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Nektar
  • NektarNektar
  • Issues
  • #310

Fix ForcingBody function with mixed coordinates and equation variables

If equation variables are used in the ForcingBody function, the coordinate Arrays are allocated but not assigned value. The defaul value 0 is used for all coordinate variables. This patch can be applied to have a quick fix.

diff --git a/library/SolverUtils/Forcing/ForcingBody.cpp b/library/SolverUtils/Forcing/ForcingBody.cpp
index 57d407be2..6a21b8e76 100644
--- a/library/SolverUtils/Forcing/ForcingBody.cpp
+++ b/library/SolverUtils/Forcing/ForcingBody.cpp
@@ -136,6 +136,7 @@ void ForcingBody::Update(
                 // Coupled forcing
                 int nq = pFields[0]->GetNpoints();
                 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq), t(nq, time);
+                pFields[0]->GetCoords(xc, yc, zc);
                 std::string varstr                                  = "x y z";
                 std::vector<Array<OneD, const NekDouble>> fielddata = {xc, yc,
                                                                        zc, t};

In the ForcingBody, the coordinate Arrays and variable Arrays are allocated and released in each loop. This overhead is unnecessary. We can reformat this process to imporve its performance and ability.

In addition,

  • In the v_InitObject function, automatically find which coordinate or variable is used in the expression.

  • The body force doesn't need to be defined for all variables.

Edited Jan 29, 2023 by Ankang Gao
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking