Teuchos::RCP<STK_Interface> SculptMeshFactory::buildUncommitedMesh(stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(3));

   machRank_ = stk_classic::parallel_machine_rank(parallelMach);
   machSize_ = stk_classic::parallel_machine_size(parallelMach);

   procTuple_ = procRankToProcTuple(machRank_);

   //if( machRank_ == 0 )
   {
       // call Sculptor
       char diatom_file[1000];
       writeDiatomFile( stlFileDir_, stlFileName_, diatom_file  );
  
       callSculptor( parallelMach, diatom_file );
   
        // build meta information: blocks and side set setups
        buildMetaData(parallelMach,*mesh);

        mesh->addPeriodicBCs(periodicBCVec_);

   }

//   if( machRank_ == 0 )
//                if(mesh->isWritable())
//                               mesh->writeToExodus("STKSculptMesh.exo");
            

   return mesh;
}
Teuchos::RCP<STK_Interface> CubeTetMeshFactory::buildUncommitedMesh(stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(3));

   machRank_ = stk_classic::parallel_machine_rank(parallelMach);
   machSize_ = stk_classic::parallel_machine_size(parallelMach);

   if(xProcs_==-1) {
      // default x only decomposition
      xProcs_ = machSize_; 
      yProcs_ = 1;
      zProcs_ = 1;
   }
   TEUCHOS_TEST_FOR_EXCEPTION(int(machSize_)!=xProcs_*yProcs_*zProcs_,std::logic_error,
                      "Cannot build CubeTetMeshFactory, the product of \"X Procs\", \"Y Procs\", and \"Z Procs\""
                      " must equal the number of processors.");
   procTuple_ = procRankToProcTuple(machRank_);

   // build meta information: blocks and side set setups
   buildMetaData(parallelMach,*mesh);
 
   mesh->addPeriodicBCs(periodicBCVec_);

   return mesh;
}
  void
  CustomMeshFactory::completeMeshConstruction(STK_Interface &mesh,
                                              stk_classic::ParallelMachine parallelMach) const
  {
    PANZER_FUNC_TIME_MONITOR("panzer::CustomMeshFactory::completeMeshConstruction()");

    if (not mesh.isInitialized())
      mesh.initialize(parallelMach);

    // add node and element information
    buildElements(mesh);

    // build edges and faces; fyi: addSides(mesh) builds only edges
    mesh.buildSubcells();
    mesh.buildLocalElementIDs();



    // now that edges are built, side and node sets can be added
    addSideSets(mesh);

    // set solution fields
    fillSolutionFieldData(mesh);

    // calls Stk_MeshFactory::rebalance
    //this->rebalance(mesh);
  }
//! Build the mesh object
Teuchos::RCP<STK_Interface> CubeTetMeshFactory::buildMesh(stk_classic::ParallelMachine parallelMach) const
{
  PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::buildMesh()");

   // build all meta data
   RCP<STK_Interface> mesh = buildUncommitedMesh(parallelMach);

   // commit meta data
   mesh->initialize(parallelMach);

   // build bulk data
   completeMeshConstruction(*mesh,parallelMach);

   return mesh;
}
//! Build the mesh object
Teuchos::RCP<STK_Interface> SculptMeshFactory::buildMesh(stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::buildMesh()");

   RCP<STK_Interface> mesh = buildUncommitedMesh(parallelMach);

   // commit meta data
   mesh->initialize(parallelMach);

   // build bulk data
   completeMeshConstruction(*mesh,parallelMach);

   // wrtie exodus file
   //mesh->writeToExodus("STKSculptMesh.exo");
 
   return mesh;
}
void SculptMeshFactory::completeMeshConstruction(STK_Interface & mesh,stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::completeMeshConstruction()");

   if(not mesh.isInitialized())
      mesh.initialize(parallelMach);

   buildElements(parallelMach,mesh);

   mesh.buildSubcells();
   mesh.buildLocalElementIDs();

   addSideSets(mesh);
   addNodeSets(mesh);

   this->rebalance(mesh);
}
  Teuchos::RCP<STK_Interface>
  CustomMeshFactory::buildUncommitedMesh(stk_classic::ParallelMachine parallelMach) const
  {
    PANZER_FUNC_TIME_MONITOR("panzer::CustomMeshFactory::buildUncomittedMesh()");

    RCP<STK_Interface> mesh = rcp(new STK_Interface(3));

    machRank_ = stk_classic::parallel_machine_rank(parallelMach);
    machSize_ = stk_classic::parallel_machine_size(parallelMach);

    // add blocks and side sets (global geometry setup)
    buildMetaData(*mesh);

    mesh->addPeriodicBCs(periodicBCVec_);

    return mesh;
  }
