Skip to content

Refactor: only keep one Charge_Mixing::inner_product_recip() #3603

@WHUweiqingzhou

Description

@WHUweiqingzhou

Describe the Code Quality Issue

Currently, ABACUS has three functions to calculate the inner product of two vector in recip space, namely:

  1. Charge_Mixing::inner_product_recip()
  2. Charge_Mixing::inner_product_recip_new1()
  3. Charge_Mixing::inner_product_recip_new2()

Too many similar functions will confuse others.
Since the data stored in rhog is not what Charge_Mixing want, the input data of Charge_Mixing::inner_product_recip() and Charge_Mixing::inner_product_recip_new1() is different. I will:

  1. move Charge_Mixing::inner_product_recip() and get_drho() into Charge
  2. let all mix functions use Charge_Mixing::inner_product_recip_new1()

This is a step for refactor of Charge_Mixing class #3363.

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Identify the specific code file or section with the code quality issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified issue.
  • Refactor the code to improve code quality, following the suggested solution.
  • Ensure the refactored code adheres to the project's coding standards.
  • Test the refactored code to ensure it functions as expected.
  • Update any relevant documentation, if necessary.
  • Submit a pull request with the refactored code and a description of the changes made.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions