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

Anisotropic diffusion #744

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Anisotropic diffusion #744

wants to merge 10 commits into from

Conversation

Xiaojingtang1234
Copy link
Collaborator

@Xiaojingtang1234 Xiaojingtang1234 commented Feb 9, 2025

This is for the anisotropic diffusion coupling with anisotropic resolution.

  • variables vec6d, mat6d are implemented in base_data_type.h
  • anisotropic_diffusion_relaxation.hpp is created for template classes.
  • AnisotropicKernelCorrectionMatrix is for the further kernel correction.
  • AnisotropicDiffusionRelaxation is for the anisotropic diffusion relaxation.*Laplacian_x, *Laplacian_y, are recorded for checking the diffusion rate in different directions.
  • The results are validated with functions $$\Phi = x +y $$ and $$\Phi = x^2 +y^2 $$.

Note that two issues related are created.
1, The displacement issue should be implemented another real rij_vector. . Related to #742
2, The current 2d case is depend on anisotropic_diffusion_relaxation.hpp . Related to #743

Additionaly, the neighborhood statement should be modified to if (kernel_->checkIfWithinCutOffRadius(displacement) ), matching the one in NeighborBuilderInner, note that index_i != index_j should be deleted, considering index maybe the same in different bodies.

void NeighborBuilderContact::operator()(Neighborhood &neighborhood,
                                        const Vecd &pos_i, size_t index_i, const ListData &list_data_j)
{
    size_t index_j = list_data_j.first;
    Vecd displacement = pos_i - list_data_j.second;
    Real distance = displacement.norm();
   if (kernel_->checkIfWithinCutOffRadius(displacement) )
    {
        neighborhood.current_size_ >= neighborhood.allocated_size_
            ? createNeighbor(neighborhood, distance, displacement, index_j)
            : initializeNeighbor(neighborhood, distance, displacement, index_j);
        neighborhood.current_size_++;
    }
};

@Xiangyu-Hu
Copy link
Owner

@Xiaojingtang1234 we can have a discussion on the implementation this week.

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.

2 participants