Skip to content

How to partition heterogeneous elastic properties vectors in different processes? #2469

Answered by pazner
rafaelmarch3 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rafaelmarch3,

If I understand correctly, you read from your input file an array globalLambda of size 27,000, where globalLambda[i-1] is the lambda value corresponding to the ith attribute, and similarly for globalMu.

If this is the case, then I believe that on each MPI rank, you can construct the localLambda and localMu arrays as follows

Vector localLambda(pmesh->attributes.Max());
Vector localMu(pmesh->attributes.Max());
localLambda = 0.0;
localMu = 0.0; // Initialize to zero: not strictly necessary, but makes sure these arrays have no un-initialized values
for (int attribute : pmesh->attributes)
{
   localLambda[attribute - 1] = globalLambda[attribute - 1];
   localMu[attribute - 1]…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rafaelmarch3
Comment options

Answer selected by pazner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants