v0.8.13
Public Member Functions | Public Attributes | Private Attributes | List of all members
MoFEM::ProblemsManager Struct Reference

Problem manager is used to build and partition problems . More...

#include <src/interfaces/ProblemsManager.hpp>

Inheritance diagram for MoFEM::ProblemsManager:
[legend]
Collaboration diagram for MoFEM::ProblemsManager:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 ProblemsManager (const MoFEM::Core &core)
 
 ~ProblemsManager ()
 Destructor. More...
 
MoFEMErrorCode getOptions ()
 
MoFEMErrorCode partitionMesh (const Range &ents, const int dim, const int adj_dim, const int n_parts, Tag *th_vertex_weights=nullptr, Tag *th_edge_weights=nullptr, Tag *th_part_weights=nullptr, int verb=VERBOSE, const bool debug=false)
 Set partition tag to each finite element in the problemThis will use one of the mesh partitioning programs available from PETSc See http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPartitioningType.html More...
 
MoFEMErrorCode buildProblem (const std::string &name, const bool square_matrix, int verb=VERBOSE)
 build problem data structures More...
 
MoFEMErrorCode buildProblem (Problem *problem_ptr, const bool square_matrix, int verb=VERBOSE)
 build problem data structures More...
 
MoFEMErrorCode buildProblemOnDistributedMesh (const std::string &name, const bool square_matrix, int verb=VERBOSE)
 build problem data structures, assuming that mesh is distributed (collective)Mesh is distributed, that means that each processor keeps only own part of the mesh and shared entities. More...
 
MoFEMErrorCode buildProblemOnDistributedMesh (Problem *problem_ptr, const bool square_matrix=true, int verb=VERBOSE)
 build problem data structures, assuming that mesh is distributed (collective)Mesh is distributed, that means that each processor keeps only own part of the mesh and shared entities. More...
 
MoFEMErrorCode buildSubProblem (const std::string &out_name, const std::vector< std::string > &fields_row, const std::vector< std::string > &fields_col, const std::string &main_problem, const bool square_matrix=true, int verb=VERBOSE)
 build sub problem More...
 
MoFEMErrorCode buildCompsedProblem (const std::string &out_name, const std::vector< std::string > add_row_problems, const std::vector< std::string > add_col_problems, const bool square_matrix=true, int verb=1)
 build composite problem More...
 
MoFEMErrorCode inheritPartition (const std::string &name, const std::string &problem_for_rows, bool copy_rows, const std::string &problem_for_cols, bool copy_cols, int verb=VERBOSE)
 build indexing and partition problem inheriting indexing and partitioning from two other problems More...
 
MoFEMErrorCode partitionSimpleProblem (const std::string &name, int verb=VERBOSE)
 partition problem dofs More...
 
MoFEMErrorCode partitionProblem (const std::string &name, int verb=VERBOSE)
 partition problem dofs (collective) More...
 
MoFEMErrorCode printPartitionedProblem (const Problem *problem_ptr, int verb=VERBOSE)
 
MoFEMErrorCode debugPartitionedProblem (const Problem *problem_ptr, int verb=VERBOSE)
 
MoFEMErrorCode partitionFiniteElements (const std::string &name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=VERBOSE)
 partition finite elementsFunction which partition finite elements based on dofs partitioning.
In addition it sets information about local row and cols dofs at given element on partition. More...
 
MoFEMErrorCode partitionGhostDofs (const std::string &name, int verb=VERBOSE)
 determine ghost nodes More...
 
MoFEMErrorCode partitionGhostDofsOnDistributedMesh (const std::string &name, int verb=VERBOSE)
 determine ghost nodes on distributed meshes More...
 
MoFEMErrorCode getFEMeshset (const std::string &prb_name, const std::string &fe_name, EntityHandle *meshset) const
 
MoFEMErrorCode getProblemElementsLayout (const std::string &name, const std::string &fe_name, PetscLayout *layout) const
 Get layout of elements in the problemIn layout is stored information how many elements is on each processor, for more information look int petsc documentation http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/IS/PetscLayoutCreate.html#PetscLayoutCreate More...
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

Public Attributes

MoFEM::CorecOre
 
PetscBool buildProblemFromFields
 
PetscBool synchroniseProblemEntities
 DOFs in fields, not from DOFs on elements. More...
 

Private Attributes

PetscLogEvent MOFEM_EVENT_ProblemsManager
 

Additional Inherited Members

- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Detailed Description

Problem manager is used to build and partition problems .

Examples:
forces_and_sources_testing_edge_element.cpp.

Definition at line 34 of file ProblemsManager.hpp.

Constructor & Destructor Documentation

◆ ProblemsManager()

MoFEM::ProblemsManager::ProblemsManager ( const MoFEM::Core core)

Definition at line 74 of file ProblemsManager.cpp.

75  : cOre(const_cast<MoFEM::Core &>(core)),
76  buildProblemFromFields(PETSC_FALSE),
77  synchroniseProblemEntities(PETSC_FALSE) {
78  PetscLogEventRegister("ProblemsManager", 0, &MOFEM_EVENT_ProblemsManager);
79 }
PetscLogEvent MOFEM_EVENT_ProblemsManager
PetscBool synchroniseProblemEntities
DOFs in fields, not from DOFs on elements.

◆ ~ProblemsManager()

MoFEM::ProblemsManager::~ProblemsManager ( )

Destructor.

Definition at line 80 of file ProblemsManager.cpp.

80 {}

Member Function Documentation

◆ buildCompsedProblem()

MoFEMErrorCode MoFEM::ProblemsManager::buildCompsedProblem ( const std::string &  out_name,
const std::vector< std::string >  add_row_problems,
const std::vector< std::string >  add_col_problems,
const bool  square_matrix = true,
int  verb = 1 
)

build composite problem

Parameters
out_namename of build problem
add_row_problemsvector of add row problems
add_col_problemsvector of add col problems
square_matrixtrue if structurally squared matrix
verbverbosity level
Returns
error code

Definition at line 1481 of file ProblemsManager.cpp.

1485  {
1487  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "fields not build");
1488  if (!(cOre.getBuildMoFEM() & Core::BUILD_FE))
1489  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "FEs not build");
1490  if (!(cOre.getBuildMoFEM() & Core::BUILD_ADJ))
1491  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "adjacencies not build");
1492  MoFEM::Interface &m_field = cOre;
1493  const Problem_multiIndex *problems_ptr;
1495 
1496  ierr = m_field.clear_problem(out_name);
1497  CHKERRG(ierr);
1498  ierr = m_field.get_problems(&problems_ptr);
1499  CHKERRG(ierr);
1500  // get reference to all problems
1501  typedef Problem_multiIndex::index<Problem_mi_tag>::type ProblemByName;
1502  ProblemByName &problems_by_name =
1503  const_cast<ProblemByName &>(problems_ptr->get<Problem_mi_tag>());
1504 
1505  // Get iterators to out problem, i.e. build problem
1506  ProblemByName::iterator out_problem_it = problems_by_name.find(out_name);
1507  if (out_problem_it == problems_by_name.end()) {
1508  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1509  "problem with name < %s > not defined (top tip check spelling)",
1510  out_name.c_str());
1511  }
1512  // Make data structure for composed-problem data
1513  out_problem_it->composedProblemsData =
1514  boost::make_shared<ComposedProblemsData>();
1515  boost::shared_ptr<ComposedProblemsData> cmp_prb_data =
1516  out_problem_it->getComposedProblemsData();
1517 
1518  const std::vector<std::string> *add_prb[] = {&add_row_problems,
1519  &add_col_problems};
1520  std::vector<const Problem *> *add_prb_ptr[] = {&cmp_prb_data->rowProblemsAdd,
1521  &cmp_prb_data->colProblemsAdd};
1522  std::vector<IS> *add_prb_is[] = {&cmp_prb_data->rowIs, &cmp_prb_data->colIs};
1523 
1524  // Get local indices counter
1525  int *nb_local_dofs[] = {&out_problem_it->nbLocDofsRow,
1526  &out_problem_it->nbLocDofsCol};
1527  // Get global indices counter
1528  int *nb_dofs[] = {&out_problem_it->nbDofsRow, &out_problem_it->nbDofsCol};
1529 
1530  // Set number of ghost nodes to zero
1531  {
1532  out_problem_it->nbDofsRow = 0;
1533  out_problem_it->nbDofsCol = 0;
1534  out_problem_it->nbLocDofsRow = 0;
1535  out_problem_it->nbLocDofsCol = 0;
1536  out_problem_it->nbGhostDofsRow = 0;
1537  out_problem_it->nbGhostDofsCol = 0;
1538  }
1539  int nb_dofs_reserve[] = {0, 0};
1540 
1541  // Loop over rows and columns in the main problem and sub-problems
1542  for (int ss = 0; ss != ((square_matrix) ? 1 : 2); ss++) {
1543  // cerr << "SS " << ss << endl;
1544  // cerr << add_prb[ss]->size() << endl;
1545  // cerr << add_prb_ptr[ss]->size() << endl;
1546  add_prb_ptr[ss]->reserve(add_prb[ss]->size());
1547  add_prb_is[ss]->reserve(add_prb[ss]->size());
1548  for (std::vector<std::string>::const_iterator vit = add_prb[ss]->begin();
1549  vit != add_prb[ss]->end(); vit++) {
1550  ProblemByName::iterator prb_it = problems_by_name.find(*vit);
1551  if (prb_it == problems_by_name.end()) {
1552  SETERRQ1(
1553  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1554  "problem with name < %s > not defined (top tip check spelling)",
1555  vit->c_str());
1556  }
1557  add_prb_ptr[ss]->push_back(&*prb_it);
1558  // set number of dofs on rows and columns
1559  if (ss == 0) {
1560  // row
1561  *nb_dofs[ss] += add_prb_ptr[ss]->back()->getNbDofsRow();
1562  *nb_local_dofs[ss] += add_prb_ptr[ss]->back()->getNbLocalDofsRow();
1563  nb_dofs_reserve[ss] += add_prb_ptr[ss]->back()->numeredDofsRows->size();
1564  } else {
1565  // column
1566  *nb_dofs[ss] += add_prb_ptr[ss]->back()->getNbDofsCol();
1567  *nb_local_dofs[ss] += add_prb_ptr[ss]->back()->getNbLocalDofsCol();
1568  nb_dofs_reserve[ss] += add_prb_ptr[ss]->back()->numeredDofsCols->size();
1569  }
1570  }
1571  }
1572  // if squre problem, rows and columns are the same
1573  if (square_matrix) {
1574  add_prb_ptr[1]->reserve(add_prb_ptr[0]->size());
1575  add_prb_is[1]->reserve(add_prb_ptr[0]->size());
1576  out_problem_it->numeredDofsCols = out_problem_it->numeredDofsRows;
1577  *nb_dofs[1] = *nb_dofs[0];
1578  *nb_local_dofs[1] = *nb_local_dofs[0];
1579  }
1580 
1581  // reserve memory for dofs
1582  boost::shared_ptr<std::vector<NumeredDofEntity> > dofs_array[2];
1583  // Reserve memory
1584  for (int ss = 0; ss != ((square_matrix) ? 1 : 2); ss++) {
1585  dofs_array[ss] = boost::make_shared<std::vector<NumeredDofEntity> >();
1586  dofs_array[ss]->reserve(nb_dofs_reserve[ss]);
1587  if (ss == 0) {
1588  out_problem_it->getRowDofsSequence()->push_back(dofs_array[ss]);
1589  }
1590  if (ss == 1) {
1591  out_problem_it->getColDofsSequence()->push_back(dofs_array[ss]);
1592  }
1593  }
1594 
1595  // Push back DOFs
1596  for (int ss = 0; ss != ((square_matrix) ? 1 : 2); ss++) {
1597  NumeredDofEntity_multiIndex::index<PetscGlobalIdx_mi_tag>::type::iterator
1598  dit,
1599  hi_dit;
1600  int shift_glob = 0;
1601  int shift_loc = 0;
1602  for (unsigned int pp = 0; pp != add_prb_ptr[ss]->size(); pp++) {
1603  PetscInt *dofs_out_idx_ptr;
1604  int nb_local_dofs = (*add_prb_ptr[ss])[pp]->getNbLocalDofsRow();
1605  ierr = PetscMalloc(nb_local_dofs * sizeof(int), &dofs_out_idx_ptr);
1606  CHKERRG(ierr);
1607  if (ss == 0) {
1608  dit = (*add_prb_ptr[ss])[pp]
1609  ->numeredDofsRows->get<PetscGlobalIdx_mi_tag>()
1610  .begin();
1611  hi_dit = (*add_prb_ptr[ss])[pp]
1612  ->numeredDofsRows->get<PetscGlobalIdx_mi_tag>()
1613  .end();
1614  } else {
1615  dit = (*add_prb_ptr[ss])[pp]
1616  ->numeredDofsCols->get<PetscGlobalIdx_mi_tag>()
1617  .begin();
1618  hi_dit = (*add_prb_ptr[ss])[pp]
1619  ->numeredDofsCols->get<PetscGlobalIdx_mi_tag>()
1620  .end();
1621  }
1622  int is_nb = 0;
1623  for (; dit != hi_dit; dit++) {
1624  // cerr << **dit << endl;
1625  BitRefLevel prb_bit = out_problem_it->getBitRefLevel();
1626  BitRefLevel prb_mask = out_problem_it->getMaskBitRefLevel();
1627  BitRefLevel dof_bit = dit->get()->getBitRefLevel();
1628  if ((dof_bit & prb_bit).none() || ((dof_bit & prb_mask) != dof_bit))
1629  continue;
1630  const int rank = m_field.get_comm_rank();
1631  const int part = dit->get()->getPart();
1632  const int glob_idx = shift_glob + dit->get()->getPetscGlobalDofIdx();
1633  const int loc_idx =
1634  (part == rank) ? (shift_loc + dit->get()->getPetscLocalDofIdx())
1635  : -1;
1636  // if(m_field.get_comm_rank()==1) {
1637  // cerr << dit->get()->getPart() << " " << loc_idx << endl;
1638  // }
1639  dofs_array[ss]->push_back(NumeredDofEntity(
1640  dit->get()->getDofEntityPtr(), glob_idx, glob_idx, loc_idx, part));
1641  if (part == rank) {
1642  dofs_out_idx_ptr[is_nb++] = glob_idx;
1643  }
1644  }
1645  if (is_nb > nb_local_dofs) {
1646  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1647  "Data inconsistency");
1648  }
1649  IS is;
1650  ierr = ISCreateGeneral(m_field.get_comm(), is_nb, dofs_out_idx_ptr,
1651  PETSC_OWN_POINTER, &is);
1652  CHKERRG(ierr);
1653  // cerr << "Push " << ss << " " << pp << endl;
1654  (*add_prb_is[ss]).push_back(is);
1655  if (ss == 0) {
1656  shift_glob += (*add_prb_ptr[ss])[pp]->getNbDofsRow();
1657  shift_loc += (*add_prb_ptr[ss])[pp]->getNbLocalDofsRow();
1658  } else {
1659  shift_glob += (*add_prb_ptr[ss])[pp]->getNbDofsCol();
1660  shift_loc += (*add_prb_ptr[ss])[pp]->getNbLocalDofsCol();
1661  }
1662  if (square_matrix) {
1663  (*add_prb_ptr[1]).push_back((*add_prb_ptr[0])[pp]);
1664  // cerr << "Push square " << ss << " " << pp << endl;
1665  (*add_prb_is[1]).push_back(is);
1666  ierr = PetscObjectReference((PetscObject)is);
1667  CHKERRG(ierr);
1668  }
1669  }
1670  }
1671 
1672  if ((*add_prb_is[1]).size() != (*add_prb_is[0]).size()) {
1673  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY, "Data inconsistency");
1674  }
1675 
1676  // Insert DOFs to problem multi-index
1677  std::vector<boost::shared_ptr<NumeredDofEntity> > dofs_shared_array;
1678  for (int ss = 0; ss != ((square_matrix) ? 1 : 2); ss++) {
1679  dofs_shared_array.clear();
1680  dofs_shared_array.reserve(dofs_array[ss]->size());
1681  for (std::vector<NumeredDofEntity>::iterator dit = dofs_array[ss]->begin();
1682  dit != dofs_array[ss]->end(); dit++) {
1683  dofs_shared_array.push_back(
1684  boost::shared_ptr<NumeredDofEntity>(dofs_array[ss], &*dit));
1685  }
1686  if (ss == 0) {
1687  out_problem_it->numeredDofsRows->insert(dofs_shared_array.begin(),
1688  dofs_shared_array.end());
1689  } else {
1690  out_problem_it->numeredDofsCols->insert(dofs_shared_array.begin(),
1691  dofs_shared_array.end());
1692  }
1693  }
1694 
1695  // PetscSynchronizedPrintf(m_field.get_comm(),"nb local dofs
1696  // %d\n",*nb_local_dofs[0]);
1697  // PetscSynchronizedFlush(m_field.get_comm(),PETSC_STDOUT);
1698 
1699  // Compress DOFs
1700  *nb_dofs[0] = 0;
1701  *nb_dofs[1] = 0;
1702  *nb_local_dofs[0] = 0;
1703  *nb_local_dofs[1] = 0;
1704  for (int ss = 0; ss != ((square_matrix) ? 1 : 2); ss++) {
1705 
1706  // if(ss == 0 && renumerate_row) continue;
1707  // if(ss == 1 && renumerate_col) continue;
1708  boost::shared_ptr<NumeredDofEntity_multiIndex> dofs_ptr;
1709  if (ss == 0) {
1710  dofs_ptr = out_problem_it->numeredDofsRows;
1711  } else {
1712  dofs_ptr = out_problem_it->numeredDofsCols;
1713  }
1714  NumeredDofEntityByUId::iterator dit, hi_dit;
1715  dit = dofs_ptr->get<Unique_mi_tag>().begin();
1716  hi_dit = dofs_ptr->get<Unique_mi_tag>().end();
1717  std::vector<int> idx;
1718  idx.reserve(std::distance(dit, hi_dit));
1719  // set dofs in order entity and dof number on entity
1720  for (; dit != hi_dit; dit++) {
1721  if (dit->get()->getPart() == (unsigned int)m_field.get_comm_rank()) {
1722  bool success = dofs_ptr->get<Unique_mi_tag>().modify(
1723  dit, NumeredDofEntity_local_idx_change((*nb_local_dofs[ss])++));
1724  if (!success) {
1725  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
1726  "modification unsuccessful");
1727  }
1728  idx.push_back(dit->get()->getPetscGlobalDofIdx());
1729  } else {
1730  if (dit->get()->getPetscLocalDofIdx() != -1) {
1731  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1732  "local index should be negative");
1733  }
1734  }
1735  }
1736  if (square_matrix) {
1737  *nb_local_dofs[1] = *nb_local_dofs[0];
1738  }
1739 
1740  // set new dofs mapping
1741  IS is;
1742  ierr = ISCreateGeneral(m_field.get_comm(), idx.size(), &*idx.begin(),
1743  PETSC_USE_POINTER, &is);
1744  CHKERRG(ierr);
1745  ierr = ISGetSize(is, nb_dofs[ss]);
1746  CHKERRG(ierr);
1747  if (square_matrix) {
1748  *nb_dofs[1] = *nb_dofs[0];
1749  }
1750  // {
1751  // PetscSynchronizedPrintf(m_field.get_comm(),"nb dofs %d %d
1752  // %d\n",*nb_local_dofs[0],idx.size(),*nb_dofs[0]);
1753  // PetscSynchronizedFlush(m_field.get_comm(),PETSC_STDOUT);
1754  // }
1755  AO ao;
1756  ierr = AOCreateMappingIS(is, PETSC_NULL, &ao);
1757  CHKERRG(ierr);
1758  for (unsigned int pp = 0; pp != (*add_prb_is[ss]).size(); pp++) {
1759  ierr = AOApplicationToPetscIS(ao, (*add_prb_is[ss])[pp]);
1760  CHKERRG(ierr);
1761  }
1762 
1763  // Set DOFs numeration
1764  {
1765  std::vector<int> idx_new;
1766  idx_new.reserve(dofs_ptr->size());
1767  for (NumeredDofEntityByUId::iterator dit =
1768  dofs_ptr->get<Unique_mi_tag>().begin();
1769  dit != dofs_ptr->get<Unique_mi_tag>().end(); dit++) {
1770  idx_new.push_back(dit->get()->getPetscGlobalDofIdx());
1771  }
1772  // set new global dofs numeration
1773  IS is_new;
1774  ierr = ISCreateGeneral(m_field.get_comm(), idx_new.size(),
1775  &*idx_new.begin(), PETSC_USE_POINTER, &is_new);
1776  CHKERRG(ierr);
1777  ierr = AOApplicationToPetscIS(ao, is_new);
1778  CHKERRG(ierr);
1779  // set global indices to multi-index
1780  std::vector<int>::iterator vit = idx_new.begin();
1781  for (NumeredDofEntityByUId::iterator dit =
1782  dofs_ptr->get<Unique_mi_tag>().begin();
1783  dit != dofs_ptr->get<Unique_mi_tag>().end(); dit++) {
1784  bool success = dofs_ptr->modify(
1785  dit, NumeredDofEntity_part_change(dit->get()->getPart(), *(vit++)));
1786  if (!success) {
1787  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
1788  "modification unsuccessful");
1789  }
1790  }
1791  ierr = ISDestroy(&is_new);
1792  CHKERRG(ierr);
1793  }
1794  ierr = ISDestroy(&is);
1795  CHKERRG(ierr);
1796  ierr = AODestroy(&ao);
1797  CHKERRG(ierr);
1798  }
1799 
1800  ierr = printPartitionedProblem(&*out_problem_it, verb);
1801  CHKERRG(ierr);
1802  ierr = debugPartitionedProblem(&*out_problem_it, verb);
1803  CHKERRG(ierr);
1804 
1805  // Inidcate that porble has been build
1808 
1810 }
virtual MoFEMErrorCode clear_problem(const std::string &name, int verb=DEFAULT_VERBOSITY)=0
clear problem
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
int & getBuildMoFEM() const
Get flags/semaphores for different stages.
Definition: Core.hpp:179
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:562
MoFEMErrorCode debugPartitionedProblem(const Problem *problem_ptr, int verb=VERBOSE)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
MoFEMErrorCode printPartitionedProblem(const Problem *problem_ptr, int verb=VERBOSE)
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Common.hpp:147
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
virtual int get_comm_rank() const =0
virtual MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const =0
Get pointer to problems multi-index.
multi_index_container< Problem, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< Problem, EntityHandle, &Problem::meshset > >, hashed_unique< tag< BitProblemId_mi_tag >, const_mem_fun< Problem, BitProblemId, &Problem::getId >, HashBit< BitProblemId >, EqBit< BitProblemId > >, hashed_unique< tag< Problem_mi_tag >, const_mem_fun< Problem, std::string, &Problem::getName > > > > Problem_multiIndex
MultiIndex for entities for Problem.
virtual MPI_Comm & get_comm() const =0

