Skip to content

feat(input, kpoints): support shifted kspacing mesh with koffset and kmesh_type#7247

Merged
Cstandardlib merged 10 commits intodeepmodeling:developfrom
Cstandardlib:feat/kspacing-shift
Apr 17, 2026
Merged

feat(input, kpoints): support shifted kspacing mesh with koffset and kmesh_type#7247
Cstandardlib merged 10 commits intodeepmodeling:developfrom
Cstandardlib:feat/kspacing-shift

Conversation

@Cstandardlib
Copy link
Copy Markdown
Collaborator

Linked Issue

Refs #7242

Description

This PR adds shifted k-point mesh support for the kspacing workflow.

Previously, when kspacing > 0, ABACUS always generated a Gamma mesh with fixed offset 0 0 0.
Now users can configure both mesh type and offset for auto-generated K_POINTS.

What's changed?

  1. Added new INPUT parameters:

    • koffset: 3 real values, default 0.0 0.0 0.0
    • kmesh_type: gamma or mp, default gamma
  2. Extended input parsing and validation:

    • koffset must provide exactly 3 values
    • kmesh_type accepts gamma/mp (case-insensitive handling, normalized internally)
  3. Updated kspacing auto K_POINTS generation:

    • mesh type is selected by kmesh_type
    • offsets come from koffset instead of hardcoded 0 0 0
  4. Updated documentation with new options

Unit Tests and/or Case Tests for my changes

  • Add klist unit tests for shifted gamma/mp paths

Any changes of core modules?

  • Default kspacing behavior remains unchanged.
  • kspacing branch now supports configurable mesh type and offset.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable shifted automatic k-point meshes for the kspacing workflow by introducing koffset and kmesh_type, and updates documentation/tests accordingly.

Changes:

  • Added new INPUT parameters koffset (3 reals) and kmesh_type (gamma/mp) with parsing/validation.
  • Updated kspacing auto-generated K_POINTS to use the configured mesh type and offset.
  • Added unit tests for shifted Gamma and Monkhorst-Pack paths; updated docs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
source/source_io/module_parameter/read_input_item_system.cpp Registers/parses koffset and kmesh_type input items.
source/source_io/module_parameter/input_parameter.h Adds koffset and kmesh_type to Input_para.
source/source_cell/klist.cpp Uses kmesh_type and koffset when writing auto K_POINTS for kspacing.
source/source_cell/test/klist_test.cpp Adds/updates tests to cover shifted Gamma/MP meshes under kspacing.
docs/parameters.yaml Documents new parameters (and includes other OFDFT doc changes).
docs/advanced/input_files/input-main.md Adds new parameter sections for koffset/kmesh_type (but also alters OFDFT docs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/source_io/module_parameter/read_input_item_system.cpp
Comment thread docs/advanced/input_files/input-main.md
Comment thread docs/advanced/input_files/input-main.md
Comment thread docs/advanced/input_files/input-main.md
Comment thread source/source_io/module_parameter/read_input_item_system.cpp Outdated
@Cstandardlib Cstandardlib merged commit 3669a02 into deepmodeling:develop Apr 17, 2026
15 of 19 checks passed
@Cstandardlib Cstandardlib deleted the feat/kspacing-shift branch April 17, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants