libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::BoundaryProjectSolution Class Reference

This class implements projecting an arbitrary boundary function to the current mesh. More...

Public Member Functions

 BoundaryProjectSolution (const std::set< boundary_id_type > &b_in, const std::vector< unsigned int > &variables_in, const System &system_in, FunctionBase< Number > *f_in, FunctionBase< Gradient > *g_in, const Parameters &parameters_in, NumericVector< Number > &new_v_in)
 
 BoundaryProjectSolution (const BoundaryProjectSolution &in)
 
void operator() (const ConstElemRange &range) const
 

Private Attributes

const std::set< boundary_id_type > & b
 
const std::vector< unsigned int > & variables
 
const Systemsystem
 
std::unique_ptr< FunctionBase< Number > > f
 
std::unique_ptr< FunctionBase< Gradient > > g
 
const Parametersparameters
 
NumericVector< Number > & new_vector
 

Detailed Description

This class implements projecting an arbitrary boundary function to the current mesh.

This may be executed in parallel on multiple threads.

Definition at line 192 of file system_projection.C.

Constructor & Destructor Documentation

◆ BoundaryProjectSolution() [1/2]

libMesh::BoundaryProjectSolution::BoundaryProjectSolution ( const std::set< boundary_id_type > &  b_in,
const std::vector< unsigned int > &  variables_in,
const System system_in,
FunctionBase< Number > *  f_in,
FunctionBase< Gradient > *  g_in,
const Parameters parameters_in,
NumericVector< Number > &  new_v_in 
)
inline

Definition at line 204 of file system_projection.C.

References libMesh::libmesh_assert().

210  :
211  b(b_in),
212  variables(variables_in),
213  system(system_in),
214  f(f_in ? f_in->clone() : std::unique_ptr<FunctionBase<Number>>()),
215  g(g_in ? g_in->clone() : std::unique_ptr<FunctionBase<Gradient>>()),
216  parameters(parameters_in),
217  new_vector(new_v_in)
218  {
219  libmesh_assert(f.get());
220  f->init();
221  if (g.get())
222  g->init();
223  }
std::unique_ptr< FunctionBase< Number > > f
const std::vector< unsigned int > & variables
NumericVector< Number > & new_vector
libmesh_assert(ctx)
virtual std::unique_ptr< FunctionBase< Output > > clone() const =0
const std::set< boundary_id_type > & b
std::unique_ptr< FunctionBase< Gradient > > g

◆ BoundaryProjectSolution() [2/2]

libMesh::BoundaryProjectSolution::BoundaryProjectSolution ( const BoundaryProjectSolution in)
inline

Definition at line 225 of file system_projection.C.

References libMesh::libmesh_assert().

225  :
226  b(in.b),
227  variables(in.variables),
228  system(in.system),
229  f(in.f.get() ? in.f->clone() : std::unique_ptr<FunctionBase<Number>>()),
230  g(in.g.get() ? in.g->clone() : std::unique_ptr<FunctionBase<Gradient>>()),
231  parameters(in.parameters),
232  new_vector(in.new_vector)
233  {
234  libmesh_assert(f.get());
235  f->init();
236  if (g.get())
237  g->init();
238  }
std::unique_ptr< FunctionBase< Number > > f
const std::vector< unsigned int > & variables
NumericVector< Number > & new_vector
libmesh_assert(ctx)
const std::set< boundary_id_type > & b
std::unique_ptr< FunctionBase< Gradient > > g

Member Function Documentation

◆ operator()()

void libMesh::BoundaryProjectSolution::operator() ( const ConstElemRange range) const

This method projects an arbitrary boundary solution to the current mesh. The input function f gives the arbitrary solution, while the new_vector (which should already be correctly sized) gives the solution (to be computed) on the current mesh.

Definition at line 1534 of file system_projection.C.