◆ buildSubProblem()

MoFEMErrorCode MoFEM::ProblemsManager::buildSubProblem ( const std::string &  out_name,
const std::vector< std::string > &  fields_row,
const std::vector< std::string > &  fields_col,
const std::string &  main_problem,
const bool  square_matrix = true,
int  verb = VERBOSE 
)

build sub problem

Parameters
out_nameproblem
fields_rowvector of fields composing problem
fields_colvector of fields composing problem
main_problemmain problem
Returns
error code

Definition at line 1243 of file ProblemsManager.cpp.

1246  {
1247  MoFEM::Interface &m_field = cOre;
1248  const Problem_multiIndex *problems_ptr;
1250 
1251  CHKERR m_field.clear_problem(out_name);
1252  CHKERR m_field.get_problems(&problems_ptr);
1253 
1254  // get reference to all problems
1255  typedef Problem_multiIndex::index<Problem_mi_tag>::type ProblemByName;
1256  ProblemByName &problems_by_name =
1257  const_cast<ProblemByName &>(problems_ptr->get<Problem_mi_tag>());
1258 
1259  // get iterators to out problem, i.e. build problem
1260  ProblemByName::iterator out_problem_it = problems_by_name.find(out_name);
1261  if (out_problem_it == problems_by_name.end()) {
1262  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1263  "subproblem with name < %s > not defined (top tip check spelling)",
1264  out_name.c_str());
1265  }
1266  // get iterator to main problem, i.e. out problem is subproblem of main
1267  // problem
1268  ProblemByName::iterator main_problem_it = problems_by_name.find(main_problem);
1269  if (main_problem_it == problems_by_name.end()) {
1270  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1271  "problem of subproblem with name < %s > not defined (top tip "
1272  "check spelling)",
1273  main_problem.c_str());
1274  }
1275 
1276  // get dofs for row & columns for out problem,
1277  boost::shared_ptr<NumeredDofEntity_multiIndex> out_problem_dofs[] = {
1278  out_problem_it->numeredDofsRows, out_problem_it->numeredDofsCols};
1279  // get dofs for row & columns for main problem
1280  boost::shared_ptr<NumeredDofEntity_multiIndex> main_problem_dofs[] = {
1281  main_problem_it->numeredDofsRows, main_problem_it->numeredDofsCols};
1282  // get local indices counter
1283  int *nb_local_dofs[] = {&out_problem_it->nbLocDofsRow,
1284  &out_problem_it->nbLocDofsCol};
1285  // get global indices counter
1286  int *nb_dofs[] = {&out_problem_it->nbDofsRow, &out_problem_it->nbDofsCol};
1287 
1288  // set number of ghost nodes to zero
1289  {
1290  out_problem_it->nbGhostDofsRow = 0;
1291  out_problem_it->nbGhostDofsCol = 0;
1292  }
1293 
1294  // put rows & columns field names in array
1295  std::vector<std::string> fields[] = {fields_row, fields_col};
1296 
1297  // make data structure fos sub-problem data
1298  out_problem_it->subProblemData =
1299  boost::make_shared<Problem::SubProblemData>();
1300 
1301  // use to keep shared_ptr
1302  std::vector<boost::shared_ptr<NumeredDofEntity> > dofs_shared_array;
1303 
1304  // Loop over rows and columns
1305  for (int ss = 0; ss != (square_matrix ? 1 : 2); ++ss) {
1306 
1307  // reset dofs and columns counters
1308  (*nb_local_dofs[ss]) = 0;
1309  (*nb_dofs[ss]) = 0;
1310  // clear arrays
1311  out_problem_dofs[ss]->clear();
1312 
1313  // If DOFs are cleared clear finite elements too.
1314  out_problem_it->numeredFiniteElements.clear();
1315 
1316  // get dofs by field name and insert them in out problem multi-indices
1317  for (auto field : fields[ss]) {
1318  auto dit =
1319  main_problem_dofs[ss]->get<FieldName_mi_tag>().lower_bound(field);
1320  auto hi_dit =
1321  main_problem_dofs[ss]->get<FieldName_mi_tag>().upper_bound(field);
1322 
1323  // Following reserve memory in sequences, only two allocations are here,
1324  // once for array of objects, next for array of shared pointers
1325 
1326  // reserve memory for field dofs
1327  boost::shared_ptr<std::vector<NumeredDofEntity> > dofs_array =
1328  boost::shared_ptr<std::vector<NumeredDofEntity> >(
1329  new std::vector<NumeredDofEntity>());
1330 
1331  if (ss == 0) {
1332  out_problem_it->getRowDofsSequence()->push_back(dofs_array);
1333  } else {
1334  out_problem_it->getColDofsSequence()->push_back(dofs_array);
1335  }
1336  dofs_array->reserve(std::distance(dit, hi_dit));
1337 
1338  // create elements objects
1339  for (; dit != hi_dit; dit++) {
1340  dofs_array->push_back(NumeredDofEntity(
1341  dit->get()->getDofEntityPtr(), dit->get()->getPetscGlobalDofIdx(),
1342  dit->get()->getPetscGlobalDofIdx(),
1343  dit->get()->getPetscLocalDofIdx(), dit->get()->getPart()));
1344  }
1345 
1346  // reserve memory for shared pointers now
1347  dofs_shared_array.clear();
1348  dofs_shared_array.reserve(dofs_array->size());
1349  for (auto vit = dofs_array->begin(); vit != dofs_array->end(); vit++) {
1350  dofs_shared_array.push_back(
1351  boost::shared_ptr<NumeredDofEntity>(dofs_array, &*vit));
1352  }
1353  // fill multi-index
1354  out_problem_dofs[ss]->insert(dofs_shared_array.begin(),
1355  dofs_shared_array.end());
1356  }
1357  // Set local indexes
1358  {
1359  NumeredDofEntity_multiIndex::index<Idx_mi_tag>::type::iterator dit,
1360  hi_dit;
1361  dit = out_problem_dofs[ss]->get<Idx_mi_tag>().begin();
1362  hi_dit = out_problem_dofs[ss]->get<Idx_mi_tag>().end();
1363  for (; dit != hi_dit; dit++) {
1364  int idx = -1; // if dof is not part of partition, set local index to -1
1365  if (dit->get()->getPart() == (unsigned int)m_field.get_comm_rank()) {
1366  idx = (*nb_local_dofs[ss])++;
1367  }
1368  bool success = out_problem_dofs[ss]->modify(
1369  out_problem_dofs[ss]->project<0>(dit),
1370  NumeredDofEntity_local_idx_change(idx));
1371  if (!success) {
1372  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
1373  "operation unsuccessful");
1374  }
1375  };
1376  }
1377  // Set global indexes, compress global indices
1378  {
1379  auto dit =
1380  out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().lower_bound(0);
1381  auto hi_dit =
1382  out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().upper_bound(
1383  out_problem_dofs[ss]->size());
1384  const int nb = std::distance(dit, hi_dit);
1385  // get main problem global indices
1386  std::vector<int> main_indices(nb);
1387  for (auto it = main_indices.begin(); dit != hi_dit; dit++, it++) {
1388  *it = dit->get()->getPetscGlobalDofIdx();
1389  }
1390  // crate is with global dofs
1391  IS is;
1392  CHKERR ISCreateGeneral(m_field.get_comm(), nb, &*main_indices.begin(),
1393  PETSC_USE_POINTER, &is);
1394  // create map form main problem global indices to out problem global
1395  // indices
1396  AO ao;
1397  CHKERR AOCreateMappingIS(is, PETSC_NULL, &ao);
1398  if (ss == 0) {
1399  CHKERR ISDuplicate(is, &(out_problem_it->getSubData()->rowIs));
1400  // CHKERR ISSort(out_problem_it->getSubData()->rowIs);
1401  out_problem_it->getSubData()->rowMap = ao;
1402  CHKERR PetscObjectReference((PetscObject)ao);
1403  } else {
1404  CHKERR ISDuplicate(is, &(out_problem_it->getSubData()->colIs));
1405  // CHKERR ISSort(out_problem_it->getSubData()->colIs);
1406  out_problem_it->getSubData()->colMap = ao;
1407  CHKERR PetscObjectReference((PetscObject)ao);
1408  }
1409  CHKERR AOApplicationToPetscIS(ao, is);
1410  // set global number of DOFs
1411  CHKERR ISGetSize(is, nb_dofs[ss]);
1412  CHKERR ISDestroy(&is);
1413  // set out problem global indices after applying map
1414  dit = out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().lower_bound(0);
1415  for (std::vector<int>::iterator it = main_indices.begin(); dit != hi_dit;
1416  dit++, it++) {
1417  bool success = out_problem_dofs[ss]->modify(
1418  out_problem_dofs[ss]->project<0>(dit),
1419  NumeredDofEntity_mofem_part_and_all_index_change(
1420  dit->get()->getPart(), *it, *it,
1421  dit->get()->getPetscLocalDofIdx()));
1422  if (!success) {
1423  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
1424  "operation unsuccessful");
1425  }
1426  }
1427  // set global indices to nodes not on this part
1428  {
1429  NumeredDofEntityByLocalIdx::iterator dit =
1430  out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().lower_bound(-1);
1431  NumeredDofEntityByLocalIdx::iterator hi_dit =
1432  out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().upper_bound(-1);
1433  const int nb = std::distance(dit, hi_dit);
1434  std::vector<int> main_indices_non_local(nb);
1435  for (auto it = main_indices_non_local.begin(); dit != hi_dit;
1436  dit++, it++) {
1437  *it = dit->get()->getPetscGlobalDofIdx();
1438  }
1439  IS is;
1440  CHKERR ISCreateGeneral(m_field.get_comm(), nb,
1441  &*main_indices_non_local.begin(),
1442  PETSC_USE_POINTER, &is);
1443  CHKERR AOApplicationToPetscIS(ao, is);
1444  CHKERR ISDestroy(&is);
1445  dit = out_problem_dofs[ss]->get<PetscLocalIdx_mi_tag>().lower_bound(-1);
1446  for (auto it = main_indices_non_local.begin(); dit != hi_dit;
1447  dit++, it++) {
1448  bool success = out_problem_dofs[ss]->modify(
1449  out_problem_dofs[ss]->project<0>(dit),
1450  NumeredDofEntity_mofem_part_and_all_index_change(
1451  dit->get()->getPart(), dit->get()->getDofIdx(), *it,
1452  dit->get()->getPetscLocalDofIdx()));
1453  if (!success) {
1454  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
1455  "operation unsuccessful");
1456  }
1457  }
1458  }
1459  CHKERR AODestroy(&ao);
1460  }
1461  }
1462 
1463  if (square_matrix) {
1464  out_problem_it->numeredDofsCols = out_problem_it->numeredDofsRows;
1465  out_problem_it->nbLocDofsCol = out_problem_it->nbLocDofsRow;
1466  out_problem_it->nbDofsCol = out_problem_it->nbDofsRow;
1467  out_problem_it->getSubData()->colIs = out_problem_it->getSubData()->rowIs;
1468  out_problem_it->getSubData()->colMap = out_problem_it->getSubData()->rowMap;
1469  CHKERR PetscObjectReference(
1470  (PetscObject)out_problem_it->getSubData()->rowIs);
1471  CHKERR PetscObjectReference(
1472  (PetscObject)out_problem_it->getSubData()->rowMap);
1473  }
1474 
1475  CHKERR printPartitionedProblem(&*out_problem_it, verb);
1476  CHKERR debugPartitionedProblem(&*out_problem_it, verb);
1477 
1479 }
virtual MoFEMErrorCode clear_problem(const std::string &name, int verb=DEFAULT_VERBOSITY)=0
clear problem
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
MoFEMErrorCode debugPartitionedProblem(const Problem *problem_ptr, int verb=VERBOSE)
MoFEMErrorCode printPartitionedProblem(const Problem *problem_ptr, int verb=VERBOSE)
virtual int get_comm_rank() const =0
virtual MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const =0
Get pointer to problems multi-index.
multi_index_container< Problem, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< Problem, EntityHandle, &Problem::meshset > >, hashed_unique< tag< BitProblemId_mi_tag >, const_mem_fun< Problem, BitProblemId, &Problem::getId >, HashBit< BitProblemId >, EqBit< BitProblemId > >, hashed_unique< tag< Problem_mi_tag >, const_mem_fun< Problem, std::string, &Problem::getName > > > > Problem_multiIndex
MultiIndex for entities for Problem.
#define CHKERR
Inline error check.
Definition: definitions.h:614
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
virtual MPI_Comm & get_comm() const =0

