Beispiel #1
0
TEST_F(LocalIds, using_entities)
{
    if (get_parallel_size() == 1)
    {
        setup_mesh("generated:2x2x2", stk::mesh::BulkData::AUTO_AURA);
        BulkDataHelper bulkDataHelper(get_bulk());

        typedef stk::mesh::Field<double, stk::mesh::Cartesian3d> CoordFieldType;
        CoordFieldType *coords = get_meta().get_field<CoordFieldType>(stk::topology::NODE_RANK, "coordinates");

        unsigned elemIndex = 0;
        const stk::mesh::BucketVector& elemBuckets = get_bulk().buckets(stk::topology::ELEM_RANK);
        for(size_t i=0;i<elemBuckets.size();++i)
        {
            const stk::mesh::Bucket& bucket = *elemBuckets[i];
            for(size_t j=0;j<bucket.size();++j)
            {
                Entities nodes = bulkDataHelper.get_nodes(bucket[j]);
                for(unsigned k=0;k<nodes.size();++k)
                {
                    double *node_data = stk::mesh::field_data(*coords, nodes[k]);
                    EXPECT_NEAR(gold_x_coordinates[elemIndex][k], node_data[0], 1.e-6);
                }
                ++elemIndex;
            }
        }
    }
}
Beispiel #2
0
void ConjugateGradient::initialize(PatchData &pd, MsqError &err)
{
  if (get_parallel_size())
    MSQ_DBGOUT(2) << "\nP[" << get_parallel_rank() << "] " << "o   Performing Conjugate Gradient optimization.\n";
  else
    MSQ_DBGOUT(2) << "\no   Performing Conjugate Gradient optimization.\n";
  pMemento=pd.create_vertices_memento(err);
}
std::string TerminationCriterion::par_string() 
{
  if (get_parallel_size())
    {
      std::ostringstream str;
      str << "P[" << get_parallel_rank() << "] " + moniker + " ";
      return str.str();
    }
  return moniker + " ";
}
Beispiel #4
0
TEST_F(LocalIds, using_local_ids)
{
    if (get_parallel_size() == 1)
    {
        setup_mesh("generated:2x2x2", stk::mesh::BulkData::AUTO_AURA);

        LocalIdBulkData localIdBulkData(get_bulk());

        for(size_t i=0;i<localIdBulkData.num_elements();++i)
        {
            std::vector<unsigned> connectivity = localIdBulkData.get_nodes(i);
            for(size_t j=0;j<connectivity.size();++j)
            {
                double* node_data = localIdBulkData.get_coordinates(connectivity[j]);
                EXPECT_NEAR(gold_x_coordinates[i][j], node_data[0], 1.e-6);
            }
        }
    }
}