48 std::ostringstream error_stream;
73 psi_r[2] = x[0] * x[0];
81 psi_r[2] = x[0] * x[0];
82 psi_r[3] = x[0] * x[0] * x[0];
87 error_stream <<
"Recovery shape functions for recovery order "
89 <<
" haven't yet been implemented for 1D" << std::endl;
92 OOMPH_CURRENT_FUNCTION,
93 OOMPH_EXCEPTION_LOCATION);
119 psi_r[3] = x[0] * x[0];
120 psi_r[4] = x[0] * x[1];
121 psi_r[5] = x[1] * x[1];
130 psi_r[3] = x[0] * x[0];
131 psi_r[4] = x[0] * x[1];
132 psi_r[5] = x[1] * x[1];
133 psi_r[6] = x[0] * x[0] * x[0];
134 psi_r[7] = x[0] * x[0] * x[1];
135 psi_r[8] = x[0] * x[1] * x[1];
136 psi_r[9] = x[1] * x[1] * x[1];
141 error_stream <<
"Recovery shape functions for recovery order "
143 <<
" haven't yet been implemented for 2D" << std::endl;
146 OOMPH_CURRENT_FUNCTION,
147 OOMPH_EXCEPTION_LOCATION);
174 psi_r[4] = x[0] * x[0];
175 psi_r[5] = x[0] * x[1];
176 psi_r[6] = x[0] * x[2];
177 psi_r[7] = x[1] * x[1];
178 psi_r[8] = x[1] * x[2];
179 psi_r[9] = x[2] * x[2];
189 psi_r[4] = x[0] * x[0];
190 psi_r[5] = x[0] * x[1];
191 psi_r[6] = x[0] * x[2];
192 psi_r[7] = x[1] * x[1];
193 psi_r[8] = x[1] * x[2];
194 psi_r[9] = x[2] * x[2];
195 psi_r[10] = x[0] * x[0] * x[0];
196 psi_r[11] = x[0] * x[0] * x[1];
197 psi_r[12] = x[0] * x[0] * x[2];
198 psi_r[13] = x[1] * x[1] * x[1];
199 psi_r[14] = x[0] * x[1] * x[1];
200 psi_r[15] = x[2] * x[1] * x[1];
201 psi_r[16] = x[2] * x[2] * x[2];
202 psi_r[17] = x[2] * x[2] * x[0];
203 psi_r[18] = x[2] * x[2] * x[1];
204 psi_r[19] = x[0] * x[1] * x[2];
210 error_stream <<
"Recovery shape functions for recovery order "
212 <<
" haven't yet been implemented for 3D" << std::endl;
215 OOMPH_CURRENT_FUNCTION,
216 OOMPH_EXCEPTION_LOCATION);
226 error_stream <<
"No recovery shape functions for dim " << dim
229 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
246 const bool& is_q_mesh)
248 std::ostringstream error_stream;
305 error_stream <<
"Recovery shape functions for recovery order "
307 <<
" haven't yet been implemented for 1D" << std::endl;
310 OOMPH_CURRENT_FUNCTION,
311 OOMPH_EXCEPTION_LOCATION);
364 error_stream <<
"Recovery shape functions for recovery order "
366 <<
" haven't yet been implemented for 2D" << std::endl;
369 OOMPH_CURRENT_FUNCTION,
370 OOMPH_EXCEPTION_LOCATION);
423 error_stream <<
"Recovery shape functions for recovery order "
425 <<
" haven't yet been implemented for 3D" << std::endl;
428 OOMPH_CURRENT_FUNCTION,
429 OOMPH_EXCEPTION_LOCATION);
439 error_stream <<
"No recovery shape functions for dim " << dim
442 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
470 const unsigned n_compound_error = compound_error.size();
473 if (n_compound_error == 0)
476 "No compound errors have been passed, so maximum cannot be found.",
477 OOMPH_CURRENT_FUNCTION,
478 OOMPH_EXCEPTION_LOCATION);
484 double max_error = compound_error[0];
487 for (
unsigned i = 1;
i < n_compound_error;
i++)
489 if (compound_error[
i] > max_error)
491 max_error = compound_error[
i];
508 adjacent_elements_pt,
548 std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>
549 aux_adjacent_elements_pt;
553 unsigned ndisagree = 0;
560 unsigned nelem = mesh_pt->
nelement();
561 for (
unsigned e = 0;
e < nelem;
e++)
575 unsigned nnod = el_pt->
nnode();
576 for (
unsigned n = 0; n < nnod; n++)
581 if (aux_adjacent_elements_pt[nod_pt] == 0)
584 aux_adjacent_elements_pt[nod_pt] =
589 (*aux_adjacent_elements_pt[nod_pt]).push_back(el_pt);
599 <<
"\n\n========================================================\n";
604 <<
"have different preferences for the order of the recovery\n";
605 oomph_info <<
"shape functions. We are using: Recovery_order="
608 <<
"========================================================\n\n";
614 for (
unsigned e = 0;
e < nelem;
e++)
621 for (
unsigned n = 0; n < n_node; n++)
626 if (adjacent_elements_pt[nod_pt] == 0)
629 vertex_node_pt.push_back(nod_pt);
632 adjacent_elements_pt[nod_pt] =
636 unsigned nel = (*aux_adjacent_elements_pt[nod_pt]).size();
637 for (
unsigned e = 0;
e < nel;
e++)
639 (*adjacent_elements_pt[nod_pt])
640 .push_back((*aux_adjacent_elements_pt[nod_pt])[
e]);
648 typedef std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>::iterator
650 for (ITT it = aux_adjacent_elements_pt.begin();
651 it != aux_adjacent_elements_pt.end();
668 const unsigned& num_recovery_terms,
669 const unsigned& num_flux_terms,
678 for (
unsigned irhs = 0; irhs < num_flux_terms; irhs++)
680 rhs[irhs].resize(num_recovery_terms);
681 for (
unsigned j = 0; j < num_recovery_terms; j++)
691 bool is_q_mesh =
true;
703 unsigned nelem = patch_el_pt.size();
704 for (
unsigned e = 0;
e < nelem;
e++)
716 unsigned Nintpt = integ_pt->
nweight();
718 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
721 for (
unsigned i = 0;
i < dim;
i++)
727 double w = integ_pt->
weight(ipt);
753 for (
unsigned i = 0;
i < num_flux_terms;
i++)
756 for (
unsigned l = 0; l < num_recovery_terms; l++)
758 rhs[
i][l] += fe_flux[
i] * psi_r[l] *
W;
764 for (
unsigned l = 0; l < num_recovery_terms; l++)
767 for (
unsigned l2 = 0; l2 < num_recovery_terms; l2++)
770 recovery_mat(l, l2) += psi_r[l] * psi_r[l2] *
W;
786 for (
unsigned irhs = 0; irhs < num_flux_terms; irhs++)
788 recovery_mat.
lubksub(rhs[irhs]);
793 recovered_flux_coefficient_pt =
797 for (
unsigned icoeff = 0; icoeff < num_recovery_terms; icoeff++)
799 for (
unsigned irhs = 0; irhs < num_flux_terms; irhs++)
801 (*recovered_flux_coefficient_pt)(icoeff, irhs) = rhs[irhs][icoeff];
814 unsigned num_recovery_terms;
817 if ((dim != 1) && (dim != 2) && (dim != 3))
819 std::string error_message =
"THIS HASN'T BEEN USED/VALIDATED YET -- "
820 "CHECK NUMBER OF RECOVERY TERMS!\n";
821 error_message +=
"Then remove this break and continue\n";
824 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
839 num_recovery_terms = 2;
844 num_recovery_terms = 3;
849 num_recovery_terms = 4;
854 OOMPH_CURRENT_FUNCTION,
855 OOMPH_EXCEPTION_LOCATION);
868 num_recovery_terms = 3;
873 num_recovery_terms = 6;
878 num_recovery_terms = 10;
883 OOMPH_CURRENT_FUNCTION,
884 OOMPH_EXCEPTION_LOCATION);
898 num_recovery_terms = 4;
909 num_recovery_terms = 20;
919 OOMPH_CURRENT_FUNCTION,
920 OOMPH_EXCEPTION_LOCATION);
929 std::ostringstream error_stream;
930 error_stream <<
"Wrong Recovery_order " <<
Recovery_order << std::endl;
933 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
936 return num_recovery_terms;
968 unsigned num_flux_terms_local = 0;
969 unsigned dim_local = 0;
970 unsigned recovery_order_local = 0;
974 unsigned num_flux_terms = 0;
992 "Element needs to inherit from ElementWithZ2ErrorEstimator!",
993 OOMPH_CURRENT_FUNCTION,
994 OOMPH_EXCEPTION_LOCATION);
1002 dim_local = el_pt->
dim();
1022 MPI_Allreduce(&num_flux_terms_local,
1027 comm_pt->mpi_comm());
1028 MPI_Allreduce(&dim_local, &dim, 1, MPI_INT, MPI_MAX, comm_pt->mpi_comm());
1029 MPI_Allreduce(&recovery_order_local,
1034 comm_pt->mpi_comm());
1038 num_flux_terms = num_flux_terms_local;
1058 "Element needs to inherit from ElementWithZ2ErrorEstimator!",
1059 OOMPH_CURRENT_FUNCTION,
1060 OOMPH_EXCEPTION_LOCATION);
1085 std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*> adjacent_elements_pt;
1087 setup_patches(mesh_pt, adjacent_elements_pt, vertex_node_pt);
1094 std::map<Node*, std::set<DenseMatrix<double>*>> flux_coeff_pt;
1100 typedef std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>::iterator IT;
1107 std::map<ElementWithZ2ErrorEstimator*, int> elem_num;
1108 unsigned nelem = mesh_pt->
nelement();
1109 for (
unsigned e = 0;
e < nelem;
e++)
1116 int n_patch = adjacent_elements_pt.size();
1121 int itend = n_patch;
1123 #ifdef OOMPH_HAS_MPI
1124 int range = n_patch;
1130 range = n_patch / n_proc;
1132 itbegin = my_rank * range;
1133 itend = (my_rank + 1) * range;
1136 if (my_rank == (n_proc - 1))
1146 vector_of_recovered_flux_coefficient_pt_to_send;
1151 for (
int i = itbegin;
i < itend;
i++)
1154 Node* nod_pt = vertex_node_pt[
i];
1159 adjacent_elements_pt[nod_pt];
1163 unsigned nelem = (*el_vec_pt).size();
1169 for (
unsigned e = 0;
e < nelem;
e++)
1171 elements_in_this_patch.push_back(elem_num[(*el_vec_pt)[
e]]);
1175 vector_of_elements_in_patch_to_send.push_back(elements_in_this_patch);
1187 recovered_flux_coefficient_pt);
1191 vector_of_recovered_flux_coefficient_pt_to_send.push_back(
1192 recovered_flux_coefficient_pt);
1200 #ifdef OOMPH_HAS_MPI
1209 for (
int iproc = 0; iproc < n_proc; iproc++)
1212 int n_patches = vector_of_recovered_flux_coefficient_pt_to_send.size();
1213 MPI_Bcast(&n_patches, 1, MPI_INT, iproc, comm_pt->mpi_comm());
1216 for (
int ipatch = 0; ipatch < n_patches; ipatch++)
1220 unsigned nelements = 0;
1223 if (my_rank == iproc)
1225 elements = vector_of_elements_in_patch_to_send[ipatch];
1226 nelements = elements.size();
1230 comm_pt->broadcast(iproc, elements);
1236 if (my_rank == iproc)
1238 recovered_flux_coefficient_pt =
1239 vector_of_recovered_flux_coefficient_pt_to_send[ipatch];
1248 comm_pt->broadcast(iproc, mattosend);
1251 *recovered_flux_coefficient_pt = mattosend;
1254 vector_of_recovered_flux_coefficient_pt.push_back(
1255 recovered_flux_coefficient_pt);
1258 nelements = elements.size();
1260 for (
unsigned e = 0;
e < nelements;
e++)
1268 unsigned num_nod = el_pt->
nnode();
1269 for (
unsigned n = 0; n < num_nod; n++)
1276 flux_coeff_pt[nod_pt].insert(recovered_flux_coefficient_pt);
1291 int n_patches = vector_of_recovered_flux_coefficient_pt_to_send.size();
1294 for (
int ipatch = 0; ipatch < n_patches; ipatch++)
1299 elements = vector_of_elements_in_patch_to_send[ipatch];
1300 nelements = elements.size();
1304 recovered_flux_coefficient_pt =
1305 vector_of_recovered_flux_coefficient_pt_to_send[ipatch];
1307 vector_of_recovered_flux_coefficient_pt.push_back(
1308 recovered_flux_coefficient_pt);
1310 for (
int e = 0;
e < nelements;
e++)
1318 unsigned num_nod = el_pt->
nnode();
1319 for (
unsigned n = 0; n < num_nod; n++)
1325 flux_coeff_pt[nod_pt].insert(recovered_flux_coefficient_pt);
1332 #ifdef OOMPH_HAS_MPI
1337 for (IT it = adjacent_elements_pt.begin(); it != adjacent_elements_pt.end();
1342 adjacent_elements_pt.clear();
1353 unsigned n_node = mesh_pt->
nnode();
1354 for (
unsigned n = 0; n < n_node; n++)
1359 unsigned npatches = flux_coeff_pt[nod_pt].size();
1363 num_recovery_terms, num_flux_terms, 0.0);
1366 typedef std::set<DenseMatrix<double>*>::iterator IT;
1367 for (IT it = flux_coeff_pt[nod_pt].begin();
1368 it != flux_coeff_pt[nod_pt].end();
1371 for (
unsigned i = 0;
i < num_recovery_terms;
i++)
1373 for (
unsigned j = 0; j < num_flux_terms; j++)
1377 averaged_flux_coeff(
i, j) += (*(*it))(
i, j);
1389 for (
unsigned i = 0;
i < dim;
i++)
1391 x[
i] = nod_pt->
x(
i);
1399 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1401 rec_flux_map(nod_pt,
i) = 0.0;
1405 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1407 for (
unsigned icoeff = 0; icoeff < num_recovery_terms; icoeff++)
1409 rec_flux_map(nod_pt,
i) +=
1410 averaged_flux_coeff(icoeff,
i) * psi_r[icoeff];
1413 rec_flux_map(nod_pt,
i) /= double(npatches);
1420 unsigned npatch = vector_of_recovered_flux_coefficient_pt.size();
1421 for (
unsigned p = 0; p < npatch; p++)
1423 delete vector_of_recovered_flux_coefficient_pt[p];
1445 int n_compound_flux = 1;
1446 for (
unsigned e = 0;
e < nelem;
e++)
1451 #ifdef OOMPH_HAS_MPI
1460 if (n_compound_flux_el > n_compound_flux)
1462 n_compound_flux = n_compound_flux_el;
1464 #ifdef OOMPH_HAS_MPI
1472 unsigned test_count = 0;
1476 nelem, n_compound_flux, 0.0);
1479 for (
unsigned e = 0;
e < nelem;
e++)
1484 #ifdef OOMPH_HAS_MPI
1499 const unsigned n_intpt = integ_pt->
nweight();
1502 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1505 for (
unsigned i = 0;
i < dim;
i++)
1507 s[
i] = integ_pt->
knot(ipt,
i);
1511 double w = integ_pt->
weight(ipt);
1526 unsigned n_node = el_pt->
nnode();
1538 for (
unsigned n = 0; n < n_node; n++)
1543 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1545 rec_flux[
i] += rec_flux_map(nod_pt,
i) * psi[n];
1559 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1561 sum[flux_index[
i]] +=
1562 (rec_flux[
i] - fe_flux[
i]) * (rec_flux[
i] - fe_flux[
i]);
1563 sum2[flux_index[
i]] += rec_flux[
i] * rec_flux[
i];
1566 for (
unsigned i = 0;
i < n_compound_flux_el;
i++)
1569 error[
i] += sum[
i] *
W;
1571 flux_norm[
i] += sum2[
i] *
W;
1580 for (
unsigned i = 0;
i < n_compound_flux_el;
i++)
1582 elemental_compound_flux_error(
e,
i) = sqrt(error[
i]);
1585 #ifdef OOMPH_HAS_MPI
1598 #ifdef OOMPH_HAS_MPI
1605 for (
int iproc = 0; iproc < n_proc; iproc++)
1607 if (iproc != my_rank)
1613 int nelem_haloed = haloed_elem_pt.size();
1617 if (nelem_haloed != 0)
1621 int n_elem_error_haloed = nelem_haloed * n_compound_flux;
1626 for (
int e = 0;
e < nelem_haloed;
e++)
1631 haloed_elem_pt[
e])];
1633 for (
int i = 0;
i < n_compound_flux;
i++)
1635 haloed_elem_error[count] =
1636 elemental_compound_flux_error(element_num,
i);
1641 MPI_Send(&haloed_elem_error[0],
1642 n_elem_error_haloed,
1646 comm_pt->mpi_comm());
1651 for (
int send_rank = 0; send_rank < n_proc; send_rank++)
1653 if (iproc != send_rank)
1658 int nelem_halo = halo_elem_pt.size();
1661 if (nelem_halo != 0)
1665 int n_elem_error_halo = nelem_halo * n_compound_flux;
1671 MPI_Recv(&halo_elem_error[0],
1676 comm_pt->mpi_comm(),
1681 for (
int e = 0;
e < nelem_halo;
e++)
1688 for (
int i = 0;
i < n_compound_flux;
i++)
1690 elemental_compound_flux_error(element_num,
i) =
1691 halo_elem_error[count];
1720 for (
int i = 0;
i < n_compound_flux;
i++)
1728 #ifdef OOMPH_HAS_MPI
1736 MPI_Allreduce(&flux_norm[0],
1737 &total_flux_norm[0],
1741 comm_pt->mpi_comm());
1743 for (
int i = 0;
i < n_compound_flux;
i++)
1745 flux_norm[
i] = sqrt(total_flux_norm[
i]);
1750 for (
int i = 0;
i < n_compound_flux;
i++)
1752 flux_norm[
i] = sqrt(flux_norm[
i]);
1756 for (
int i = 0;
i < n_compound_flux;
i++)
1758 flux_norm[
i] = sqrt(flux_norm[
i]);
1767 for (
unsigned e = 0;
e < nelem;
e++)
1771 for (
int i = 0;
i < n_compound_flux;
i++)
1773 if (flux_norm[
i] != 0.0)
1775 normalised_compound_flux_error[
i] =
1776 elemental_compound_flux_error(
e,
i) / flux_norm[
i];
1780 normalised_compound_flux_error[
i] =
1781 elemental_compound_flux_error(
e,
i);
1786 elemental_error[
e] =
1794 mesh_pt, num_flux_terms, rec_flux_map, elemental_error, doc_info);
1804 const unsigned& num_flux_terms,
1809 #ifdef OOMPH_HAS_MPI
1827 rank_string =
"_on_proc_" + comm_pt->my_rank();
1831 std::ofstream some_file, feflux_file;
1832 std::ostringstream filename;
1834 << rank_string <<
".dat";
1835 some_file.open(filename.str().c_str());
1838 << rank_string <<
".dat";
1839 feflux_file.open(filename.str().c_str());
1841 unsigned nel = mesh_pt->
nelement();
1846 unsigned dim = el_pt->
dim();
1853 for (
unsigned e = 0;
e < nel;
e++)
1863 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
1873 unsigned n_node = el_pt->
nnode();
1885 for (
unsigned n = 0; n < n_node; n++)
1890 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1892 rec_flux[
i] += rec_flux_map(nod_pt,
i) * psi[n];
1900 for (
unsigned i = 0;
i < dim;
i++)
1902 some_file << x[
i] <<
" ";
1904 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1906 some_file << rec_flux[
i] <<
" ";
1908 some_file << elemental_error[
e] <<
" " << std::endl;
1911 for (
unsigned i = 0;
i < dim;
i++)
1913 feflux_file << x[
i] <<
" ";
1915 for (
unsigned i = 0;
i < num_flux_terms;
i++)
1917 feflux_file << fe_flux[
i] <<
" ";
1919 feflux_file << elemental_error[
e] <<
" " << std::endl;
1931 feflux_file.close();
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
virtual void lubksub(DoubleVector &rhs)
LU backsubstitution.
virtual void ludecompose()
LU decomposition using DenseLU (default linea solver)
Information for documentation of results: Directory and file number to enable output in the form RESL...
bool is_doc_enabled() const
Are we documenting?
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
virtual Node * vertex_node_pt(const unsigned &j) const =0
Pointer to the j-th vertex node in the element. Needed for efficient patch assmbly.
virtual unsigned nvertex_node() const =0
Number of vertex nodes in the element.
virtual unsigned ncompound_fluxes()
A stuitable error estimator for a multi-physics elements may require one Z2 error estimate for each f...
virtual void get_Z2_compound_flux_indices(Vector< unsigned > &flux_index)
Return the compound flux index of each flux component The default (do nothing behaviour) will mean th...
virtual void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)=0
Z2 'flux' terms for Z2 error estimation.
virtual double geometric_jacobian(const Vector< double > &x)
Return the geometric jacobian (should be overloaded in cylindrical and spherical geometries)....
virtual unsigned num_Z2_flux_terms()=0
Number of 'flux' terms for Z2 error estimation.
virtual unsigned nrecovery_order()=0
Order of recovery shape functions.
A general Finite Element class.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
1D Gaussian integration class. Two integration points. This integration scheme can integrate up to th...
1D Gaussian integration class. Three integration points. This integration scheme can integrate up to ...
1D Gaussian integration class Four integration points. This integration scheme can integrate up to se...
2D Gaussian integration class. 2x2 integration points. This integration scheme can integrate up to th...
2D Gaussian integration class. 3x3 integration points. This integration scheme can integrate up to fi...
2D Gaussian integration class. 4x4 integration points. This integration scheme can integrate up to se...
3D Gaussian integration class 2x2x2 integration points. This integration scheme can integrate up to t...
3D Gaussian integration class 3x3x3 integration points. This integration scheme can integrate up to f...
3D Gaussian integration class. 4x4x4 integration points. This integration scheme can integrate up to ...
bool is_halo() const
Is this element a halo?
Generic class for numerical integration schemes:
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
static bool mpi_has_been_initialised()
return true if MPI has been initialised
static OomphCommunicator * communicator_pt()
access to global communicator. This is the oomph-lib equivalent of MPI_COMM_WORLD
MapMatrixMixed is a generalised, STL-map-based, sparse(ish) matrix class with mixed indices.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nnode() const
Return number of nodes in the mesh.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
unsigned long nelement() const
Return number of elements in the mesh.
Vector< GeneralisedElement * > halo_element_pt(const unsigned &p)
Return vector of halo elements in this Mesh whose non-halo counterpart is held on processor p.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
1D Gaussian integration class for linear "triangular" elements. Two integration points....
1D Gaussian integration class for quadratic "triangular" elements. Three integration points....
1D Gaussian integration class for cubic "triangular" elements. Four integration points....
2D Gaussian integration class for linear triangles. Three integration points. This integration scheme...
2D Gaussian integration class for quadratic triangles. Seven integration points. This integration sch...
2D Gaussian integration class for cubic triangles. Thirteen integration points. This integration sche...
3D Gaussian integration class for tets. Four integration points. This integration scheme can integrat...
3D Gaussian integration class for tets. Eleven integration points. This integration scheme can integr...
3D Gaussian integration class for tets. 45 integration points. This integration scheme can integrate ...
void get_recovered_flux_in_patch(const Vector< ElementWithZ2ErrorEstimator * > &patch_el_pt, const unsigned &num_recovery_terms, const unsigned &num_flux_terms, const unsigned &dim, DenseMatrix< double > *&recovered_flux_coefficient_pt)
Given the vector of elements that make up a patch, the number of recovery and flux terms,...
unsigned nrecovery_terms(const unsigned &dim)
Return number of coefficients for expansion of recovered fluxes for given spatial dimension of elemen...
CombinedErrorEstimateFctPt Combined_error_fct_pt
Function pointer to combined error estimator function.
double get_combined_error_estimate(const Vector< double > &compound_error)
Return a combined error estimate from all compound errors.
void setup_patches(Mesh *&mesh_pt, std::map< Node *, Vector< ElementWithZ2ErrorEstimator * > * > &adjacent_elements_pt, Vector< Node * > &vertex_node_pt)
Setup patches: For each vertex node pointed to by nod_pt, adjacent_elements_pt[nod_pt] contains the p...
unsigned Recovery_order
Order of recovery polynomials.
double Reference_flux_norm
Prescribed reference flux norm.
void get_element_errors(Mesh *&mesh_pt, Vector< double > &elemental_error)
Compute the elemental error measures for a given mesh and store them in a vector.
void shape_rec(const Vector< double > &x, const unsigned &dim, Vector< double > &psi_r)
Recovery shape functions as functions of the global, Eulerian coordinate x of dimension dim....
Integral * integral_rec(const unsigned &dim, const bool &is_q_mesh)
Integation scheme associated with the recovery shape functions must be of sufficiently high order to ...
void doc_flux(Mesh *mesh_pt, const unsigned &num_flux_terms, MapMatrixMixed< Node *, int, double > &rec_flux_map, const Vector< double > &elemental_error, DocInfo &doc_info)
Doc flux and recovered flux.
unsigned & recovery_order()
Access function for order of recovery polynomials.
bool Recovery_order_from_first_element
Bool to indicate if recovery order is to be read out from first element in mesh or set globally.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...