◆ debugPartitionedProblem()

MoFEMErrorCode MoFEM::ProblemsManager::debugPartitionedProblem ( const Problem problem_ptr,
int  verb = VERBOSE 
)

Definition at line 2441 of file ProblemsManager.cpp.

2441  {
2442  MoFEM::Interface &m_field = cOre;
2444  if (debug > 0) {
2445 
2446  typedef NumeredDofEntity_multiIndex::index<Idx_mi_tag>::type
2447  NumeredDofEntitysByIdx;
2448  NumeredDofEntitysByIdx::iterator dit, hi_dit;
2449  const NumeredDofEntitysByIdx *numered_dofs_ptr[] = {
2450  &(problem_ptr->numeredDofsRows->get<Idx_mi_tag>()),
2451  &(problem_ptr->numeredDofsCols->get<Idx_mi_tag>())};
2452 
2453  int *nbdof_ptr[] = {&problem_ptr->nbDofsRow, &problem_ptr->nbDofsCol};
2454  int *local_nbdof_ptr[] = {&problem_ptr->nbLocDofsRow,
2455  &problem_ptr->nbLocDofsCol};
2456 
2457  for (int ss = 0; ss < 2; ss++) {
2458 
2459  dit = numered_dofs_ptr[ss]->begin();
2460  hi_dit = numered_dofs_ptr[ss]->end();
2461  for (; dit != hi_dit; dit++) {
2462  if ((*dit)->getPart() == (unsigned int)m_field.get_comm_rank()) {
2463  if ((*dit)->getPetscLocalDofIdx() < 0) {
2464  std::ostringstream zz;
2465  zz << "rank " << m_field.get_comm_rank() << " " << **dit;
2466  SETERRQ2(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE,
2467  "local dof index for %d (0-row, 1-col) not set, i.e. has "
2468  "negative value\n %s",
2469  ss, zz.str().c_str());
2470  }
2471  if ((*dit)->getPetscLocalDofIdx() >= *local_nbdof_ptr[ss]) {
2472  std::ostringstream zz;
2473  zz << "rank " << m_field.get_comm_rank() << " " << **dit;
2474  SETERRQ2(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE,
2475  "local dofs for %d (0-row, 1-col) out of range\n %s", ss,
2476  zz.str().c_str());
2477  }
2478  } else {
2479  if ((*dit)->getPetscGlobalDofIdx() < 0) {
2480  std::ostringstream zz;
2481  zz << "rank " << m_field.get_comm_rank() << " "
2482  << dit->get()->getBitRefLevel() << " " << **dit;
2483  SETERRQ2(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE,
2484  "global dof index for %d (0-row, 1-col) row not set, i.e. "
2485  "has negative value\n %s",
2486  ss, zz.str().c_str());
2487  }
2488  if ((*dit)->getPetscGlobalDofIdx() >= *nbdof_ptr[ss]) {
2489  std::ostringstream zz;
2490  zz << "rank " << m_field.get_comm_rank() << " nb_dofs "
2491  << *nbdof_ptr[ss] << " " << **dit;
2492  SETERRQ2(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE,
2493  "global dofs for %d (0-row, 1-col) out of range\n %s", ss,
2494  zz.str().c_str());
2495  }
2496  }
2497  }
2498  }
2499  }
2501 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
virtual int get_comm_rank() const =0
static const bool debug

◆ getFEMeshset()

MoFEMErrorCode MoFEM::ProblemsManager::getFEMeshset ( const std::string &  prb_name,
const std::string &  fe_name,
EntityHandle meshset 
) const

meshset problem finite elements

Definition at line 2979 of file ProblemsManager.cpp.

2981  {
2982  MoFEM::Interface &m_field = cOre;
2983  const Problem *problem_ptr;
2985  rval = m_field.get_moab().create_meshset(MESHSET_SET, *meshset);
2986  CHKERRQ_MOAB(rval);
2987  ierr = m_field.get_problem(prb_name, &problem_ptr);
2988  CHKERRG(ierr);
2989  NumeredEntFiniteElement_multiIndex::index<
2990  FiniteElement_name_mi_tag>::type::iterator fit,
2991  hi_fe_it;
2992  fit = problem_ptr->numeredFiniteElements.get<FiniteElement_name_mi_tag>()
2993  .lower_bound(fe_name);
2994  hi_fe_it = problem_ptr->numeredFiniteElements.get<FiniteElement_name_mi_tag>()
2995  .upper_bound(fe_name);
2996  std::vector<EntityHandle> fe_vec;
2997  fe_vec.reserve(std::distance(fit, hi_fe_it));
2998  for (; fit != hi_fe_it; fit++) {
2999  fe_vec.push_back(fit->get()->getEnt());
3000  }
3001  rval = m_field.get_moab().add_entities(*meshset, &*fe_vec.begin(),
3002  fe_vec.size());
3004 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:533
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:562
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
virtual MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const =0
Get problem database (data structure)

◆ getOptions()

MoFEMErrorCode MoFEM::ProblemsManager::getOptions ( )

Definition at line 82 of file ProblemsManager.cpp.

82  {
83  MoFEM::Interface &m_field = cOre;
85  ierr = PetscOptionsBegin(m_field.get_comm(), "", "Problem manager", "none");
86  CHKERRG(ierr);
87  {
88  ierr = PetscOptionsBool(
89  "-problem_build_from_fields",
90  "Add DOFs to problem directly from fields not through DOFs on elements",
92  CHKERRG(ierr);
93  }
94  ierr = PetscOptionsEnd();
95  CHKERRG(ierr);
97 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:562
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
virtual MPI_Comm & get_comm() const =0

◆ printPartitionedProblem()

MoFEMErrorCode MoFEM::ProblemsManager::printPartitionedProblem ( const Problem problem_ptr,
int  verb = VERBOSE 
)

Definition at line 2397 of file ProblemsManager.cpp.

2397  {
2398  MoFEM::Interface &m_field = cOre;
2400  if (verb > 0) {
2401  std::ostringstream ss;
2402  ss << "partition_problem: rank = " << m_field.get_comm_rank()
2403  << " FEs row ghost dofs " << *problem_ptr << " Nb. local dof "
2404  << problem_ptr->getNbLocalDofsRow() << " nb global row dofs "
2405  << problem_ptr->getNbDofsRow() << std::endl;
2406  ss << "partition_problem: rank = " << m_field.get_comm_rank()
2407  << " FEs col ghost dofs " << *problem_ptr << " Nb. local dof "
2408  << problem_ptr->getNbLocalDofsCol() << " nb global col dofs "
2409  << problem_ptr->getNbDofsCol() << std::endl;
2410  PetscSynchronizedPrintf(m_field.get_comm(), ss.str().c_str());
2411  PetscSynchronizedFlush(m_field.get_comm(), PETSC_STDOUT);
2412  }
2413  if (verb > 1) {
2414  // FIXME mess if printed on more than one processors
2415  // std::ostringstream ss;
2416  std::cout << "rank = " << m_field.get_comm_rank() << " FEs row dofs "
2417  << *problem_ptr << " Nb. row dof " << problem_ptr->getNbDofsRow()
2418  << " Nb. local dof " << problem_ptr->getNbLocalDofsRow()
2419  << std::endl;
2420  NumeredDofEntity_multiIndex::iterator miit_dd_row =
2421  problem_ptr->numeredDofsRows->begin();
2422  for (; miit_dd_row != problem_ptr->numeredDofsRows->end(); miit_dd_row++) {
2423  std::cout << **miit_dd_row << std::endl;
2424  }
2425  std::cout << "rank = " << m_field.get_comm_rank() << " FEs col dofs "
2426  << *problem_ptr << " Nb. col dof " << problem_ptr->getNbDofsCol()
2427  << " Nb. local dof " << problem_ptr->getNbLocalDofsCol()
2428  << std::endl;
2429  NumeredDofEntity_multiIndex::iterator miit_dd_col =
2430  problem_ptr->numeredDofsCols->begin();
2431  for (; miit_dd_col != problem_ptr->numeredDofsCols->end(); miit_dd_col++) {
2432  std::cout << **miit_dd_col << std::endl;
2433  }
2434  // PetscSynchronizedPrintf(comm,ss.str().c_str());
2435  // PetscSynchronizedFlush(comm,PETSC_STDOUT);
2436  }
2438 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
virtual int get_comm_rank() const =0
virtual MPI_Comm & get_comm() const =0

◆ query_interface()

MoFEMErrorCode MoFEM::ProblemsManager::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 62 of file ProblemsManager.cpp.

63  {
65  *iface = NULL;
66  if (uuid == IDD_MOFEMProblemsManager) {
67  *iface = const_cast<ProblemsManager *>(this);
69  }
70  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
72 }
static const MOFEMuuid IDD_MOFEMProblemsManager
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
ProblemsManager(const MoFEM::Core &core)

Member Data Documentation

◆ buildProblemFromFields

PetscBool MoFEM::ProblemsManager::buildProblemFromFields

If set to true, problem is build from

Definition at line 47 of file ProblemsManager.hpp.

◆ cOre

MoFEM::Core& MoFEM::ProblemsManager::cOre

Definition at line 39 of file ProblemsManager.hpp.

◆ MOFEM_EVENT_ProblemsManager

PetscLogEvent MoFEM::ProblemsManager::MOFEM_EVENT_ProblemsManager
private

Definition at line 289 of file ProblemsManager.hpp.

◆ synchroniseProblemEntities

PetscBool MoFEM::ProblemsManager::synchroniseProblemEntities

DOFs in fields, not from DOFs on elements.

Definition at line 50 of file ProblemsManager.hpp.


The documentation for this struct was generated from the following files: