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;
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;
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;
226 error_stream <<
"No recovery shape functions for dim " << dim
305 error_stream <<
"Recovery shape functions for recovery order "
307 <<
" haven't yet been implemented for 1D" << std::endl;
364 error_stream <<
"Recovery shape functions for recovery order "
366 <<
" haven't yet been implemented for 2D" << std::endl;
423 error_stream <<
"Recovery shape functions for recovery order "
425 <<
" haven't yet been implemented for 3D" << std::endl;
439 error_stream <<
"No recovery shape functions for dim " << dim
476 "No compound errors have been passed, so maximum cannot be found.",
548 std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>
561 for (
unsigned e = 0;
e <
nelem;
e++)
576 for (
unsigned n = 0;
n <
nnod;
n++)
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++)
629 vertex_node_pt.push_back(
nod_pt);
637 for (
unsigned e = 0;
e <
nel;
e++)
648 typedef std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>::iterator
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++)
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";
992 "Element needs to inherit from ElementWithZ2ErrorEstimator!",
1027 comm_pt->mpi_comm());
1035 comm_pt->mpi_comm());
1059 "Element needs to inherit from ElementWithZ2ErrorEstimator!",
1095 std::map<Node*, std::set<DenseMatrix<double>*>>
flux_coeff_pt;
1101 typedef std::map<Node*, Vector<ElementWithZ2ErrorEstimator*>*>::iterator
IT;
1108 std::map<ElementWithZ2ErrorEstimator*, int>
elem_num;
1110 for (
unsigned e = 0;
e <
nelem;
e++)
1170 for (
unsigned e = 0;
e <
nelem;
e++)
1367 typedef std::set<DenseMatrix<double>*>::iterator
IT;
1390 for (
unsigned i = 0;
i < dim;
i++)
1447 for (
unsigned e = 0;
e <
nelem;
e++)
1480 for (
unsigned e = 0;
e <
nelem;
e++)
1506 for (
unsigned i = 0;
i < dim;
i++)
1562 sum[flux_index[
i]] +=
1647 comm_pt->mpi_comm());
1677 comm_pt->mpi_comm(),
1742 comm_pt->mpi_comm());
1768 for (
unsigned e = 0;
e <
nelem;
e++)
1829 std::string(
"_on_proc_") + std::to_string(comm_pt->my_rank());
1855 for (
unsigned e = 0;
e <
nel;
e++)
1902 for (
unsigned i = 0;
i < dim;
i++)
1913 for (
unsigned i = 0;
i < dim;
i++)
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
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 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 double geometric_jacobian(const Vector< double > &x)
Return the geometric jacobian (should be overloaded in cylindrical and spherical geometries)....
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.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
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.
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")
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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"...
bool is_halo() const
Is this element a halo?
Generic class for numerical integration schemes:
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
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
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.
unsigned long nnode() const
Return number of nodes in the mesh.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
unsigned long nelement() const
Return number of elements in the mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Standard flux.from AdvectionDiffusionReaction equations.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Empty base class for Telements (created so that we can use dynamic_cast<>() to figure out if a an ele...
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 & recovery_order()
Access function for order of recovery polynomials.
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.
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.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...