References libMesh::Variable::active_on_subdomain(), b, libMesh::BoundaryInfo::boundary_ids(), libMesh::C_ONE, libMesh::C_ZERO, libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::FEType::default_quadrature_rule(), dim, libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::FEType::family, libMesh::HERMITE, libMesh::index_range(), libMesh::libmesh_assert(), libMesh::make_range(), n_nodes, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::SCALAR, libMesh::Threads::spin_mtx, libMesh::TOLERANCE, libMesh::Variable::type(), libMesh::DofMap::variable(), libMesh::DenseMatrix< T >::zero(), and libMesh::DenseVector< T >::zero().

1535 {
1536  // We need data to project
1537  libmesh_assert(f.get());
1538 
1546  // The dimensionality of the current mesh
1547  const unsigned int dim = system.get_mesh().mesh_dimension();
1548 
1549  // The DofMap for this system
1550  const DofMap & dof_map = system.get_dof_map();
1551 
1552  // Boundary info for the current mesh
1553  const BoundaryInfo & boundary_info =
1555 
1556  // The element matrix and RHS for projections.
1557  // Note that Ke is always real-valued, whereas
1558  // Fe may be complex valued if complex number
1559  // support is enabled
1560  DenseMatrix<Real> Ke;
1561  DenseVector<Number> Fe;
1562  // The new element coefficients
1563  DenseVector<Number> Ue;
1564 
1565 
1566  // Loop over all the variables we've been requested to project
1567  for (auto v : make_range(variables.size()))
1568  {
1569  const unsigned int var = variables[v];
1570 
1571  const Variable & variable = dof_map.variable(var);
1572 
1573  const FEType & fe_type = variable.type();
1574 
1575  if (fe_type.family == SCALAR)
1576  continue;
1577 
1578  const unsigned int var_component =
1580 
1581  // Get FE objects of the appropriate type
1582  std::unique_ptr<FEBase> fe (FEBase::build(dim, fe_type));
1583 
1584  // Prepare variables for projection
1585  std::unique_ptr<QBase> qedgerule (fe_type.default_quadrature_rule(1));
1586  std::unique_ptr<QBase> qsiderule (fe_type.default_quadrature_rule(dim-1));
1587 
1588  // The values of the shape functions at the quadrature
1589  // points
1590  const std::vector<std::vector<Real>> & phi = fe->get_phi();
1591 
1592  // The gradients of the shape functions at the quadrature
1593  // points on the child element.
1594  const std::vector<std::vector<RealGradient>> * dphi = nullptr;
1595 
1596  const FEContinuity cont = fe->get_continuity();
1597 
1598  if (cont == C_ONE)
1599  {
1600  // We'll need gradient data for a C1 projection
1601  libmesh_assert(g.get());
1602 
1603  const std::vector<std::vector<RealGradient>> &
1604  ref_dphi = fe->get_dphi();
1605  dphi = &ref_dphi;
1606  }
1607 
1608  // The Jacobian * quadrature weight at the quadrature points
1609  const std::vector<Real> & JxW =
1610  fe->get_JxW();
1611 
1612  // The XYZ locations of the quadrature points
1613  const std::vector<Point> & xyz_values =
1614  fe->get_xyz();
1615 
1616  // The global DOF indices
1617  std::vector<dof_id_type> dof_indices;
1618  // Side/edge DOF indices
1619  std::vector<unsigned int> side_dofs;
1620 
1621  // Container to catch IDs passed back from BoundaryInfo.
1622  std::vector<boundary_id_type> bc_ids;
1623 
1624  // Iterate over all the elements in the range
1625  for (const auto & elem : range)
1626  {
1627  // Per-subdomain variables don't need to be projected on
1628  // elements where they're not active
1629  if (!variable.active_on_subdomain(elem->subdomain_id()))
1630  continue;
1631 
1632  const unsigned short n_nodes = elem->n_nodes();
1633  const unsigned short n_edges = elem->n_edges();
1634  const unsigned short n_sides = elem->n_sides();
1635 
1636  // Find out which nodes, edges and sides are on a requested
1637  // boundary:
1638  std::vector<bool> is_boundary_node(n_nodes, false),
1639  is_boundary_edge(n_edges, false),
1640  is_boundary_side(n_sides, false);
1641 
1642  // We also maintain a separate list of nodeset-based boundary nodes
1643  std::vector<bool> is_boundary_nodeset(n_nodes, false);
1644 
1645  for (unsigned char s=0; s != n_sides; ++s)
1646  {
1647  // First see if this side has been requested
1648  boundary_info.boundary_ids (elem, s, bc_ids);
1649  bool do_this_side = false;
1650  for (const auto & bc_id : bc_ids)
1651  if (b.count(bc_id))
1652  {
1653  do_this_side = true;
1654  break;
1655  }
1656  if (!do_this_side)
1657  continue;
1658 
1659  is_boundary_side[s] = true;
1660 
1661  // Then see what nodes and what edges are on it
1662  for (unsigned int n=0; n != n_nodes; ++n)
1663  if (elem->is_node_on_side(n,s))
1664  is_boundary_node[n] = true;
1665  for (unsigned int e=0; e != n_edges; ++e)
1666  if (elem->is_edge_on_side(e,s))
1667  is_boundary_edge[e] = true;
1668  }
1669 
1670  // We can also project on nodes, so we should also independently
1671  // check whether the nodes have been requested
1672  for (unsigned int n=0; n != n_nodes; ++n)
1673  {
1674  boundary_info.boundary_ids (elem->node_ptr(n), bc_ids);
1675 
1676  for (const auto & bc_id : bc_ids)
1677  if (b.count(bc_id))
1678  {
1679  is_boundary_node[n] = true;
1680  is_boundary_nodeset[n] = true;
1681  }
1682  }
1683 
1684  // We can also project on edges, so we should also independently
1685  // check whether the edges have been requested
1686  for (unsigned short e=0; e != n_edges; ++e)
1687  {
1688  boundary_info.edge_boundary_ids (elem, e, bc_ids);
1689 
1690  for (const auto & bc_id : bc_ids)
1691  if (b.count(bc_id))
1692  is_boundary_edge[e] = true;
1693  }
1694 
1695  // Update the DOF indices for this element based on
1696  // the current mesh
1697  dof_map.dof_indices (elem, dof_indices, var);
1698 
1699  // The number of DOFs on the element
1700  const unsigned int n_dofs =
1701  cast_int<unsigned int>(dof_indices.size());
1702 
1703  // Fixed vs. free DoFs on edge/face projections
1704  std::vector<char> dof_is_fixed(n_dofs, false); // bools
1705  std::vector<int> free_dof(n_dofs, 0);
1706 
1707  // Zero the interpolated values
1708  Ue.resize (n_dofs); Ue.zero();
1709 
1710  // In general, we need a series of
1711  // projections to ensure a unique and continuous
1712  // solution. We start by interpolating boundary nodes, then
1713  // hold those fixed and project boundary edges, then hold
1714  // those fixed and project boundary faces,
1715 
1716  // Interpolate node values first
1717  unsigned int current_dof = 0;
1718  for (unsigned short n = 0; n != n_nodes; ++n)
1719  {
1720  // FIXME: this should go through the DofMap,
1721  // not duplicate dof_indices code badly!
1722 
1723  // This call takes into account elem->p_level() internally.
1724  const unsigned int nc =
1725  FEInterface::n_dofs_at_node (fe_type, elem, n);
1726 
1727  if ((!elem->is_vertex(n) || !is_boundary_node[n]) &&
1728  !is_boundary_nodeset[n])
1729  {
1730  current_dof += nc;
1731  continue;
1732  }
1733  if (cont == DISCONTINUOUS)
1734  {
1735  libmesh_assert_equal_to (nc, 0);
1736  }
1737  // Assume that C_ZERO elements have a single nodal
1738  // value shape function
1739  else if (cont == C_ZERO)
1740  {
1741  libmesh_assert_equal_to (nc, 1);
1742  Ue(current_dof) = f->component(var_component,
1743  elem->point(n),
1744  system.time);
1745  dof_is_fixed[current_dof] = true;
1746  current_dof++;
1747  }
1748  // The hermite element vertex shape functions are weird
1749  else if (fe_type.family == HERMITE)
1750  {
1751  Ue(current_dof) = f->component(var_component,
1752  elem->point(n),
1753  system.time);
1754  dof_is_fixed[current_dof] = true;
1755  current_dof++;
1756  Gradient grad = g->component(var_component,
1757  elem->point(n),
1758  system.time);
1759  // x derivative
1760  Ue(current_dof) = grad(0);
1761  dof_is_fixed[current_dof] = true;
1762  current_dof++;
1763 #if LIBMESH_DIM > 1
1764  if (dim > 1)
1765  {
1766  // We'll finite difference mixed derivatives
1767  Point nxminus = elem->point(n),
1768  nxplus = elem->point(n);
1769  nxminus(0) -= TOLERANCE;
1770  nxplus(0) += TOLERANCE;
1771  Gradient gxminus = g->component(var_component,
1772  nxminus,
1773  system.time);
1774  Gradient gxplus = g->component(var_component,
1775  nxplus,
1776  system.time);
1777  // y derivative
1778  Ue(current_dof) = grad(1);
1779  dof_is_fixed[current_dof] = true;
1780  current_dof++;
1781  // xy derivative
1782  Ue(current_dof) = (gxplus(1) - gxminus(1))
1783  / 2. / TOLERANCE;
1784  dof_is_fixed[current_dof] = true;
1785  current_dof++;
1786 
1787 #if LIBMESH_DIM > 2
1788  if (dim > 2)
1789  {
1790  // z derivative
1791  Ue(current_dof) = grad(2);
1792  dof_is_fixed[current_dof] = true;
1793  current_dof++;
1794  // xz derivative
1795  Ue(current_dof) = (gxplus(2) - gxminus(2))
1796  / 2. / TOLERANCE;
1797  dof_is_fixed[current_dof] = true;
1798  current_dof++;
1799  // We need new points for yz
1800  Point nyminus = elem->point(n),
1801  nyplus = elem->point(n);
1802  nyminus(1) -= TOLERANCE;
1803  nyplus(1) += TOLERANCE;
1804  Gradient gyminus = g->component(var_component,
1805  nyminus,
1806  system.time);
1807  Gradient gyplus = g->component(var_component,
1808  nyplus,
1809  system.time);
1810  // xz derivative
1811  Ue(current_dof) = (gyplus(2) - gyminus(2))
1812  / 2. / TOLERANCE;
1813  dof_is_fixed[current_dof] = true;
1814  current_dof++;
1815  // Getting a 2nd order xyz is more tedious
1816  Point nxmym = elem->point(n),
1817  nxmyp = elem->point(n),
1818  nxpym = elem->point(n),
1819  nxpyp = elem->point(n);
1820  nxmym(0) -= TOLERANCE;
1821  nxmym(1) -= TOLERANCE;
1822  nxmyp(0) -= TOLERANCE;
1823  nxmyp(1) += TOLERANCE;
1824  nxpym(0) += TOLERANCE;
1825  nxpym(1) -= TOLERANCE;
1826  nxpyp(0) += TOLERANCE;
1827  nxpyp(1) += TOLERANCE;
1828  Gradient gxmym = g->component(var_component,
1829  nxmym,
1830  system.time);
1831  Gradient gxmyp = g->component(var_component,
1832  nxmyp,
1833  system.time);
1834  Gradient gxpym = g->component(var_component,
1835  nxpym,
1836  system.time);
1837  Gradient gxpyp = g->component(var_component,
1838  nxpyp,
1839  system.time);
1840  Number gxzplus = (gxpyp(2) - gxmyp(2))
1841  / 2. / TOLERANCE;
1842  Number gxzminus = (gxpym(2) - gxmym(2))
1843  / 2. / TOLERANCE;
1844  // xyz derivative
1845  Ue(current_dof) = (gxzplus - gxzminus)
1846  / 2. / TOLERANCE;
1847  dof_is_fixed[current_dof] = true;
1848  current_dof++;
1849  }
1850 #endif // LIBMESH_DIM > 2
1851  }
1852 #endif // LIBMESH_DIM > 1
1853  }
1854  // Assume that other C_ONE elements have a single nodal
1855  // value shape function and nodal gradient component
1856  // shape functions
1857  else if (cont == C_ONE)
1858  {
1859  libmesh_assert_equal_to (nc, 1 + dim);
1860  Ue(current_dof) = f->component(var_component,
1861  elem->point(n),
1862  system.time);
1863  dof_is_fixed[current_dof] = true;
1864  current_dof++;
1865  Gradient grad = g->component(var_component,
1866  elem->point(n),
1867  system.time);
1868  for (unsigned int i=0; i!= dim; ++i)
1869  {
1870  Ue(current_dof) = grad(i);
1871  dof_is_fixed[current_dof] = true;
1872  current_dof++;
1873  }
1874  }
1875  else
1876  libmesh_error_msg("Unknown continuity " << cont);
1877  }
1878 
1879  // In 3D, project any edge values next
1880  if (dim > 2 && cont != DISCONTINUOUS)
1881  for (unsigned short e = 0; e != n_edges; ++e)
1882  {
1883  if (!is_boundary_edge[e])
1884  continue;
1885 
1886  FEInterface::dofs_on_edge(elem, dim, fe_type, e,
1887  side_dofs);
1888 
1889  const unsigned int n_side_dofs =
1890  cast_int<unsigned int>(side_dofs.size());
1891 
1892  // Some edge dofs are on nodes and already
1893  // fixed, others are free to calculate
1894  unsigned int free_dofs = 0;
1895  for (auto i : make_range(n_side_dofs))
1896  if (!dof_is_fixed[side_dofs[i]])
1897  free_dof[free_dofs++] = i;
1898 
1899  // There may be nothing to project
1900  if (!free_dofs)
1901  continue;
1902 
1903  Ke.resize (free_dofs, free_dofs); Ke.zero();
1904  Fe.resize (free_dofs); Fe.zero();
1905  // The new edge coefficients
1906  DenseVector<Number> Uedge(free_dofs);
1907 
1908  // Initialize FE data on the edge
1909  fe->attach_quadrature_rule (qedgerule.get());
1910  fe->edge_reinit (elem, e);
1911  const unsigned int n_qp = qedgerule->n_points();
1912 
1913  // Loop over the quadrature points
1914  for (unsigned int qp=0; qp<n_qp; qp++)
1915  {
1916  // solution at the quadrature point
1917  Number fineval = f->component(var_component,
1918  xyz_values[qp],
1919  system.time);
1920  // solution grad at the quadrature point
1921  Gradient finegrad;
1922  if (cont == C_ONE)
1923  finegrad = g->component(var_component,
1924  xyz_values[qp],
1925  system.time);
1926 
1927  // Form edge projection matrix
1928  for (unsigned int sidei=0, freei=0;
1929  sidei != n_side_dofs; ++sidei)
1930  {
1931  unsigned int i = side_dofs[sidei];
1932  // fixed DoFs aren't test functions
1933  if (dof_is_fixed[i])
1934  continue;
1935  for (unsigned int sidej=0, freej=0;
1936  sidej != n_side_dofs; ++sidej)
1937  {
1938  unsigned int j = side_dofs[sidej];
1939  if (dof_is_fixed[j])
1940  Fe(freei) -= phi[i][qp] * phi[j][qp] *
1941  JxW[qp] * Ue(j);
1942  else
1943  Ke(freei,freej) += phi[i][qp] *
1944  phi[j][qp] * JxW[qp];
1945  if (cont == C_ONE)
1946  {
1947  if (dof_is_fixed[j])
1948  Fe(freei) -= ((*dphi)[i][qp] *
1949  (*dphi)[j][qp]) *
1950  JxW[qp] * Ue(j);
1951  else
1952  Ke(freei,freej) += ((*dphi)[i][qp] *
1953  (*dphi)[j][qp])
1954  * JxW[qp];
1955  }
1956  if (!dof_is_fixed[j])
1957  freej++;
1958  }
1959  Fe(freei) += phi[i][qp] * fineval * JxW[qp];
1960  if (cont == C_ONE)
1961  Fe(freei) += (finegrad * (*dphi)[i][qp]) *
1962  JxW[qp];
1963  freei++;
1964  }
1965  }
1966 
1967  Ke.cholesky_solve(Fe, Uedge);
1968 
1969  // Transfer new edge solutions to element
1970  for (unsigned int i=0; i != free_dofs; ++i)
1971  {
1972  Number & ui = Ue(side_dofs[free_dof[i]]);
1973  libmesh_assert(std::abs(ui) < TOLERANCE ||
1974  std::abs(ui - Uedge(i)) < TOLERANCE);
1975  ui = Uedge(i);
1976  dof_is_fixed[side_dofs[free_dof[i]]] = true;
1977  }
1978  }
1979 
1980  // Project any side values (edges in 2D, faces in 3D)
1981  if (dim > 1 && cont != DISCONTINUOUS)
1982  for (unsigned short s = 0; s != n_sides; ++s)
1983  {
1984  if (!is_boundary_side[s])
1985  continue;
1986 
1987  FEInterface::dofs_on_side(elem, dim, fe_type, s,
1988  side_dofs);
1989 
1990  // Some side dofs are on nodes/edges and already
1991  // fixed, others are free to calculate
1992  unsigned int free_dofs = 0;
1993  for (auto i : index_range(side_dofs))
1994  if (!dof_is_fixed[side_dofs[i]])
1995  free_dof[free_dofs++] = i;
1996 
1997  // There may be nothing to project
1998  if (!free_dofs)
1999  continue;
2000 
2001  Ke.resize (free_dofs, free_dofs); Ke.zero();
2002  Fe.resize (free_dofs); Fe.zero();
2003  // The new side coefficients
2004  DenseVector<Number> Uside(free_dofs);
2005 
2006  // Initialize FE data on the side
2007  fe->attach_quadrature_rule (qsiderule.get());
2008  fe->reinit (elem, s);
2009  const unsigned int n_qp = qsiderule->n_points();
2010 
2011  const unsigned int n_side_dofs =
2012  cast_int<unsigned int>(side_dofs.size());
2013 
2014  // Loop over the quadrature points
2015  for (unsigned int qp=0; qp<n_qp; qp++)
2016  {
2017  // solution at the quadrature point
2018  Number fineval = f->component(var_component,
2019  xyz_values[qp],
2020  system.time);
2021  // solution grad at the quadrature point
2022  Gradient finegrad;
2023  if (cont == C_ONE)
2024  finegrad = g->component(var_component,
2025  xyz_values[qp],
2026  system.time);
2027 
2028  // Form side projection matrix
2029  for (unsigned int sidei=0, freei=0;
2030  sidei != n_side_dofs; ++sidei)
2031  {
2032  unsigned int i = side_dofs[sidei];
2033  // fixed DoFs aren't test functions
2034  if (dof_is_fixed[i])
2035  continue;
2036  for (unsigned int sidej=0, freej=0;
2037  sidej != n_side_dofs; ++sidej)
2038  {
2039  unsigned int j = side_dofs[sidej];
2040  if (dof_is_fixed[j])
2041  Fe(freei) -= phi[i][qp] * phi[j][qp] *
2042  JxW[qp] * Ue(j);
2043  else
2044  Ke(freei,freej) += phi[i][qp] *
2045  phi[j][qp] * JxW[qp];
2046  if (cont == C_ONE)
2047  {
2048  if (dof_is_fixed[j])
2049  Fe(freei) -= ((*dphi)[i][qp] *
2050  (*dphi)[j][qp]) *
2051  JxW[qp] * Ue(j);
2052  else
2053  Ke(freei,freej) += ((*dphi)[i][qp] *
2054  (*dphi)[j][qp])
2055  * JxW[qp];
2056  }
2057  if (!dof_is_fixed[j])
2058  freej++;
2059  }
2060  Fe(freei) += (fineval * phi[i][qp]) * JxW[qp];
2061  if (cont == C_ONE)
2062  Fe(freei) += (finegrad * (*dphi)[i][qp]) *
2063  JxW[qp];
2064  freei++;
2065  }
2066  }
2067 
2068  Ke.cholesky_solve(Fe, Uside);
2069 
2070  // Transfer new side solutions to element
2071  for (unsigned int i=0; i != free_dofs; ++i)
2072  {
2073  Number & ui = Ue(side_dofs[free_dof[i]]);
2074  libmesh_assert(std::abs(ui) < TOLERANCE ||
2075  std::abs(ui - Uside(i)) < TOLERANCE);
2076  ui = Uside(i);
2077  dof_is_fixed[side_dofs[free_dof[i]]] = true;
2078  }
2079  }
2080 
2081  const dof_id_type
2082  first = new_vector.first_local_index(),
2083  last = new_vector.last_local_index();
2084 
2085  // Lock the new_vector since it is shared among threads.
2086  {
2087  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
2088 
2089  for (unsigned int i = 0; i < n_dofs; i++)
2090  if (dof_is_fixed[i] &&
2091  (dof_indices[i] >= first) &&
2092  (dof_indices[i] < last))
2093  {
2094  new_vector.set(dof_indices[i], Ue(i));
2095  }
2096  }
2097  } // end elem loop
2098  } // end variables loop
2099 }
Real time
For time-dependent problems, this is the time t at the beginning of the current timestep.
Definition: system.h:1677
unsigned int variable_scalar_number(std::string_view var, unsigned int component) const
Definition: system.h:2474
static constexpr Real TOLERANCE
unsigned int dim
std::unique_ptr< FunctionBase< Number > > f
static void dofs_on_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with edge e of element elem A...
Definition: fe_interface.C:612
const std::vector< unsigned int > & variables
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:170
const MeshBase & get_mesh() const
Definition: system.h:2401
const dof_id_type n_nodes
Definition: tecplot_io.C:67
NumericVector< Number > & new_vector
NumberVectorValue Gradient
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
libmesh_assert(ctx)
template class LIBMESH_EXPORT DenseMatrix< Real >
Definition: dense_matrix.C:35
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
Definition: fe_interface.C:437
virtual numeric_index_type first_local_index() const =0
FEContinuity
defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:176
unsigned int mesh_dimension() const
Definition: mesh_base.C:430
virtual void set(const numeric_index_type i, const T value)=0
Sets v(i) = value.
const std::set< boundary_id_type > & b
std::unique_ptr< FunctionBase< Gradient > > g
const DofMap & get_dof_map() const
Definition: system.h:2417
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with side s of element elem A...
Definition: fe_interface.C:598
virtual numeric_index_type last_local_index() const =0
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:153
uint8_t dof_id_type
Definition: id_types.h:67
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:30

Member Data Documentation

◆ b

const std::set<boundary_id_type>& libMesh::BoundaryProjectSolution::b
private

Definition at line 195 of file system_projection.C.

◆ f

std::unique_ptr<FunctionBase<Number> > libMesh::BoundaryProjectSolution::f
private

Definition at line 198 of file system_projection.C.

◆ g

std::unique_ptr<FunctionBase<Gradient> > libMesh::BoundaryProjectSolution::g
private

Definition at line 199 of file system_projection.C.

◆ new_vector

NumericVector<Number>& libMesh::BoundaryProjectSolution::new_vector
private

Definition at line 201 of file system_projection.C.

◆ parameters

const Parameters& libMesh::BoundaryProjectSolution::parameters
private

Definition at line 200 of file system_projection.C.

◆ system

const System& libMesh::BoundaryProjectSolution::system
private

Definition at line 197 of file system_projection.C.

◆ variables

const std::vector<unsigned int>& libMesh::BoundaryProjectSolution::variables
private

Definition at line 196 of file system_projection.C.


The documentation for this class was generated from the following file: