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

Multi material support #173

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Multi material support #173

wants to merge 9 commits into from

Conversation

streeve
Copy link
Collaborator

@streeve streeve commented Jan 13, 2025

Currently binary only (written to be easy to expand however)
ForceModels accepts a variadic list or tuple of models and calls each model per i,j pair as needed in the force loop

Temporary changes to KW to test the capability - missing new bimaterial example
Built off of #172 for better composability

Replaces #119
Closes #109

@streeve streeve added the enhancement New feature or request label Jan 13, 2025
@streeve streeve self-assigned this Jan 13, 2025
@streeve
Copy link
Collaborator Author

streeve commented Jan 13, 2025

@kinanbezem7 feel free to try this out or ask about the user interface here

// Total fiber volume
double Vftotal = Vf * Vd;
// Total number of fibers
int Nf = std::floor( Vftotal / Vfs );
Copy link
Collaborator

Choose a reason for hiding this comment

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

@streeve Is it OK to use int here or should we use something like the following?

auto Nfy = std::round( Ly / std::sqrt( Af ) );

Could you please check the same for Lines 115, 121, 123?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would leave the explicit types as they are for all of them, but it's fine either way

double zi = x( pid, 2 );

// Find ply number of particle (counting from 0)
double nply = std::floor( ( zi - low_corner[2] ) / dzply );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Everything in this lambda should use Kokkos:: math, not std::

// Total fiber volume
double Vftotal = Vf * Vd;
// Total number of fibers
int Nf = std::floor( Vftotal / Vfs );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would leave the explicit types as they are for all of them, but it's fine either way

double nply = std::floor( ( zi - low_corner[2] ) / dzply );

// Ply fiber orientation (in radians)
double theta = stacking_sequence[nply] * CabanaPD::pi / 180;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I missed this line - it will need to be in a Kokkos::View since you use it in kernel

// Fiber-reinforced composite geometry parameters
double Vf = inputs["fiber_volume_fraction"];
double Df = inputs["fiber_diameter"];
std::vector<double> stacking_sequence = inputs["stacking_sequence"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
std::vector<double> stacking_sequence = inputs["stacking_sequence"];
std::vector<double> stacking_vector = inputs["stacking_sequence"];
`Kokkos::View<double*, memory_space> stacking_sequence( stacking_vector.data() );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Materials
2 participants