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

FEMVolume renumber_dofs breaks kinematic indices #283

Open
werner291 opened this issue Feb 11, 2021 · 0 comments
Open

FEMVolume renumber_dofs breaks kinematic indices #283

werner291 opened this issue Feb 11, 2021 · 0 comments

Comments

@werner291
Copy link

Hello,

the boundary_collider_desc in FEMVolume method calls renumber_dofs under the hood, which appears to neglect to update the kinematic_nodes, causing the kinematic nodes to be scattered throughout the volume.

Minimal code example:

let mut fem_body = FEMVolumeDesc::cube(5, 2, 2)
        .scale(Vector3::new(10.0, 0.5, 0.5))
        .young_modulus(1.0e3)
        .poisson_ratio(0.2)
        .mass_damping(0.2)
        .build();

    let to_be_kinematized = fem_body.positions().iter().enumerate().filter_map(|(i,p)| {
        if i % 3 == 0 && *p == -5.0 {
            dbg!(p);
            Some(i/3)
        } else {
            None
        }
    }).collect::<Vec<_>>();

    for i in to_be_kinematized.iter() {
        fem_body.set_node_kinematic(*i, true);
    }

    let co = fem_body.boundary_collider_desc();

    {
        let pp = fem_body.positions();
        dbg!(to_be_kinematized.iter().map(|i| {
            [pp[i * 3], pp[i * 3 + 1], pp[i * 3 + 2]]
        }).collect::<Vec<_>>());
    }

Observe, in the output from dbg!, that the x-coordinates are all over the place.

@werner291 werner291 changed the title FEWVolume renumber_dofs breaks kinematic indices FE<Volume renumber_dofs breaks kinematic indices Feb 11, 2021
@werner291 werner291 changed the title FE<Volume renumber_dofs breaks kinematic indices FEMVolume renumber_dofs breaks kinematic indices Feb 11, 2021
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

No branches or pull requests

1 participant