27#ifndef OOMPH_MESH_SMOOTH_HEADER
28#define OOMPH_MESH_SMOOTH_HEADER
33#include "../linear_elasticity/elasticity_tensor.h"
34#include "../constitutive/constitutive_laws.h"
35#include "../solid/solid_traction_elements.h"
43 namespace Helper_namespace_for_mesh_smoothing
96 template<
class ELEMENT>
164 for (
unsigned j = 0;
j <
nnod;
j++)
168 for (
unsigned i = 0;
i < dim;
i++)
188 for (
unsigned i = 0;
i <
n;
i++)
217 el_pt->set_boundary_number_in_bulk_mesh(b);
229 for (
unsigned i = 0;
i <
n;
i++)
262 el_pt->set_boundary_shape_geom_object_pt(
274 oomph_info <<
"Number of equations for nonlinear smoothing problem: "
287 el_pt->constitutive_law_pt() =
354 oomph_info <<
"Done with Helper_namespace_for_mesh_smoothing::Scale="
358 for (
unsigned j = 0;
j < nnode;
j++)
365 for (
unsigned i = 0;
i < dim;
i++)
377 for (
unsigned i = 0;
i <
n;
i++)
397 oomph_info <<
"Solving nonlinear smoothing problem for scale "
400 for (
unsigned j = 0;
j <
nnod;
j++)
404 for (
unsigned i = 0;
i < dim;
i++)
420 for (
unsigned j = 0;
j <
nnod;
j++)
425 for (
unsigned i = 0;
i < dim;
i++)
438 for (
unsigned j = 0;
j <
nnod;
j++)
442 for (
unsigned i = 0;
i < dim;
i++)
474 << doc_info.
number() <<
".dat";
522 template<
class LINEAR_ELASTICITY_ELEMENT>
540 for (
unsigned e = 0;
e <
nelem;
e++)
547 el_pt->elasticity_tensor_pt() =
556 for (
unsigned j = 0;
j <
nnod;
j++)
566 for (
unsigned i = 0;
i < dim;
i++)
590 unsigned dim = (*it)->
ndim();
591 for (
unsigned i = 0;
i < dim;
i++)
601 oomph_info <<
"Number of equations for smoothing problem: "
609 for (
unsigned j = 0;
j < nnode;
j++)
617 for (
unsigned i = 0;
i < dim;
i++)
657 template<
class POISSON_ELEMENT>
675 for (
unsigned e = 0;
e <
nelem;
e++)
685 for (
unsigned j = 0;
j <
nnod;
j++)
695 for (
unsigned i = 0;
i < dim;
i++)
721 oomph_info <<
"Number of equations for Poisson displacement smoothing: "
726 for (
unsigned i = 0;
i < dim;
i++)
729 for (
unsigned j = 0;
j < nnode;
j++)
743 for (
unsigned j = 0;
j < nnode;
j++)
A class for constitutive laws for elements that solve the equations of solid mechanics based upon the...
Information for documentation of results: Directory and file number to enable output in the form RESL...
bool is_doc_enabled() const
Are we documenting?
void disable_doc()
Disable documentation.
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
unsigned nnode() const
Return the number of nodes.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Class for a "non-rational" extension of classical linear elasticity to large displacements:
unsigned ndim() const
Access function to # of Eulerian coordinates.
An isotropic elasticity tensor defined in terms of Young's modulus and Poisson's ratio....
Auxiliary Problem to smooth a SolidMesh by adjusting the internal nodal positions by solving a LINEAR...
void operator()(SolidMesh *orig_mesh_pt, std::set< Node * > pinned_nodes)
Constructor: Specify SolidMesh whose nodal positions are to be adjusted, and set of nodes in that mes...
~LinearElasticitySmoothMesh()
Destructor (empty)
This class provides a GeomObject representation of a given finite element mesh. The Lagrangian coordi...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
For the e-th finite element on boundary b, return int to indicate the face_index of the face adjacent...
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
void check_inverted_elements(bool &mesh_has_inverted_elements, std::ofstream &inverted_element_file)
Check for inverted elements and report outcome in boolean variable. This visits all elements at their...
unsigned long nnode() const
Return number of nodes in the mesh.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
void output(std::ostream &outfile)
Output for all elements.
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
unsigned long nelement() const
Return number of elements in the mesh.
A class to handle errors in the Newton solver.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Auxiliary Problem to smooth a SolidMesh by adjusting the internal nodal positions via the solution of...
void backup()
Backup nodal positions in dummy mesh to allow for reset after non-convergence of Newton method.
void operator()(SolidMesh *orig_mesh_pt, SolidMesh *copy_of_mesh_pt, const Vector< unsigned > &controlled_boundary_id, const unsigned &max_steps=100000000)
Functor to update the nodal positions in SolidMesh pointed to by orig_mesh_pt in response to the disp...
Vector< Vector< double > > Orig_node_pos
Original nodal positions.
SolidMesh * Orig_mesh_pt
Bulk original mesh.
SolidMesh * Dummy_mesh_pt
Copy of mesh to work on.
void operator()(SolidMesh *orig_mesh_pt, SolidMesh *copy_of_mesh_pt, const Vector< unsigned > &controlled_boundary_id, DocInfo doc_info, const unsigned &max_steps=100000000)
Functor to update the nodal positions in SolidMesh pointed to by orig_mesh_pt in response to the disp...
void doc_solution(DocInfo &doc_info)
Doc the solution.
Vector< Vector< double > > Backup_node_pos
Backup nodal positions.
void actions_before_newton_solve()
Update nodal positions in main mesh – also moves the nodes of the FaceElements that impose the new po...
void reset()
Reset nodal positions in dummy mesh to allow for restart of Newton method with reduced increment in S...
~NonLinearElasticitySmoothMesh()
Destructor (empty)
Functor to smooth a SolidMesh by adjusting the internal nodal positions by solving a Poisson problem ...
void operator()(SolidMesh *orig_mesh_pt, std::set< Node * > pinned_nodes)
Functor: Specify SolidMesh whose nodal positions are to be adjusted, and set of nodes in that mesh wh...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
unsigned add_sub_mesh(Mesh *const &mesh_pt)
Add a submesh to the problem and return its number, i, by which it can be accessed via mesh_pt(i).
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Assign all equation numbers for problem: Deals with global data (= data that isn't attached to any el...
void build_global_mesh()
Build the global mesh by combining the all the submeshes. Note: The nodes boundary information refers...
void newton_solve()
Use Newton method to solve the problem.
Mesh *& mesh_pt()
Return a pointer to the global mesh.
SolidFiniteElement class.
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
double & xi(const unsigned &i)
Reference to i-th Lagrangian position.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
ConstitutiveLaw * Constitutive_law_pt
Create constitutive law (for smoothing by nonlinear elasticity)
double Scale
Scale for displacement of quadratic boundary (0.0: simplex; 1.0: quadratic)
double Nu
Poisson's ratio (for smoothing by linear or nonlinear elasticity)
double E
Young's modulus (for smoothing by linear or nonlinear elasticity)
double Scale_increment
Increment for scale factor for displacement of quadratic boundary.
IsotropicElasticityTensor Isotropic_elasticity_tensor(Nu)
The elasticity tensor (for smoothing by linear elasticity)
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...