Teuchos::RCP<STK_Interface> LineMeshFactory::buildUncommitedMesh(stk::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::LineMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(1));

   machRank_ = stk::parallel_machine_rank(parallelMach);
   machSize_ = stk::parallel_machine_size(parallelMach);

   procTuple_ = procRankToProcTuple(machRank_);

   // build meta information: blocks and side set setups
   buildMetaData(parallelMach,*mesh);

   mesh->addPeriodicBCs(periodicBCVec_);
 
   return mesh;
}
void CubeTetMeshFactory::completeMeshConstruction(STK_Interface & mesh,stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::completeMeshConstruction()");

   if(not mesh.isInitialized())
      mesh.initialize(parallelMach);

   // add node and element information
   buildElements(parallelMach,mesh);

   // finish up the edges and faces
   mesh.buildSubcells();
   mesh.buildLocalElementIDs();

   // now that edges are built, sidets can be added
   addSideSets(mesh);

   // calls Stk_MeshFactory::rebalance
   this->rebalance(mesh);
}
Пример #10
0
void SquareQuadMeshFactory::completeMeshConstruction(STK_Interface & mesh,stk::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::SquareQuadMeshFactory::completeMeshConstruction()");

   if(not mesh.isInitialized())
      mesh.initialize(parallelMach);

   // add node and element information
   buildElements(parallelMach,mesh);

   // finish up the edges
#ifndef ENABLE_UNIFORM
   mesh.buildSubcells();
#endif
   mesh.buildLocalElementIDs();

   // now that edges are built, sidsets can be added
#ifndef ENABLE_UNIFORM
   addSideSets(mesh);
#endif

   // add nodesets
   addNodeSets(mesh);
}
void panzer::AssemblyEngine<EvalT>::
evaluate(const panzer::AssemblyEngineInArgs& in)
{
  typedef LinearObjContainer LOC;

  // make sure this container gets a dirichlet adjustment
  in.ghostedContainer_->setRequiresDirichletAdjustment(true);

  GlobalEvaluationDataContainer gedc;
  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_gather("+PHX::typeAsString<EvalT>()+")");

    in.fillGlobalEvaluationDataContainer(gedc);
    gedc.initialize(); // make sure all ghosted data is ready to go
    gedc.globalToGhost(LOC::X | LOC::DxDt);

    // Push solution, x and dxdt into ghosted domain
    m_lin_obj_factory->globalToGhostContainer(*in.container_,*in.ghostedContainer_,LOC::X | LOC::DxDt);
    m_lin_obj_factory->beginFill(*in.ghostedContainer_);
  }

  // *********************
  // Volumetric fill
  // *********************
  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_volume("+PHX::typeAsString<EvalT>()+")");
    this->evaluateVolume(in);
  }

  // *********************
  // BC fill
  // *********************
  // NOTE: We have to split neumann and dirichlet bcs since dirichlet
  // bcs overwrite equations where neumann sum into equations.  Make
  // sure all neumann are done before dirichlet.

  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_neumannbcs("+PHX::typeAsString<EvalT>()+")");
    this->evaluateNeumannBCs(in);
  }

  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_interfacebcs("+PHX::typeAsString<EvalT>()+")");
    this->evaluateInterfaceBCs(in);
  }

  // Dirchlet conditions require a global matrix
  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_dirichletbcs("+PHX::typeAsString<EvalT>()+")");
    this->evaluateDirichletBCs(in);
  }

  {
    PANZER_FUNC_TIME_MONITOR("panzer::AssemblyEngine::evaluate_scatter("+PHX::typeAsString<EvalT>()+")");
    m_lin_obj_factory->ghostToGlobalContainer(*in.ghostedContainer_,*in.container_,LOC::F | LOC::Mat);

    m_lin_obj_factory->beginFill(*in.container_);
    gedc.ghostToGlobal(LOC::F | LOC::Mat);
    m_lin_obj_factory->endFill(*in.container_);

    m_lin_obj_factory->endFill(*in.ghostedContainer_);
  }

  return;
}