libMesh
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | Friends | List of all members
Biharmonic Class Reference

The Biharmonic class encapsulates most of the data structures necessary to calculate the biharmonic residual and Jacobian, auxiliary quantities, to take a timestep, and to output the state – biharmonic solution and vectors of auxiliary quantities. More...

#include <biharmonic.h>

Inheritance diagram for Biharmonic:
[legend]

Classes

class  JR
 Biharmonic's friend class definition. More...
 

Public Types

enum  InitialStateEnum { STRIP = 0, ROD = 1, BALL = 2 }
 
enum  FreeEnergyEnum { DOUBLE_WELL = 1, DOUBLE_OBSTACLE = 2, LOG_DOUBLE_WELL = 3, LOG_DOUBLE_OBSTACLE = 4 }
 
enum  ReadFlags {
  READ_HEADER = 1, READ_DATA = 2, READ_ADDITIONAL_DATA = 4, READ_LEGACY_FORMAT = 8,
  TRY_READ_IFEMS = 16, READ_BASIC_ONLY = 32
}
 Define enumeration to set properties in EquationSystems::read() More...
 
enum  WriteFlags { WRITE_DATA = 1, WRITE_ADDITIONAL_DATA = 2, WRITE_PARALLEL_FILES = 4, WRITE_SERIAL_FILES = 8 }
 Define enumeration to set properties in EquationSystems::write() More...
 

Public Member Functions

 Biharmonic (ReplicatedMesh &mesh)
 Constructor retrieves command-line options, setting defaults, if necessary. More...
 
 ~Biharmonic ()
 Destructor. More...
 
bool verbose ()
 
Real dt0 ()
 
Real dt ()
 
void viewParameters ()
 
void init ()
 Initialize all the systems. More...
 
void step (const Real &dt=-1.0)
 
void output (int timestep, const Real &t, Real &o_t, bool force=false)
 
void run ()
 
virtual void clear ()
 Restores the data structure to a pristine state. More...
 
virtual void reinit ()
 Reinitialize all the systems. More...
 
void update ()
 Updates local values for all the systems. More...
 
unsigned int n_systems () const
 
bool has_system (const std::string &name) const
 
template<typename T_sys >
const T_sys & get_system (const std::string &name) const
 
template<typename T_sys >
T_sys & get_system (const std::string &name)
 
template<typename T_sys >
const T_sys & get_system (const unsigned int num) const
 
template<typename T_sys >
T_sys & get_system (const unsigned int num)
 
const System & get_system (const std::string &name) const
 
System & get_system (const std::string &name)
 
const System & get_system (const unsigned int num) const
 
System & get_system (const unsigned int num)
 
virtual System & add_system (const std::string &system_type, const std::string &name)
 Add the system of type system_type named name to the systems array. More...
 
template<typename T_sys >
T_sys & add_system (const std::string &name)
 Add the system named name to the systems array. More...
 
void delete_system (const std::string &name)
 Remove the system named name from the systems array. More...
 
unsigned int n_vars () const
 
std::size_t n_dofs () const
 
std::size_t n_active_dofs () const
 
virtual void solve ()
 Call solve on all the individual equation systems. More...
 
virtual void adjoint_solve (const QoISet &qoi_indices=QoISet())
 Call adjoint_solve on all the individual equation systems. More...
 
virtual void sensitivity_solve (const ParameterVector &parameters)
 Call sensitivity_solve on all the individual equation systems. More...
 
void build_variable_names (std::vector< std::string > &var_names, const FEType *type=libmesh_nullptr, const std::set< std::string > *system_names=libmesh_nullptr) const
 Fill the input vector var_names with the names of the variables for each system. More...
 
void build_solution_vector (std::vector< Number > &soln, const std::string &system_name, const std::string &variable_name="all_vars") const
 Fill the input vector soln with the solution values for the system named name. More...
 
void build_solution_vector (std::vector< Number > &soln, const std::set< std::string > *system_names=libmesh_nullptr) const
 Fill the input vector soln with solution values. More...
 
UniquePtr< NumericVector< Number > > build_parallel_solution_vector (const std::set< std::string > *system_names=libmesh_nullptr) const
 A version of build_solution_vector which is appropriate for "parallel" output formats like Nemesis. More...
 
void get_solution (std::vector< Number > &soln, std::vector< std::string > &names) const
 Retrieve the solution data for CONSTANT MONOMIALs. More...
 
void build_discontinuous_solution_vector (std::vector< Number > &soln, const std::set< std::string > *system_names=libmesh_nullptr) const
 Fill the input vector soln with solution values. More...
 
template<typename InValType >
void read (const std::string &name, const XdrMODE, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
 Read & initialize the systems from disk using the XDR data format. More...
 
void read (const std::string &name, const XdrMODE mode, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
 
template<typename InValType >
void read (const std::string &name, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
 
void read (const std::string &name, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
 
void write (const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
 Write the systems to disk using the XDR data format. More...
 
void write (const std::string &name, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
 
virtual bool compare (const EquationSystems &other_es, const Real threshold, const bool verbose) const
 
virtual std::string get_info () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints information about the equation systems, by default to libMesh::out. More...
 
const MeshBase & get_mesh () const
 
MeshBase & get_mesh ()
 
void allgather ()
 Serializes a distributed mesh and its associated degree of freedom numbering for all systems. More...
 
void enable_refine_in_reinit ()
 Calls to reinit() will also do two-step coarsen-then-refine. More...
 
void disable_refine_in_reinit ()
 Calls to reinit() will not try to coarsen or refine the mesh. More...
 
bool refine_in_reinit_flag ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

Parameters parameters
 Data structure holding arbitrary parameters. More...
 

Protected Types

typedef std::map< std::string, System * >::iterator system_iterator
 Typedef for system iterators. More...
 
typedef std::map< std::string, System * >::const_iterator const_system_iterator
 Typedef for constant system iterators. More...
 
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

std::map< std::string, System * > _systems
 Data structure holding the systems. More...
 
bool _refine_in_reinit
 Flag for whether to call coarsen/refine in reinit(). More...
 
const Parallel::Communicator & _communicator
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Private Attributes

unsigned int _dim
 
unsigned int _N
 
Real _kappa
 
Real _theta
 
Real _theta_c
 
Real _tol
 
bool _growth
 
bool _degenerate
 
bool _cahn_hillard
 
bool _netforce
 
FreeEnergyEnum _energy
 
int _log_truncation
 
bool _verbose
 
InitialStateEnum _initialState
 
Point _initialCenter
 
Real _initialWidth
 
Real _dt0
 
Real _dt
 
Real _t0
 
Real _T
 
Real _t1
 
Real _cnWeight
 
std::string _ofile_base
 
std::string _ofile
 
UniquePtr< ExodusII_IO_exio
 
Real _o_dt
 
int _o_count
 
ReplicatedMesh_mesh
 
JR_jr
 

Friends

class JR
 

Detailed Description

The Biharmonic class encapsulates most of the data structures necessary to calculate the biharmonic residual and Jacobian, auxiliary quantities, to take a timestep, and to output the state – biharmonic solution and vectors of auxiliary quantities.

The main reason for this design is to have a data structure that has all of the necessary data in one place, where all of the calculation subroutines can access these data. Currently these data are split up among several interdependent objects with no clear hierarchy between them: mesh, equation system, equation system bundle, residual/Jacobian calculator.

Since no object contains all others and the data are distributed among many objects, the natural control and data flow resides outside of these objects and is typically implemented in main(). We, however, would like to split the calculation into natural chunks – subroutines – while retaining these subroutines access to the common necessary data – biharmonic parameters, mesh and time interval sizes, etc. Thus, class Biharmonic. Finally, making Biharmonic inherit from EquationSystems makes it possible to include it in the most common callbacks that do not pass back a user context, but only an EquationSystems object.

Definition at line 46 of file biharmonic.h.

Member Typedef Documentation

typedef std::map<std::string, System *>::const_iterator libMesh::EquationSystems::const_system_iterator
protectedinherited

Typedef for constant system iterators.

Definition at line 491 of file equation_systems.h.

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

typedef std::map<std::string, System *>::iterator libMesh::EquationSystems::system_iterator
protectedinherited

Typedef for system iterators.

Definition at line 486 of file equation_systems.h.

Member Enumeration Documentation

Enumerator
DOUBLE_WELL 
DOUBLE_OBSTACLE 
LOG_DOUBLE_WELL 
LOG_DOUBLE_OBSTACLE 

Definition at line 55 of file biharmonic.h.

Enumerator
STRIP 
ROD 
BALL 

Definition at line 50 of file biharmonic.h.

50  {STRIP = 0,
51  ROD = 1,
52  BALL = 2};

Define enumeration to set properties in EquationSystems::read()

Enumerator
READ_HEADER 
READ_DATA 
READ_ADDITIONAL_DATA 
READ_LEGACY_FORMAT 
TRY_READ_IFEMS 
READ_BASIC_ONLY 

Definition at line 75 of file equation_systems.h.

Define enumeration to set properties in EquationSystems::write()

Enumerator
WRITE_DATA 
WRITE_ADDITIONAL_DATA 
WRITE_PARALLEL_FILES 
WRITE_SERIAL_FILES 

Definition at line 85 of file equation_systems.h.

Constructor & Destructor Documentation

Biharmonic::Biharmonic ( ReplicatedMesh mesh)

Constructor retrieves command-line options, setting defaults, if necessary.

It then builds the mesh using these options, then the equations systems around it, and, finally, sets up the output. We recommend that this be used through the factory Create function, which allocates the mesh. In that case don't forget to call Destroy at the end, to free the mesh up.

Definition at line 13 of file biharmonic.C.

References _cahn_hillard, _cnWeight, _degenerate, _dim, _dt0, _energy, _exio, _growth, _initialCenter, _initialState, _initialWidth, _jr, _kappa, _log_truncation, _mesh, _N, _netforce, _o_dt, _ofile, _ofile_base, _T, _t0, _t1, _theta, _theta_c, _tol, _verbose, BALL, libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_line(), libMesh::MeshTools::Generation::build_square(), libMesh::command_line_value(), libMesh::command_line_vector(), DOUBLE_OBSTACLE, DOUBLE_WELL, libMesh::EDGE2, libMesh::HEX8, LOG_DOUBLE_OBSTACLE, LOG_DOUBLE_WELL, libMesh::on_command_line(), libMesh::out, libMesh::QUAD4, ROD, and STRIP.

13  :
14  EquationSystems(mesh),
15  _mesh(mesh)
16 {
17  // Retrieve parameters and set defaults
18  _verbose = false;
19  _growth = false;
20  _degenerate = false;
21  _cahn_hillard = false;
22  _netforce = false;
23 
24  if (on_command_line("--verbose"))
25  _verbose = true;
26  if (on_command_line("--growth"))
27  _growth = true;
28  if (on_command_line("--degenerate"))
29  _degenerate = true;
30  if (on_command_line("--cahn_hillard"))
31  _cahn_hillard = true;
32  if (on_command_line("--netforce"))
33  _netforce = true;
34 
35  _kappa = command_line_value("kappa", 1.0);
36 
37  // "type of energy (double well, double obstacle, logarithmic+double well, logarithmic+double obstacle)"
38  std::string energy = command_line_value("energy", std::string("double_well"));
39 
40  if (energy == "double_well")
42  else if (energy == "double_obstacle")
44  else if (energy == "log_double_well")
46  else if (energy == "log_double_obstacle")
48  else
49  libmesh_error_msg("Unknown energy type: " << energy);
50 
51  _tol = command_line_value("tol", 1.0e-8);
52  _theta = command_line_value("theta", .001);
53  _theta_c = command_line_value("theta_c", 1.0);
54 
55  // "order of log truncation (0=none, 2=quadratic, 3=cubic)"
56  _log_truncation = command_line_value("log_truncation", 2);
57 
58  if (!_log_truncation)
59  libMesh::out << "WARNING: no truncation is being used for the logarithmic free energy term.\nWARNING: division by zero possible!\n";
60 
61 
62  // Dimension
63  _dim = command_line_value("dim", 1);
64 
65  libmesh_assert_msg((_dim <= 3) && (_dim > 0), "Invalid mesh dimension");
66 
67  // Build the mesh
68  // Yes, it's better to make a coarse mesh and then refine it. We'll get to it later.
69  _N = command_line_value("N", 8);
70  libmesh_assert_msg(_N > 0, "Invalid mesh size");
71 
72  switch (_dim)
73  {
74  case 1:
76  break;
77  case 2:
78  MeshTools::Generation::build_square(_mesh, _N, _N, 0.0, 1.0, 0.0, 1.0, QUAD4);
79  break;
80  case 3:
81  MeshTools::Generation::build_cube(_mesh, _N, _N, _N, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, HEX8);
82  break;
83  default:
84  libmesh_assert_msg((_dim <= 3) && (_dim > 0), "Invalid mesh dimension");
85  break;
86  }
87 
88  // Determine the initial timestep size
89  _dt0 = command_line_value("dt", 1.0/(10*_kappa*_N*_N*_N*_N));
90  libmesh_assert_msg(_dt0>=0, "Negative initial timestep");
91 
92  _t0 = command_line_value("min_time", 0.0);
93  _t1 = command_line_value("max_time", _t0 + 50.0*_dt0);
94  libmesh_assert_msg(_t1 >= _t0, "Final time less than initial time");
95  _T = _t1 - _t0;
96 
97  _cnWeight = command_line_value("crank_nicholson_weight", 1.0);
98  libmesh_assert_msg(_cnWeight <= 1 && _cnWeight >= 0, "Crank-Nicholson weight must be between 0 and 1");
99 
100  // Initial state
102  std::string initialState = command_line_value("initial_state", std::string("strip"));
103 
104  if (initialState == std::string("ball"))
106  else if (initialState == std::string("strip"))
108  else if (initialState == std::string("rod"))
109  _initialState = ROD;
110  else
111  libmesh_error_msg("Unknown initial state: neither ball nor rod nor strip");
112 
113  std::vector<Real> icenter;
114  command_line_vector("initial_center", icenter);
115 
116  // Check that the point defining the center was in the right spatial dimension
117  if (icenter.size() > _dim)
118  libmesh_assert_msg(icenter.size() > _dim, "Invalid dimension for the initial state center of mass");
119 
120  // Pad
121  icenter.resize(3);
122  for (std::size_t i = icenter.size(); i < _dim; ++i)
123  icenter[i] = 0.5;
124 
125  for (unsigned int i = _dim; i < 3; ++i)
126  icenter[i] = 0.0;
127 
128  _initialCenter = Point(icenter[0], icenter[1], icenter[2]);
129  _initialWidth = command_line_value("initial_width", 0.125);
130 
131  // Build the main equation encapsulated in the JR (Jacobian-Residual or J(R) "jet of R") object
132  _jr = &(add_system<Biharmonic::JR>(std::string("Biharmonic::JR")));
133 
134  // Output options
135 #ifdef LIBMESH_HAVE_EXODUS_API
136  if (on_command_line("output_base"))
137  _ofile_base = command_line_value("output_base", std::string("bih"));
138 
139  else
140  {
141  switch(_dim)
142  {
143  case 1:
144  _ofile_base = std::string("bih.1");
145  break;
146  case 2:
147  _ofile_base = std::string("bih.2");
148  break;
149  case 3:
150  _ofile_base = std::string("bih.3");
151  break;
152  default:
153  _ofile_base = std::string("bih");
154  break;
155  }
156  }
157  _ofile = _ofile_base + ".e";
158  _exio.reset(new ExodusII_IO(_mesh));
159  _o_dt = command_line_value("output_dt", 0.0);
160 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
161 } // constructor
EquationSystems(MeshBase &mesh)
Constructor.
std::string _ofile
Definition: biharmonic.h:106
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
Definition: exodusII_io.h:52
bool _verbose
Definition: biharmonic.h:99
Real _cnWeight
Definition: biharmonic.h:104
Real _kappa
Definition: biharmonic.h:94
Real _theta_c
Definition: biharmonic.h:94
void build_square(UnstructuredMesh &mesh, const unsigned int nx, const unsigned int ny, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
A specialized build_cube() for 2D meshes.
Point _initialCenter
Definition: biharmonic.h:101
Real _tol
Definition: biharmonic.h:95
bool _netforce
Definition: biharmonic.h:96
bool _cahn_hillard
Definition: biharmonic.h:96
T command_line_value(const std::string &, T)
Definition: libmesh.C:932
FreeEnergyEnum _energy
Definition: biharmonic.h:97
int _log_truncation
Definition: biharmonic.h:98
unsigned int _dim
Definition: biharmonic.h:93
Real _initialWidth
Definition: biharmonic.h:102
void command_line_vector(const std::string &, std::vector< T > &)
Definition: libmesh.C:978
bool on_command_line(const std::string &arg)
Definition: libmesh.C:921
OStreamProxy out
bool _growth
Definition: biharmonic.h:96
void build_line(UnstructuredMesh &mesh, const unsigned int nx, const Real xmin=0., const Real xmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
A specialized build_cube() for 1D meshes.
Real _o_dt
Definition: biharmonic.h:108
unsigned int _N
Definition: biharmonic.h:93
UniquePtr< ExodusII_IO > _exio
Definition: biharmonic.h:107
ReplicatedMesh & _mesh
Definition: biharmonic.h:112
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
std::string _ofile_base
Definition: biharmonic.h:106
InitialStateEnum _initialState
Definition: biharmonic.h:100
void build_cube(UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
Builds a (elements) cube.
Real _theta
Definition: biharmonic.h:94
bool _degenerate
Definition: biharmonic.h:96
Biharmonic::~Biharmonic ( )

Destructor.

Definition at line 73 of file biharmonic.h.

74  {
75  // delete _meshRefinement;
76  }

Member Function Documentation

System & libMesh::EquationSystems::add_system ( const std::string &  system_type,
const std::string &  name 
)
virtualinherited

Add the system of type system_type named name to the systems array.

Definition at line 315 of file equation_systems.C.

References libMesh::EquationSystems::_systems, libMesh::EquationSystems::get_system(), and libMesh::Quality::name().

Referenced by libMesh::EquationSystems::_read_impl(), assemble_and_solve(), build_system(), libMesh::RBEIMConstruction::init_data(), main(), libMesh::ErrorVector::plot_error(), TimeSolverTestImplementation< NewmarkSolver >::run_test_with_exact_soln(), setup(), FETest< order, family, elem_type >::setUp(), SlitMeshRefinedSystemTest::setUp(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), EquationSystemsTest::testAddSystem(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MixedDimensionMeshTest::testDofOrdering(), MixedDimensionRefinedMeshTest::testDofOrdering(), MixedDimensionNonUniformRefinement::testDofOrdering(), MixedDimensionNonUniformRefinementTriangle::testDofOrdering(), MixedDimensionNonUniformRefinement3D::testDofOrdering(), DofMapTest::testDofOwner(), EquationSystemsTest::testInit(), EquationSystemsTest::testPostInitAddElem(), EquationSystemsTest::testPostInitAddRealSystem(), EquationSystemsTest::testPostInitAddSystem(), SystemsTest::testProjectCube(), SystemsTest::testProjectCubeWithMeshFunction(), SystemsTest::testProjectLine(), SystemsTest::testProjectSquare(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), and WriteVecAndScalar::testWrite().

317 {
318  // If the user already built a system with this name, we'll
319  // trust them and we'll use it. That way they can pre-add
320  // non-standard derived system classes, and if their restart file
321  // has some non-standard sys_type we won't throw an error.
322  if (_systems.count(name))
323  {
324  return this->get_system(name);
325  }
326  // Build a basic System
327  else if (sys_type == "Basic")
328  this->add_system<System> (name);
329 
330  // Build a Newmark system
331  else if (sys_type == "Newmark")
332  this->add_system<NewmarkSystem> (name);
333 
334  // Build an Explicit system
335  else if ((sys_type == "Explicit"))
336  this->add_system<ExplicitSystem> (name);
337 
338  // Build an Implicit system
339  else if ((sys_type == "Implicit") ||
340  (sys_type == "Steady" ))
341  this->add_system<ImplicitSystem> (name);
342 
343  // build a transient implicit linear system
344  else if ((sys_type == "Transient") ||
345  (sys_type == "TransientImplicit") ||
346  (sys_type == "TransientLinearImplicit"))
347  this->add_system<TransientLinearImplicitSystem> (name);
348 
349  // build a transient implicit nonlinear system
350  else if (sys_type == "TransientNonlinearImplicit")
351  this->add_system<TransientNonlinearImplicitSystem> (name);
352 
353  // build a transient explicit system
354  else if (sys_type == "TransientExplicit")
355  this->add_system<TransientExplicitSystem> (name);
356 
357  // build a linear implicit system
358  else if (sys_type == "LinearImplicit")
359  this->add_system<LinearImplicitSystem> (name);
360 
361  // build a nonlinear implicit system
362  else if (sys_type == "NonlinearImplicit")
363  this->add_system<NonlinearImplicitSystem> (name);
364 
365  // build a Reduced Basis Construction system
366  else if (sys_type == "RBConstruction")
367  this->add_system<RBConstruction> (name);
368 
369  // build a transient Reduced Basis Construction system
370  else if (sys_type == "TransientRBConstruction")
371  this->add_system<TransientRBConstruction> (name);
372 
373 #ifdef LIBMESH_HAVE_SLEPC
374  // build an eigen system
375  else if (sys_type == "Eigen")
376  this->add_system<EigenSystem> (name);
377  else if (sys_type == "TransientEigenSystem")
378  this->add_system<TransientEigenSystem> (name);
379 #endif
380 
381 #if defined(LIBMESH_USE_COMPLEX_NUMBERS)
382  // build a frequency system
383  else if (sys_type == "Frequency")
384  this->add_system<FrequencySystem> (name);
385 #endif
386 
387  else
388  libmesh_error_msg("ERROR: Unknown system type: " << sys_type);
389 
390  // Return a reference to the new system
391  //return (*this)(name);
392  return this->get_system(name);
393 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
const T_sys & get_system(const std::string &name) const
std::map< std::string, System * > _systems
Data structure holding the systems.
template<typename T_sys >
T_sys & libMesh::EquationSystems::add_system ( const std::string &  name)
inherited

Add the system named name to the systems array.

Definition at line 560 of file equation_systems.h.

References libMesh::EquationSystems::_add_system_to_nodes_and_elems(), libMesh::EquationSystems::_systems, libmesh_nullptr, libMesh::EquationSystems::n_systems(), and libMesh::Quality::name().

561 {
562  T_sys * ptr = libmesh_nullptr;
563 
564  if (!_systems.count(name))
565  {
566  ptr = new T_sys(*this, name, this->n_systems());
567 
568  _systems.insert (std::make_pair(name, ptr));
569 
570  // Tell all the \p DofObject entities to add a system.
572  }
573  else
574  {
575  // We now allow redundant add_system calls, to make it
576  // easier to load data from files for user-derived system
577  // subclasses
578  ptr = &(this->get_system<T_sys>(name));
579  }
580 
581  // Return a dynamically casted reference to the newly added System.
582  return *ptr;
583 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
const class libmesh_nullptr_t libmesh_nullptr
unsigned int n_systems() const
void _add_system_to_nodes_and_elems()
This function is used in the implementation of add_system, it loops over the nodes and elements of th...
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::EquationSystems::adjoint_solve ( const QoISet qoi_indices = QoISet())
virtualinherited

Call adjoint_solve on all the individual equation systems.

By default this function solves each system's adjoint once, in the reverse order from that in which they were added. For more sophisticated decoupled problems the user may with to override this behavior in a derived class.

Definition at line 436 of file equation_systems.C.

References libMesh::EquationSystems::get_system(), libMesh::libmesh_assert(), and libMesh::EquationSystems::n_systems().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error().

437 {
438  libmesh_assert (this->n_systems());
439 
440  for (unsigned int i=this->n_systems(); i != 0; --i)
441  this->get_system(i-1).adjoint_solve(qoi_indices);
442 }
libmesh_assert(j)
unsigned int n_systems() const
const T_sys & get_system(const std::string &name) const
void libMesh::EquationSystems::allgather ( )
inherited

Serializes a distributed mesh and its associated degree of freedom numbering for all systems.

Definition at line 265 of file equation_systems.C.

References libMesh::EquationSystems::_mesh, libMesh::MeshBase::allgather(), libMesh::DofMap::distribute_dofs(), libMesh::MeshBase::element_ptr_range(), libMesh::System::get_dof_map(), libMesh::EquationSystems::get_system(), libMesh::MeshBase::is_serial(), libMesh::EquationSystems::n_systems(), libMesh::MeshBase::node_ptr_range(), libMesh::DofMap::prepare_send_list(), libMesh::System::reinit_constraints(), and libMesh::sys.

Referenced by libMesh::EquationSystems::read().

266 {
267  // A serial mesh means nothing needs to be done
268  if (_mesh.is_serial())
269  return;
270 
271  const unsigned int n_sys = this->n_systems();
272 
273  libmesh_assert_not_equal_to (n_sys, 0);
274 
275  // Gather the mesh
276  _mesh.allgather();
277 
278  // Tell all the \p DofObject entities how many systems
279  // there are.
280  for (auto & node : _mesh.node_ptr_range())
281  node->set_n_systems(n_sys);
282 
283  for (auto & elem : _mesh.element_ptr_range())
284  elem->set_n_systems(n_sys);
285 
286  // And distribute each system's dofs
287  for (unsigned int i=0; i != this->n_systems(); ++i)
288  {
289  System & sys = this->get_system(i);
290  DofMap & dof_map = sys.get_dof_map();
291  dof_map.distribute_dofs(_mesh);
292 
293  // The user probably won't need constraint equations or the
294  // send_list after an allgather, but let's keep it in consistent
295  // shape just in case.
296  sys.reinit_constraints();
297  dof_map.prepare_send_list();
298  }
299 }
virtual bool is_serial() const
Definition: mesh_base.h:140
ImplicitSystem & sys
virtual void allgather()
Gathers all elements and nodes of the mesh onto every processor.
Definition: mesh_base.h:169
MeshBase & _mesh
The mesh data structure.
virtual SimpleRange< element_iterator > element_ptr_range()=0
virtual SimpleRange< node_iterator > node_ptr_range()=0
unsigned int n_systems() const
const T_sys & get_system(const std::string &name) const
void libMesh::EquationSystems::build_discontinuous_solution_vector ( std::vector< Number > &  soln,
const std::set< std::string > *  system_names = libmesh_nullptr 
) const
inherited

Fill the input vector soln with solution values.

The entries will be in variable-major format (corresponding to the names from build_variable_names()). If systems_names!=NULL, only include data from the specified systems.

Definition at line 918 of file equation_systems.C.

References libMesh::EquationSystems::_mesh, libMesh::EquationSystems::_systems, libMesh::MeshBase::active_element_ptr_range(), dim, libMesh::DofMap::dof_indices(), end, libMesh::System::get_dof_map(), libMesh::libmesh_assert(), libmesh_nullptr, libMesh::MeshBase::mesh_dimension(), libMesh::EquationSystems::n_systems(), libMesh::System::n_vars(), libMesh::FEInterface::nodal_soln(), libMesh::ParallelObject::processor_id(), libMesh::System::update_global_solution(), and libMesh::System::variable_type().

Referenced by libMesh::ExodusII_IO::write_discontinuous_exodusII(), and libMesh::GMVIO::write_discontinuous_gmv().

920 {
921  LOG_SCOPE("build_discontinuous_solution_vector()", "EquationSystems");
922 
923  libmesh_assert (this->n_systems());
924 
925  const unsigned int dim = _mesh.mesh_dimension();
926 
927  // Get the number of variables (nv) by counting the number of variables
928  // in each system listed in system_names
929  unsigned int nv = 0;
930 
931  {
932  const_system_iterator pos = _systems.begin();
933  const const_system_iterator end = _systems.end();
934 
935  for (; pos != end; ++pos)
936  {
937  // Check current system is listed in system_names, and skip pos if not
938  bool use_current_system = (system_names == libmesh_nullptr);
939  if (!use_current_system)
940  use_current_system = system_names->count(pos->first);
941  if (!use_current_system)
942  continue;
943 
944  const System & system = *(pos->second);
945  nv += system.n_vars();
946  }
947  }
948 
949  unsigned int tw=0;
950 
951  // get the total weight
952  for (const auto & elem : _mesh.active_element_ptr_range())
953  tw += elem->n_nodes();
954 
955  // Only if we are on processor zero, allocate the storage
956  // to hold (number_of_nodes)*(number_of_variables) entries.
957  if (_mesh.processor_id() == 0)
958  soln.resize(tw*nv);
959 
960  std::vector<Number> sys_soln;
961 
962 
963  unsigned int var_num=0;
964 
965  // For each system in this EquationSystems object,
966  // update the global solution and if we are on processor 0,
967  // loop over the elements and build the nodal solution
968  // from the element solution. Then insert this nodal solution
969  // into the vector passed to build_solution_vector.
970  {
971  const_system_iterator pos = _systems.begin();
972  const const_system_iterator end = _systems.end();
973 
974  for (; pos != end; ++pos)
975  {
976  // Check current system is listed in system_names, and skip pos if not
977  bool use_current_system = (system_names == libmesh_nullptr);
978  if (!use_current_system)
979  use_current_system = system_names->count(pos->first);
980  if (!use_current_system)
981  continue;
982 
983  const System & system = *(pos->second);
984  const unsigned int nv_sys = system.n_vars();
985 
986  system.update_global_solution (sys_soln, 0);
987 
988  if (_mesh.processor_id() == 0)
989  {
990  std::vector<Number> elem_soln; // The finite element solution
991  std::vector<Number> nodal_soln; // The FE solution interpolated to the nodes
992  std::vector<dof_id_type> dof_indices; // The DOF indices for the finite element
993 
994  for (unsigned int var=0; var<nv_sys; var++)
995  {
996  const FEType & fe_type = system.variable_type(var);
997 
998  unsigned int nn=0;
999 
1000  for (auto & elem : _mesh.active_element_ptr_range())
1001  {
1002  system.get_dof_map().dof_indices (elem, dof_indices, var);
1003 
1004  elem_soln.resize(dof_indices.size());
1005 
1006  for (std::size_t i=0; i<dof_indices.size(); i++)
1007  elem_soln[i] = sys_soln[dof_indices[i]];
1008 
1010  fe_type,
1011  elem,
1012  elem_soln,
1013  nodal_soln);
1014 
1015 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1016  // infinite elements should be skipped...
1017  if (!elem->infinite())
1018 #endif
1019  {
1020  libmesh_assert_equal_to (nodal_soln.size(), elem->n_nodes());
1021 
1022  for (unsigned int n=0; n<elem->n_nodes(); n++)
1023  {
1024  soln[nv*(nn++) + (var + var_num)] +=
1025  nodal_soln[n];
1026  }
1027  }
1028  }
1029  }
1030  }
1031 
1032  var_num += nv_sys;
1033  }
1034  }
1035 }
unsigned int dim
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
MeshBase & _mesh
The mesh data structure.
libmesh_assert(j)
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
unsigned int n_systems() const
unsigned int mesh_dimension() const
Definition: mesh_base.C:148
static void nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
Build the nodal soln from the element soln.
Definition: fe_interface.C:526
processor_id_type processor_id() const
std::map< std::string, System * > _systems
Data structure holding the systems.
UniquePtr< NumericVector< Number > > libMesh::EquationSystems::build_parallel_solution_vector ( const std::set< std::string > *  system_names = libmesh_nullptr) const
inherited

A version of build_solution_vector which is appropriate for "parallel" output formats like Nemesis.

Returns
A UniquePtr to a node-major NumericVector of total length n_nodes*n_vars that various I/O classes can then use to get the local values they need to write on each processor.

Definition at line 560 of file equation_systems.C.

References libMesh::ParallelObject::_communicator, libMesh::EquationSystems::_mesh, libMesh::EquationSystems::_systems, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::Variable::active_on_subdomain(), libMesh::NumericVector< T >::add(), libMesh::NumericVector< T >::build(), libMesh::NumericVector< T >::close(), libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, dim, distance(), libMesh::DofMap::dof_indices(), end, libMesh::FEInterface::field_type(), libMesh::System::get_dof_map(), libMesh::NumericVector< T >::init(), libMesh::libmesh_assert(), libmesh_nullptr, libMesh::MeshBase::local_nodes_begin(), libMesh::MeshBase::local_nodes_end(), libMesh::MeshBase::max_node_id(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_nodes(), libMesh::System::n_vars(), libMesh::FEInterface::n_vec_dim(), libMesh::FEInterface::nodal_soln(), libMesh::System::number(), libMesh::PARALLEL, libMesh::System::solution, libMesh::TYPE_VECTOR, libMesh::System::update(), libMesh::System::variable(), libMesh::System::variable_type(), and libMesh::Parallel::verify().

Referenced by libMesh::EquationSystems::build_solution_vector(), and libMesh::MeshOutput< MT >::write_equation_systems().

561 {
562  LOG_SCOPE("build_parallel_solution_vector()", "EquationSystems");
563 
564  // This function must be run on all processors at once
565  parallel_object_only();
566 
567  const unsigned int dim = _mesh.mesh_dimension();
568  const dof_id_type nn = _mesh.n_nodes();
569 
570  // We'd better have a contiguous node numbering
571  libmesh_assert_equal_to (nn, _mesh.max_node_id());
572 
573  // allocate storage to hold
574  // (number_of_nodes)*(number_of_variables) entries.
575  // We have to differentiate between between scalar and vector
576  // variables. We intercept vector variables and treat each
577  // component as a scalar variable (consistently with build_solution_names).
578 
579  unsigned int nv = 0;
580 
581  //Could this be replaced by a/some convenience methods?[PB]
582  {
583  unsigned int n_scalar_vars = 0;
584  unsigned int n_vector_vars = 0;
585  const_system_iterator pos = _systems.begin();
586  const const_system_iterator end = _systems.end();
587 
588  for (; pos != end; ++pos)
589  {
590  // Check current system is listed in system_names, and skip pos if not
591  bool use_current_system = (system_names == libmesh_nullptr);
592  if (!use_current_system)
593  use_current_system = system_names->count(pos->first);
594  if (!use_current_system)
595  continue;
596 
597  for (unsigned int vn=0; vn<pos->second->n_vars(); vn++)
598  {
599  if (FEInterface::field_type(pos->second->variable_type(vn)) == TYPE_VECTOR)
600  n_vector_vars++;
601  else
602  n_scalar_vars++;
603  }
604  }
605  // Here, we're assuming the number of vector components is the same
606  // as the mesh dimension. Will break for mixed dimension meshes.
607  nv = n_scalar_vars + dim*n_vector_vars;
608  }
609 
610  // Get the number of local nodes
611  dof_id_type n_local_nodes = cast_int<dof_id_type>
614 
615  // Create a NumericVector to hold the parallel solution
616  UniquePtr<NumericVector<Number>> parallel_soln_ptr = NumericVector<Number>::build(_communicator);
617  NumericVector<Number> & parallel_soln = *parallel_soln_ptr;
618  parallel_soln.init(nn*nv, n_local_nodes*nv, false, PARALLEL);
619 
620  // Create a NumericVector to hold the "repeat_count" for each node - this is essentially
621  // the number of elements contributing to that node's value
622  UniquePtr<NumericVector<Number>> repeat_count_ptr = NumericVector<Number>::build(_communicator);
623  NumericVector<Number> & repeat_count = *repeat_count_ptr;
624  repeat_count.init(nn*nv, n_local_nodes*nv, false, PARALLEL);
625 
626  repeat_count.close();
627 
628  unsigned int var_num=0;
629 
630  // For each system in this EquationSystems object,
631  // update the global solution and if we are on processor 0,
632  // loop over the elements and build the nodal solution
633  // from the element solution. Then insert this nodal solution
634  // into the vector passed to build_solution_vector.
635  const_system_iterator pos = _systems.begin();
636  const const_system_iterator end = _systems.end();
637 
638  for (; pos != end; ++pos)
639  {
640  // Check current system is listed in system_names, and skip pos if not
641  bool use_current_system = (system_names == libmesh_nullptr);
642  if (!use_current_system)
643  use_current_system = system_names->count(pos->first);
644  if (!use_current_system)
645  continue;
646 
647  const System & system = *(pos->second);
648  const unsigned int nv_sys = system.n_vars();
649  const unsigned int sys_num = system.number();
650 
651  //Could this be replaced by a/some convenience methods?[PB]
652  unsigned int n_scalar_vars = 0;
653  unsigned int n_vector_vars = 0;
654  for (unsigned int vn=0; vn<pos->second->n_vars(); vn++)
655  {
656  if (FEInterface::field_type(pos->second->variable_type(vn)) == TYPE_VECTOR)
657  n_vector_vars++;
658  else
659  n_scalar_vars++;
660  }
661 
662  // Here, we're assuming the number of vector components is the same
663  // as the mesh dimension. Will break for mixed dimension meshes.
664  unsigned int nv_sys_split = n_scalar_vars + dim*n_vector_vars;
665 
666  // Update the current_local_solution
667  {
668  System & non_const_sys = const_cast<System &>(system);
669  // We used to simply call non_const_sys.solution->close()
670  // here, but that is not allowed when the solution vector is
671  // locked read-only, for example when printing the solution
672  // during the middle of a solve... So try to be a bit
673  // more careful about calling close() unnecessarily.
674  libmesh_assert(this->comm().verify(non_const_sys.solution->closed()));
675  if (!non_const_sys.solution->closed())
676  non_const_sys.solution->close();
677  non_const_sys.update();
678  }
679 
680  NumericVector<Number> & sys_soln(*system.current_local_solution);
681 
682  std::vector<Number> elem_soln; // The finite element solution
683  std::vector<Number> nodal_soln; // The FE solution interpolated to the nodes
684  std::vector<dof_id_type> dof_indices; // The DOF indices for the finite element
685 
686  unsigned var_inc = 0;
687  for (unsigned int var=0; var<nv_sys; var++)
688  {
689  const FEType & fe_type = system.variable_type(var);
690  const Variable & var_description = system.variable(var);
691  const DofMap & dof_map = system.get_dof_map();
692 
693  unsigned int n_vec_dim = FEInterface::n_vec_dim( pos->second->get_mesh(), fe_type );
694 
695  for (const auto & elem : _mesh.active_local_element_ptr_range())
696  {
697  if (var_description.active_on_subdomain(elem->subdomain_id()))
698  {
699  dof_map.dof_indices (elem, dof_indices, var);
700 
701  elem_soln.resize(dof_indices.size());
702 
703  for (std::size_t i=0; i<dof_indices.size(); i++)
704  elem_soln[i] = sys_soln(dof_indices[i]);
705 
707  fe_type,
708  elem,
709  elem_soln,
710  nodal_soln);
711 
712 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
713  // infinite elements should be skipped...
714  if (!elem->infinite())
715 #endif
716  {
717  libmesh_assert_equal_to (nodal_soln.size(), n_vec_dim*elem->n_nodes());
718 
719  for (unsigned int n=0; n<elem->n_nodes(); n++)
720  {
721  for (unsigned int d=0; d < n_vec_dim; d++)
722  {
723  // For vector-valued elements, all components are in nodal_soln. For each
724  // node, the components are stored in order, i.e. node_0 -> s0_x, s0_y, s0_z
725  parallel_soln.add(nv*(elem->node_id(n)) + (var_inc+d + var_num), nodal_soln[n_vec_dim*n+d]);
726 
727  // Increment the repeat count for this position
728  repeat_count.add(nv*(elem->node_id(n)) + (var_inc+d + var_num), 1);
729  }
730  }
731  }
732  }
733  else // If this variable doesn't exist on this subdomain we have to still increment repeat_count so that we won't divide by 0 later:
734  for (unsigned int n=0; n<elem->n_nodes(); n++)
735  // Only do this if this variable has NO DoFs at this node... it might have some from an adjoining element...
736  if (!elem->node_ptr(n)->n_dofs(sys_num, var))
737  for (unsigned int d=0; d < n_vec_dim; d++)
738  repeat_count.add(nv*(elem->node_id(n)) + (var+d + var_num), 1);
739 
740  } // end loop over elements
741  var_inc += n_vec_dim;
742  } // end loop on variables in this system
743 
744  var_num += nv_sys_split;
745  } // end loop over systems
746 
747  parallel_soln.close();
748  repeat_count.close();
749 
750  // Divide to get the average value at the nodes
751  parallel_soln /= repeat_count;
752 
753  return UniquePtr<NumericVector<Number>>(parallel_soln_ptr.release());
754 }
unsigned int dim
virtual dof_id_type max_node_id() const =0
static FEFieldType field_type(const FEType &fe_type)
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
const Parallel::Communicator & _communicator
Real distance(const Point &p)
MeshBase & _mesh
The mesh data structure.
libmesh_assert(j)
static UniquePtr< NumericVector< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
virtual node_iterator local_nodes_end()=0
static unsigned int n_vec_dim(const MeshBase &mesh, const FEType &fe_type)
virtual node_iterator local_nodes_begin()=0
Iterate over local nodes (nodes whose processor_id() matches the current processor).
bool verify(const T &r, const Communicator &comm=Communicator_World)
const Parallel::Communicator & comm() const
unsigned int mesh_dimension() const
Definition: mesh_base.C:148
static void nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
Build the nodal soln from the element soln.
Definition: fe_interface.C:526
virtual dof_id_type n_nodes() const =0
uint8_t dof_id_type
Definition: id_types.h:64
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::EquationSystems::build_solution_vector ( std::vector< Number > &  soln,
const std::string &  system_name,
const std::string &  variable_name = "all_vars" 
) const
inherited

Fill the input vector soln with the solution values for the system named name.

Note
The input vector soln will only be assembled on processor 0, so this method is only applicable to outputting plot files from processor 0.

Definition at line 548 of file equation_systems.C.

Referenced by libMesh::MeshOutput< MT >::write_equation_systems().

551 {
552  // TODO:[BSK] re-implement this from the method below
553  libmesh_not_implemented();
554 }
void libMesh::EquationSystems::build_solution_vector ( std::vector< Number > &  soln,
const std::set< std::string > *  system_names = libmesh_nullptr 
) const
inherited

Fill the input vector soln with solution values.

The entries will be in variable-major format (corresponding to the names from build_variable_names()). If systems_names!=NULL, only include data from the specified systems.

Definition at line 758 of file equation_systems.C.

References libMesh::EquationSystems::build_parallel_solution_vector().

760 {
761  LOG_SCOPE("build_solution_vector()", "EquationSystems");
762 
763  // Call the parallel implementation
764  UniquePtr<NumericVector<Number>> parallel_soln =
765  this->build_parallel_solution_vector(system_names);
766 
767  // Localize the NumericVector into the provided std::vector.
768  parallel_soln->localize_to_one(soln);
769 }
UniquePtr< NumericVector< Number > > build_parallel_solution_vector(const std::set< std::string > *system_names=libmesh_nullptr) const
A version of build_solution_vector which is appropriate for "parallel" output formats like Nemesis...
void libMesh::EquationSystems::build_variable_names ( std::vector< std::string > &  var_names,
const FEType type = libmesh_nullptr,
const std::set< std::string > *  system_names = libmesh_nullptr 
) const
inherited

Fill the input vector var_names with the names of the variables for each system.

If type is passed, only variables of the specified type will be populated. If systems_names!=NULL, only include names from the specified systems.

Definition at line 446 of file equation_systems.C.

References libMesh::EquationSystems::_systems, dim, end, libMesh::FEInterface::field_type(), libMesh::EquationSystems::get_mesh(), libmesh_nullptr, libMesh::MeshBase::mesh_dimension(), libMesh::EquationSystems::n_vars(), libMesh::FEInterface::n_vec_dim(), and libMesh::TYPE_VECTOR.

Referenced by libMesh::ExodusII_IO::write_discontinuous_exodusII(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), and libMesh::MeshOutput< MT >::write_equation_systems().

449 {
450  unsigned int var_num=0;
451 
452  const_system_iterator pos = _systems.begin();
453  const const_system_iterator end = _systems.end();
454 
455  // Need to size var_names by scalar variables plus all the
456  // vector components for all the vector variables
457  //Could this be replaced by a/some convenience methods?[PB]
458  {
459  unsigned int n_scalar_vars = 0;
460  unsigned int n_vector_vars = 0;
461 
462  for (; pos != end; ++pos)
463  {
464  // Check current system is listed in system_names, and skip pos if not
465  bool use_current_system = (system_names == libmesh_nullptr);
466  if (!use_current_system)
467  use_current_system = system_names->count(pos->first);
468  if (!use_current_system)
469  continue;
470 
471  for (unsigned int vn=0; vn<pos->second->n_vars(); vn++)
472  {
473  if (FEInterface::field_type(pos->second->variable_type(vn)) == TYPE_VECTOR)
474  n_vector_vars++;
475  else
476  n_scalar_vars++;
477  }
478  }
479 
480  // Here, we're assuming the number of vector components is the same
481  // as the mesh dimension. Will break for mixed dimension meshes.
482  unsigned int dim = this->get_mesh().mesh_dimension();
483  unsigned int nv = n_scalar_vars + dim*n_vector_vars;
484 
485  // We'd better not have more than dim*his->n_vars() (all vector variables)
486  libmesh_assert_less_equal ( nv, dim*this->n_vars() );
487 
488  // Here, we're assuming the number of vector components is the same
489  // as the mesh dimension. Will break for mixed dimension meshes.
490 
491  var_names.resize( nv );
492  }
493 
494  // reset
495  pos = _systems.begin();
496 
497  for (; pos != end; ++pos)
498  {
499  // Check current system is listed in system_names, and skip pos if not
500  bool use_current_system = (system_names == libmesh_nullptr);
501  if (!use_current_system)
502  use_current_system = system_names->count(pos->first);
503  if (!use_current_system)
504  continue;
505 
506  for (unsigned int vn=0; vn<pos->second->n_vars(); vn++)
507  {
508  std::string var_name = pos->second->variable_name(vn);
509  FEType fe_type = pos->second->variable_type(vn);
510 
511  unsigned int n_vec_dim = FEInterface::n_vec_dim( pos->second->get_mesh(), fe_type);
512 
513  // Filter on the type if requested
514  if (type == libmesh_nullptr || (type && *type == fe_type))
515  {
516  if (FEInterface::field_type(fe_type) == TYPE_VECTOR)
517  {
518  switch(n_vec_dim)
519  {
520  case 0:
521  case 1:
522  var_names[var_num++] = var_name;
523  break;
524  case 2:
525  var_names[var_num++] = var_name+"_x";
526  var_names[var_num++] = var_name+"_y";
527  break;
528  case 3:
529  var_names[var_num++] = var_name+"_x";
530  var_names[var_num++] = var_name+"_y";
531  var_names[var_num++] = var_name+"_z";
532  break;
533  default:
534  libmesh_error_msg("Invalid dim in build_variable_names");
535  }
536  }
537  else
538  var_names[var_num++] = var_name;
539  }
540  }
541  }
542  // Now resize again in case we filtered any names
543  var_names.resize(var_num);
544 }
unsigned int dim
static FEFieldType field_type(const FEType &fe_type)
const class libmesh_nullptr_t libmesh_nullptr
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
static unsigned int n_vec_dim(const MeshBase &mesh, const FEType &fe_type)
unsigned int mesh_dimension() const
Definition: mesh_base.C:148
unsigned int n_vars() const
const MeshBase & get_mesh() const
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::EquationSystems::clear ( )
virtualinherited

Restores the data structure to a pristine state.

Definition at line 73 of file equation_systems.C.

References libMesh::EquationSystems::_systems, libMesh::Parameters::clear(), libmesh_nullptr, libMesh::EquationSystems::parameters, and libMesh::sys.

Referenced by main(), and libMesh::EquationSystems::~EquationSystems().

74 {
75  // Clear any additional parameters
76  parameters.clear ();
77 
78  // clear the systems. We must delete them
79  // since we newed them!
80  while (!_systems.empty())
81  {
82  system_iterator pos = _systems.begin();
83 
84  System * sys = pos->second;
85  delete sys;
86  sys = libmesh_nullptr;
87 
88  _systems.erase (pos);
89  }
90 }
ImplicitSystem & sys
const class libmesh_nullptr_t libmesh_nullptr
std::map< std::string, System * >::iterator system_iterator
Typedef for system iterators.
virtual void clear()
Clears internal data structures & frees any allocated memory.
Definition: parameters.h:321
Parameters parameters
Data structure holding arbitrary parameters.
std::map< std::string, System * > _systems
Data structure holding the systems.
const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 87 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_petsc_preconditioner_apply(), libMesh::__libmesh_petsc_snes_jacobian(), libMesh::__libmesh_petsc_snes_postcheck(), libMesh::__libmesh_petsc_snes_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::ParmetisPartitioner::_do_repartition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), add_cube_convex_hull_to_mesh(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_vector(), libMesh::EigenSparseLinearSolver< T >::adjoint_solve(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::DofMap::attach_matrix(), libMesh::Parallel::BinSorter< KeyType, IdxType >::binsort(), libMesh::Parallel::Sort< KeyType, IdxType >::binsort(), libMesh::MeshCommunication::broadcast(), libMesh::SparseMatrix< T >::build(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Parallel::Histogram< KeyType, IdxType >::build_histogram(), libMesh::PetscNonlinearSolver< T >::build_mat_null_space(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::Parallel::Sort< KeyType, IdxType >::communicate_bins(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::EquationSystems::get_solution(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TopologyMap::init(), libMesh::PetscDiffSolver::init(), libMesh::TimeSolver::init(), libMesh::TaoOptimizationSolver< T >::init(), libMesh::PetscNonlinearSolver< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::ParmetisPartitioner::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::MeshSerializer::MeshSerializer(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), new_function_base(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::MetisPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::SparseMatrix< T >::print(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshCommunication::redistribute(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), libMesh::MeshRefinement::test_unflagged(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

88  { return _communicator; }
const Parallel::Communicator & _communicator
bool libMesh::EquationSystems::compare ( const EquationSystems other_es,
const Real  threshold,
const bool  verbose 
) const
virtualinherited
Returns
true when this equation system contains identical data, up to the given threshold. Delegates most of the comparisons to perform to the responsible systems

Definition at line 1039 of file equation_systems.C.

References libMesh::EquationSystems::_systems, libMesh::System::compare(), end, libMesh::EquationSystems::get_system(), libMesh::EquationSystems::n_systems(), and libMesh::out.

Referenced by do_compare(), and libMesh::EquationSystems::read().

1042 {
1043  // safety check, whether we handle at least the same number
1044  // of systems
1045  std::vector<bool> os_result;
1046 
1047  if (this->n_systems() != other_es.n_systems())
1048  {
1049  if (verbose)
1050  {
1051  libMesh::out << " Fatal difference. This system handles "
1052  << this->n_systems() << " systems," << std::endl
1053  << " while the other system handles "
1054  << other_es.n_systems()
1055  << " systems." << std::endl
1056  << " Aborting comparison." << std::endl;
1057  }
1058  return false;
1059  }
1060  else
1061  {
1062  // start comparing each system
1063  const_system_iterator pos = _systems.begin();
1064  const const_system_iterator end = _systems.end();
1065 
1066  for (; pos != end; ++pos)
1067  {
1068  const std::string & sys_name = pos->first;
1069  const System & system = *(pos->second);
1070 
1071  // get the other system
1072  const System & other_system = other_es.get_system (sys_name);
1073 
1074  os_result.push_back (system.compare (other_system, threshold, verbose));
1075 
1076  }
1077 
1078  }
1079 
1080 
1081  // sum up the results
1082  if (os_result.size()==0)
1083  return true;
1084  else
1085  {
1086  bool os_identical;
1087  unsigned int n = 0;
1088  do
1089  {
1090  os_identical = os_result[n];
1091  n++;
1092  }
1093  while (os_identical && n<os_result.size());
1094  return os_identical;
1095  }
1096 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
unsigned int n_systems() const
OStreamProxy out
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::EquationSystems::delete_system ( const std::string &  name)
inherited

Remove the system named name from the systems array.

Deprecated:
This function may not work as intended and has not been actively tested over the years. If you need the ability to delete a System from an EquationSystems object, it could probably be added.

Definition at line 401 of file equation_systems.C.

References libMesh::EquationSystems::_systems, and libMesh::Quality::name().

402 {
403  libmesh_deprecated();
404 
405  if (!_systems.count(name))
406  libmesh_error_msg("ERROR: no system named " << name);
407 
408  delete _systems[name];
409 
410  _systems.erase (name);
411 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit(), and libMesh::ReferenceCounter::n_objects().

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::EquationSystems::disable_refine_in_reinit ( )
inherited

Calls to reinit() will not try to coarsen or refine the mesh.

Definition at line 456 of file equation_systems.h.

References libMesh::EquationSystems::_refine_in_reinit.

Referenced by EquationSystemsTest::testRefineThenReinitPreserveFlags().

456 { this->_refine_in_reinit = false; }
bool _refine_in_reinit
Flag for whether to call coarsen/refine in reinit().
Real Biharmonic::dt ( )

Definition at line 82 of file biharmonic.h.

References _dt, init(), output(), libMesh::Real, run(), step(), and viewParameters().

82 { return _dt; }
Real Biharmonic::dt0 ( )

Definition at line 81 of file biharmonic.h.

References _dt0.

81 { return _dt0; }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::ReferenceCounter::n_objects().

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::EquationSystems::enable_refine_in_reinit ( )
inherited

Calls to reinit() will also do two-step coarsen-then-refine.

Definition at line 451 of file equation_systems.h.

References libMesh::EquationSystems::_refine_in_reinit.

451 { this->_refine_in_reinit = true; }
bool _refine_in_reinit
Flag for whether to call coarsen/refine in reinit().
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
std::string libMesh::EquationSystems::get_info ( ) const
virtualinherited
Returns
A string containing information about the systems, flags, and parameters.

Definition at line 1100 of file equation_systems.C.

References libMesh::EquationSystems::_systems, end, and libMesh::EquationSystems::n_systems().

Referenced by libMesh::EquationSystems::print_info(), and libMesh::EquationSystems::read().

1101 {
1102  std::ostringstream oss;
1103 
1104  oss << " EquationSystems\n"
1105  << " n_systems()=" << this->n_systems() << '\n';
1106 
1107  // Print the info for the individual systems
1108  const_system_iterator pos = _systems.begin();
1109  const const_system_iterator end = _systems.end();
1110 
1111  for (; pos != end; ++pos)
1112  oss << pos->second->get_info();
1113 
1114 
1115  // // Possibly print the parameters
1116  // if (!this->parameters.empty())
1117  // {
1118  // oss << " n_parameters()=" << this->n_parameters() << '\n';
1119  // oss << " Parameters:\n";
1120 
1121  // for (std::map<std::string, Real>::const_iterator
1122  // param = _parameters.begin(); param != _parameters.end();
1123  // ++param)
1124  // oss << " "
1125  // << "\""
1126  // << param->first
1127  // << "\""
1128  // << "="
1129  // << param->second
1130  // << '\n';
1131  // }
1132 
1133  return oss.str();
1134 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
unsigned int n_systems() const
std::map< std::string, System * > _systems
Data structure holding the systems.
const MeshBase & libMesh::EquationSystems::get_mesh ( ) const
inherited
MeshBase & libMesh::EquationSystems::get_mesh ( )
inherited
Returns
A reference to the mesh

Definition at line 543 of file equation_systems.h.

References libMesh::EquationSystems::_mesh.

544 {
545  return _mesh;
546 }
MeshBase & _mesh
The mesh data structure.
void libMesh::EquationSystems::get_solution ( std::vector< Number > &  soln,
std::vector< std::string > &  names 
) const
inherited

Retrieve the solution data for CONSTANT MONOMIALs.

If names is populated, only the variables corresponding to those names will be retrieved. This can be used to filter which variables are retrieved.

Definition at line 773 of file equation_systems.C.

References libMesh::ParallelObject::_communicator, libMesh::EquationSystems::_mesh, libMesh::EquationSystems::_systems, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::Variable::active_on_subdomain(), libMesh::NumericVector< T >::build(), libMesh::NumericVector< T >::close(), libMesh::ParallelObject::comm(), libMesh::CONSTANT, libMesh::System::current_local_solution, libMesh::DofMap::dof_indices(), end, libMesh::System::get_dof_map(), libMesh::NumericVector< T >::init(), libMesh::libmesh_assert(), libMesh::NumericVector< T >::localize_to_one(), libMesh::MeshBase::max_elem_id(), libMesh::MONOMIAL, libMesh::MeshBase::n_elem(), libMesh::ParallelObject::n_processors(), libMesh::EquationSystems::n_systems(), libMesh::System::n_vars(), libMesh::PARALLEL, libMesh::ParallelObject::processor_id(), libMesh::NumericVector< T >::set(), libMesh::System::solution, libMesh::System::update(), libMesh::System::variable(), libMesh::System::variable_name(), libMesh::System::variable_type(), and libMesh::Parallel::verify().

Referenced by libMesh::ExodusII_IO::write_element_data().

775 {
776  // This function must be run on all processors at once
777  parallel_object_only();
778 
779  libmesh_assert (this->n_systems());
780 
781  const dof_id_type ne = _mesh.n_elem();
782 
783  libmesh_assert_equal_to (ne, _mesh.max_elem_id());
784 
785  // If the names vector has entries, we will only populate the soln vector
786  // with names included in that list. Note: The names vector may be
787  // reordered upon exiting this function
788  std::vector<std::string> filter_names = names;
789  bool is_filter_names = !filter_names.empty();
790 
791  soln.clear();
792  names.clear();
793 
794  const FEType type(CONSTANT, MONOMIAL);
795 
796  dof_id_type nv = 0;
797 
798  // Find the total number of variables to output
799  std::vector<std::vector<unsigned>> do_output(_systems.size());
800  {
801  const_system_iterator pos = _systems.begin();
802  const const_system_iterator end = _systems.end();
803  unsigned sys_ctr = 0;
804 
805  for (; pos != end; ++pos, ++sys_ctr)
806  {
807  const System & system = *(pos->second);
808  const unsigned int nv_sys = system.n_vars();
809 
810  do_output[sys_ctr].resize(nv_sys);
811 
812  for (unsigned int var=0; var < nv_sys; ++var)
813  {
814  if (system.variable_type(var) != type ||
815  (is_filter_names && std::find(filter_names.begin(), filter_names.end(), system.variable_name(var)) == filter_names.end()))
816  continue;
817 
818  // Otherwise, this variable should be output
819  nv++;
820  do_output[sys_ctr][var] = 1;
821  }
822  }
823  }
824 
825  // If there are no variables to write out don't do anything...
826  if (!nv)
827  return;
828 
829  // We can handle the case where there are NULLs in the Elem vector
830  // by just having extra zeros in the solution vector.
831  numeric_index_type parallel_soln_global_size = ne*nv;
832 
833  numeric_index_type div = parallel_soln_global_size / this->n_processors();
834  numeric_index_type mod = parallel_soln_global_size % this->n_processors();
835 
836  // Initialize all processors to the average size.
837  numeric_index_type parallel_soln_local_size = div;
838 
839  // The first "mod" processors get an extra entry.
840  if (this->processor_id() < mod)
841  parallel_soln_local_size = div+1;
842 
843  // Create a NumericVector to hold the parallel solution
844  UniquePtr<NumericVector<Number>> parallel_soln_ptr = NumericVector<Number>::build(_communicator);
845  NumericVector<Number> & parallel_soln = *parallel_soln_ptr;
846  parallel_soln.init(parallel_soln_global_size,
847  parallel_soln_local_size,
848  /*fast=*/false,
849  /*ParallelType=*/PARALLEL);
850 
851  dof_id_type var_num = 0;
852 
853  // For each system in this EquationSystems object,
854  // update the global solution and collect the
855  // CONSTANT MONOMIALs. The entries are in variable-major
856  // format.
857  const_system_iterator pos = _systems.begin();
858  const const_system_iterator end = _systems.end();
859  unsigned sys_ctr = 0;
860 
861  for (; pos != end; ++pos, ++sys_ctr)
862  {
863  const System & system = *(pos->second);
864  const unsigned int nv_sys = system.n_vars();
865 
866  // Update the current_local_solution
867  {
868  System & non_const_sys = const_cast<System &>(system);
869  // We used to simply call non_const_sys.solution->close()
870  // here, but that is not allowed when the solution vector is
871  // locked read-only, for example when printing the solution
872  // during during the middle of a solve... So try to be a bit
873  // more careful about calling close() unnecessarily.
874  libmesh_assert(this->comm().verify(non_const_sys.solution->closed()));
875  if (!non_const_sys.solution->closed())
876  non_const_sys.solution->close();
877  non_const_sys.update();
878  }
879 
880  NumericVector<Number> & sys_soln(*system.current_local_solution);
881 
882  // The DOF indices for the finite element
883  std::vector<dof_id_type> dof_indices;
884 
885  // Loop over the variable names and load them in order
886  for (unsigned int var=0; var < nv_sys; ++var)
887  {
888  // Skip this variable if we are not outputting it.
889  if (!do_output[sys_ctr][var])
890  continue;
891 
892  names.push_back(system.variable_name(var));
893 
894  const Variable & variable = system.variable(var);
895  const DofMap & dof_map = system.get_dof_map();
896 
897  for (const auto & elem : _mesh.active_local_element_ptr_range())
898  if (variable.active_on_subdomain(elem->subdomain_id()))
899  {
900  dof_map.dof_indices (elem, dof_indices, var);
901 
902  libmesh_assert_equal_to (1, dof_indices.size());
903 
904  parallel_soln.set((ne*var_num)+elem->id(), sys_soln(dof_indices[0]));
905  }
906 
907  var_num++;
908  } // end loop on variables in this system
909  } // end loop over systems
910 
911  parallel_soln.close();
912 
913  parallel_soln.localize_to_one(soln);
914 }
processor_id_type n_processors() const
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
const Parallel::Communicator & _communicator
MeshBase & _mesh
The mesh data structure.
libmesh_assert(j)
static UniquePtr< NumericVector< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
virtual dof_id_type max_elem_id() const =0
dof_id_type numeric_index_type
Definition: id_types.h:92
unsigned int n_systems() const
bool verify(const T &r, const Communicator &comm=Communicator_World)
const Parallel::Communicator & comm() const
virtual dof_id_type n_elem() const =0
processor_id_type processor_id() const
uint8_t dof_id_type
Definition: id_types.h:64
std::map< std::string, System * > _systems
Data structure holding the systems.
template<typename T_sys >
const T_sys & libMesh::EquationSystems::get_system ( const std::string &  name) const
inherited
Returns
A constant reference to the system named name. The template argument defines the return type. For example, const SteadySystem & sys = eq.get_system<SteadySystem> ("sys"); is an example of how the method might be used

Definition at line 651 of file equation_systems.h.

References libMesh::EquationSystems::_systems.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::EquationSystems::_read_impl(), add_M_C_K_helmholtz(), libMesh::EnsightIO::add_scalar(), libMesh::RBSCMConstruction::add_scaled_symm_Aq(), libMesh::EquationSystems::add_system(), libMesh::EnsightIO::add_vector(), libMesh::EquationSystems::adjoint_solve(), libMesh::EquationSystems::allgather(), apply_initial(), assemble(), LinearElasticity::assemble(), assemble_1D(), assemble_biharmonic(), assemble_cd(), assemble_elasticity(), assemble_ellipticdg(), assemble_helmholtz(), assemble_laplace(), assemble_mass(), assemble_matrices(), assemble_poisson(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::ExactSolution::attach_exact_deriv(), libMesh::ExactSolution::attach_exact_value(), libMesh::ExactSolution::attach_reference_solution(), libMesh::EquationSystems::compare(), libMesh::ExactSolution::compute_error(), compute_stresses(), LinearElasticityWithContact::compute_stresses(), LinearElasticity::compute_stresses(), LargeDeformationElasticity::compute_stresses(), libMesh::GMVIO::copy_nodal_solution(), SolidSystem::element_time_derivative(), libMesh::ExactSolution::error_norm(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::ErrorEstimator::estimate_errors(), libMesh::ExactSolution::ExactSolution(), fill_dirichlet_bc(), libMesh::DTKAdapter::find_sys(), libMesh::RBEIMConstruction::get_explicit_system(), libMesh::EquationSystems::init(), init_cd(), SolidSystem::init_data(), init_sys(), initialize(), LaplaceYoung::jacobian(), LargeDeformationElasticity::jacobian(), libMesh::RBSCMConstruction::load_matrix_B(), main(), libMesh::RBSCMConstruction::perform_SCM_greedy(), libMesh::EquationSystems::reinit(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), run_timestepping(), SolidSystem::save_initial_mesh(), libMesh::EquationSystems::sensitivity_solve(), SolidSystem::side_time_derivative(), libMesh::EquationSystems::solve(), MixedDimensionMeshTest::testDofOrdering(), MixedDimensionRefinedMeshTest::testDofOrdering(), MixedDimensionNonUniformRefinement::testDofOrdering(), MixedDimensionNonUniformRefinementTriangle::testDofOrdering(), MixedDimensionNonUniformRefinement3D::testDofOrdering(), SlitMeshRefinedSystemTest::testRestart(), libMesh::EquationSystems::update(), libMesh::EnsightIO::write_scalar_ascii(), and libMesh::EnsightIO::write_vector_ascii().

652 {
653  const_system_iterator pos = _systems.find(name);
654 
655  // Check for errors
656  if (pos == _systems.end())
657  libmesh_error_msg("ERROR: no system named \"" << name << "\" found!");
658 
659  // Attempt dynamic cast
660  return *cast_ptr<T_sys *>(pos->second);
661 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
std::map< std::string, System * > _systems
Data structure holding the systems.
template<typename T_sys >
T_sys & libMesh::EquationSystems::get_system ( const std::string &  name)
inherited
Returns
A writable reference to the system named name. The template argument defines the return type. For example, const SteadySystem & sys = eq.get_system<SteadySystem> ("sys"); is an example of how the method might be used

Definition at line 670 of file equation_systems.h.

References libMesh::EquationSystems::_systems.

671 {
672  system_iterator pos = _systems.find(name);
673 
674  // Check for errors
675  if (pos == _systems.end())
676  libmesh_error_msg("ERROR: no system named " << name << " found!");
677 
678  // Attempt dynamic cast
679  return *cast_ptr<T_sys *>(pos->second);
680 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
std::map< std::string, System * >::iterator system_iterator
Typedef for system iterators.
std::map< std::string, System * > _systems
Data structure holding the systems.
template<typename T_sys >
const T_sys & libMesh::EquationSystems::get_system ( const unsigned int  num) const
inherited
Returns
A constant reference to system number num. The template argument defines the return type. For example, const SteadySystem & sys = eq.get_system<SteadySystem> (0); is an example of how the method might be used

Definition at line 600 of file equation_systems.h.

References libMesh::EquationSystems::_systems, end, and libMesh::EquationSystems::n_systems().

601 {
602  libmesh_assert_less (num, this->n_systems());
603 
604 
605  const_system_iterator pos = _systems.begin();
606  const const_system_iterator end = _systems.end();
607 
608  for (; pos != end; ++pos)
609  if (pos->second->number() == num)
610  break;
611 
612  // Check for errors
613  if (pos == end)
614  libmesh_error_msg("ERROR: no system number " << num << " found!");
615 
616  // Attempt dynamic cast
617  return *cast_ptr<T_sys *>(pos->second);
618 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
unsigned int n_systems() const
std::map< std::string, System * > _systems
Data structure holding the systems.
template<typename T_sys >
T_sys & libMesh::EquationSystems::get_system ( const unsigned int  num)
inherited
Returns
A writable reference to the system number num. The template argument defines the return type. For example, const SteadySystem & sys = eq.get_system<SteadySystem> (0); is an example of how the method might be used

Definition at line 625 of file equation_systems.h.

References libMesh::EquationSystems::_systems, end, and libMesh::EquationSystems::n_systems().

626 {
627  libmesh_assert_less (num, this->n_systems());
628 
629  const_system_iterator pos = _systems.begin();
630  const const_system_iterator end = _systems.end();
631 
632  for (; pos != end; ++pos)
633  if (pos->second->number() == num)
634  break;
635 
636  // Check for errors
637  if (pos == end)
638  libmesh_error_msg("ERROR: no system number " << num << " found!");
639 
640  // Attempt dynamic cast
641  return *cast_ptr<T_sys *>(pos->second);
642 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
unsigned int n_systems() const
std::map< std::string, System * > _systems
Data structure holding the systems.
const System & libMesh::EquationSystems::get_system ( const std::string &  name) const
inherited
Returns
A constant reference to the system named name.

Definition at line 689 of file equation_systems.h.

References libMesh::Quality::name().

690 {
691  return this->get_system<System>(name);
692 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
System & libMesh::EquationSystems::get_system ( const std::string &  name)
inherited
Returns
A writable reference to the system named name.

Definition at line 697 of file equation_systems.h.

References libMesh::Quality::name().

698 {
699  return this->get_system<System>(name);
700 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
const System & libMesh::EquationSystems::get_system ( const unsigned int  num) const
inherited
Returns
A constant reference to system number num.

Definition at line 705 of file equation_systems.h.

706 {
707  return this->get_system<System>(num);
708 }
System & libMesh::EquationSystems::get_system ( const unsigned int  num)
inherited
Returns
A writable reference to the system number num.

Definition at line 713 of file equation_systems.h.

714 {
715  return this->get_system<System>(num);
716 }
bool libMesh::EquationSystems::has_system ( const std::string &  name) const
inherited
Returns
true if the system named name exists within this EquationSystems object.

Definition at line 588 of file equation_systems.h.

References libMesh::EquationSystems::_systems.

Referenced by libMesh::EnsightIO::add_scalar(), libMesh::EnsightIO::add_vector(), libMesh::ExactSolution::compute_error(), libMesh::ExactSolution::error_norm(), and main().

589 {
590  if (_systems.find(name) == _systems.end())
591  return false;
592  return true;
593 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 185 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 198 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void Biharmonic::init ( )
virtual

Initialize all the systems.

Reimplemented from libMesh::EquationSystems.

Definition at line 212 of file biharmonic.C.

References _dt, _o_count, _verbose, libMesh::TriangleWrapper::init(), and libMesh::out.

Referenced by dt().

213 {
214  if (_verbose)
215  libMesh::out << ">>> Initializing Biharmonic\n";
216 
217  _dt = 0;
218  _o_count = 0;
220 
221  if (_verbose)
222  libMesh::out << "<<< Initializing Biharmonic\n";
223 }
bool _verbose
Definition: biharmonic.h:99
int _o_count
Definition: biharmonic.h:109
void init(triangulateio &t)
Initializes the fields of t to NULL/0 as necessary.
OStreamProxy out
std::size_t libMesh::EquationSystems::n_active_dofs ( ) const
inherited
Returns
The number of active degrees of freedom for the EquationSystems object.

Definition at line 1186 of file equation_systems.C.

References libMesh::EquationSystems::_systems, and end.

Referenced by main(), and write_output_solvedata().

1187 {
1188  std::size_t tot=0;
1189 
1190  const_system_iterator pos = _systems.begin();
1191  const const_system_iterator end = _systems.end();
1192 
1193  for (; pos != end; ++pos)
1194  tot += pos->second->n_active_dofs();
1195 
1196  return tot;
1197 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
std::map< std::string, System * > _systems
Data structure holding the systems.
std::size_t libMesh::EquationSystems::n_dofs ( ) const
inherited
Returns
The total number of degrees of freedom in all systems.

Definition at line 1170 of file equation_systems.C.

References libMesh::EquationSystems::_systems, and end.

1171 {
1172  std::size_t tot=0;
1173 
1174  const_system_iterator pos = _systems.begin();
1175  const const_system_iterator end = _systems.end();
1176 
1177  for (; pos != end; ++pos)
1178  tot += pos->second->n_dofs();
1179 
1180  return tot;
1181 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
std::map< std::string, System * > _systems
Data structure holding the systems.
static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited
processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::ParmetisPartitioner::_do_repartition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::MeshCommunication::broadcast(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshBase::get_info(), libMesh::EquationSystems::get_solution(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

94  { return cast_int<processor_id_type>(_communicator.size()); }
unsigned int size() const
Definition: parallel.h:726
const Parallel::Communicator & _communicator
unsigned int libMesh::EquationSystems::n_systems ( ) const
inherited
unsigned int libMesh::EquationSystems::n_vars ( ) const
inherited
Returns
The total number of variables in all systems.

Definition at line 1155 of file equation_systems.C.

References libMesh::EquationSystems::_systems, and end.

Referenced by libMesh::EquationSystems::build_variable_names().

1156 {
1157  unsigned int tot=0;
1158 
1159  const_system_iterator pos = _systems.begin();
1160  const const_system_iterator end = _systems.end();
1161 
1162  for (; pos != end; ++pos)
1163  tot += pos->second->n_vars();
1164 
1165  return tot;
1166 }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
std::map< std::string, System * >::const_iterator const_system_iterator
Typedef for constant system iterators.
std::map< std::string, System * > _systems
Data structure holding the systems.
void Biharmonic::output ( int  timestep,
const Real &  t,
Real &  o_t,
bool  force = false 
)

Definition at line 250 of file biharmonic.C.

References _exio, _o_count, _o_dt, _ofile, _verbose, libMesh::out, and libMesh::Real.

Referenced by dt(), and run().

254 {
255  if (!force && t - o_t < _o_dt)
256  return;
257 
258  ++_o_count;
259 
260  if (_verbose)
261  libMesh::out << "Writing state "
262  << timestep
263  << " at time "
264  << t
265  << " to file "
266  << _ofile
267  << "; output a total of "
268  << _o_count
269  << " states so far\n";
270 
271  _exio->write_timestep(_ofile, *this, timestep, t);
272 
273  if (!force)
274  o_t = t;
275 }
std::string _ofile
Definition: biharmonic.h:106
bool _verbose
Definition: biharmonic.h:99
int _o_count
Definition: biharmonic.h:109
OStreamProxy out
Real _o_dt
Definition: biharmonic.h:108
UniquePtr< ExodusII_IO > _exio
Definition: biharmonic.h:107
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 88 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

Referenced by libMesh::LibMeshInit::LibMeshInit().

89 {
91  out_stream << ReferenceCounter::get_info();
92 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::EquationSystems::print_info ( std::ostream &  os = libMesh::out) const
inherited

Prints information about the equation systems, by default to libMesh::out.

Definition at line 1138 of file equation_systems.C.

References libMesh::EquationSystems::get_info().

Referenced by assemble_and_solve(), do_compare(), main(), libMesh::operator<<(), and libMesh::EquationSystems::read().

1139 {
1140  os << this->get_info()
1141  << std::endl;
1142 }
virtual std::string get_info() const
processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited
Returns
The rank of this processor in the group.

Definition at line 99 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshCommunication::broadcast(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DofMap::build_sparsity(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::EquationSystems::get_solution(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), HeatSystem::init_data(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MetisPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NumericVector< T >::print_global(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), BoundaryInfoTest::testShellFaceConstraints(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::MeshTools::weight(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), and libMesh::ExodusII_IO_Helper::write_timestep().

100  { return cast_int<processor_id_type>(_communicator.rank()); }
const Parallel::Communicator & _communicator
unsigned int rank() const
Definition: parallel.h:724
template<typename InValType >
void libMesh::EquationSystems::read ( const std::string &  name,
const XdrMODE  mode,
const unsigned int  read_flags = (READ_HEADER | READ_DATA),
bool  partition_agnostic = true 
)
inherited

Read & initialize the systems from disk using the XDR data format.

This format allows for machine-independent binary output.

Set which sections of the file to read by bitwise OR'ing the EquationSystems::ReadFlags enumeration together. For example, to read all sections of the file, set read_flags to: (READ_HEADER | READ_DATA | READ_ADDITIONAL_DATA)

Note
The equation system can be defined without initializing the data vectors to any solution values. This can be done by omitting READ_DATA in the read_flags parameter.

If XdrMODE is omitted, it will be inferred as READ for filenames containing .xda or as DECODE for filenames containing .xdr

Parameters
nameName of the file to be read.
read_flagsSingle flag created by bitwise-OR'ing several flags together.
modeControls whether reading is done in binary or ascii mode.
partition_agnosticIf true then the mesh and degrees of freedom will be temporarily renumbered in a partition agnostic way so that files written using "n" mpi processes can be re-read on "m" mpi processes. This renumbering is not compatible with meshes that have two nodes in exactly the same position!

Definition at line 90 of file equation_systems_io.C.

References libMesh::EquationSystems::_mesh, libMesh::MeshRefinement::clean_refinement_flags(), libMesh::Quality::name(), libMesh::out, and libMesh::EquationSystems::TRY_READ_IFEMS.

Referenced by libMesh::EquationSystems::_read_impl(), main(), libMesh::EquationSystems::read(), and SlitMeshRefinedSystemTest::testRestart().

94 {
95  // If we have exceptions enabled we can be considerate and try
96  // to read old restart files which contain infinite element
97  // information but do not have the " with infinite elements"
98  // string in the version information.
99 
100  // First try the read the user requested
101  libmesh_try
102  {
103  this->_read_impl<InValType> (name, mode, read_flags, partition_agnostic);
104  }
105 
106  // If that fails, try it again but explicitly request we look for infinite element info
107  libmesh_catch (...)
108  {
109  libMesh::out << "\n*********************************************************************\n"
110  << "READING THE FILE \"" << name << "\" FAILED.\n"
111  << "It is possible this file contains infinite element information,\n"
112  << "but the version string does not contain \" with infinite elements\"\n"
113  << "Let's try this again, but looking for infinite element information...\n"
114  << "*********************************************************************\n"
115  << std::endl;
116 
117  libmesh_try
118  {
119  this->_read_impl<InValType> (name, mode, read_flags | EquationSystems::TRY_READ_IFEMS, partition_agnostic);
120  }
121 
122  // If all that failed, we are out of ideas here...
123  libmesh_catch (...)
124  {
125  libMesh::out << "\n*********************************************************************\n"
126  << "Well, at least we tried!\n"
127  << "Good Luck!!\n"
128  << "*********************************************************************\n"
129  << std::endl;
130  LIBMESH_THROW();
131  }
132  }
133 
134 #ifdef LIBMESH_ENABLE_AMR
135  MeshRefinement mesh_refine(_mesh);
136  mesh_refine.clean_refinement_flags();
137 #endif
138 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
MeshBase & _mesh
The mesh data structure.
OStreamProxy out
template void libMesh::EquationSystems::read< Real > ( const std::string &  name,
const XdrMODE  mode,
const unsigned int  read_flags = (READ_HEADER|READ_DATA),
bool  partition_agnostic = true 
)
inherited

Definition at line 354 of file equation_systems.h.

References libMesh::Quality::name(), libMesh::EquationSystems::read(), libMesh::EquationSystems::READ_DATA, and libMesh::EquationSystems::READ_HEADER.

358  { read<Number>(name, mode, read_flags, partition_agnostic); }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
template<typename InValType >
void libMesh::EquationSystems::read ( const std::string &  name,
const unsigned int  read_flags = (READ_HEADER | READ_DATA),
bool  partition_agnostic = true 
)
inherited

Definition at line 72 of file equation_systems_io.C.

References libMesh::EquationSystems::_mesh, libMesh::MeshRefinement::clean_refinement_flags(), libMesh::DECODE, libMesh::READ, and libMesh::EquationSystems::read().

75 {
76  XdrMODE mode = READ;
77  if (name.find(".xdr") != std::string::npos)
78  mode = DECODE;
79  this->read(name, mode, read_flags, partition_agnostic);
80 
81 #ifdef LIBMESH_ENABLE_AMR
82  MeshRefinement mesh_refine(_mesh);
83  mesh_refine.clean_refinement_flags();
84 #endif
85 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
void read(const std::string &name, const XdrMODE, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
Read & initialize the systems from disk using the XDR data format.
MeshBase & _mesh
The mesh data structure.
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:32
template void libMesh::EquationSystems::read< Real > ( const std::string &  name,
const unsigned int  read_flags = (READ_HEADER|READ_DATA),
bool  partition_agnostic = true 
)
inherited
bool libMesh::EquationSystems::refine_in_reinit_flag ( )
inherited
Returns
Whether or not calls to reinit() will try to coarsen/refine the mesh

Definition at line 461 of file equation_systems.h.

References libMesh::EquationSystems::_refine_in_reinit.

461 { return this->_refine_in_reinit; }
bool _refine_in_reinit
Flag for whether to call coarsen/refine in reinit().
void libMesh::EquationSystems::reinit ( )
virtualinherited

Reinitialize all the systems.

Definition at line 119 of file equation_systems.C.

References libMesh::EquationSystems::_mesh, libMesh::EquationSystems::_refine_in_reinit, libMesh::MeshRefinement::coarsen_elements(), libMesh::MeshBase::contract(), libMesh::DofMap::distribute_dofs(), libMesh::MeshBase::element_ptr_range(), libMesh::MeshRefinement::face_level_mismatch_limit(), libMesh::System::get_dof_map(), libMesh::EquationSystems::get_mesh(), libMesh::EquationSystems::get_system(), libMesh::EquationSystems::n_systems(), libMesh::MeshBase::node_ptr_range(), libMesh::MeshRefinement::overrefined_boundary_limit(), libMesh::System::prolong_vectors(), libMesh::MeshRefinement::refine_elements(), libMesh::System::reinit_constraints(), libMesh::System::restrict_vectors(), libMesh::sys, and libMesh::MeshRefinement::underrefined_boundary_limit().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), assemble_and_solve(), libMesh::AdjointRefinementEstimator::estimate_error(), main(), run_timestepping(), SlitMeshRefinedSystemTest::setUp(), EquationSystemsTest::testPostInitAddElem(), EquationSystemsTest::testPostInitAddRealSystem(), EquationSystemsTest::testPostInitAddSystem(), and EquationSystemsTest::testRefineThenReinitPreserveFlags().

120 {
121  parallel_object_only();
122 
123  const unsigned int n_sys = this->n_systems();
124  libmesh_assert_not_equal_to (n_sys, 0);
125 
126  // We may have added new systems since our last
127  // EquationSystems::(re)init call
128  bool _added_new_systems = false;
129  for (unsigned int i=0; i != n_sys; ++i)
130  if (!this->get_system(i).is_initialized())
131  _added_new_systems = true;
132 
133  if (_added_new_systems)
134  {
135  // Our DofObjects will need space for the additional systems
136  for (auto & node : _mesh.node_ptr_range())
137  node->set_n_systems(n_sys);
138 
139  for (auto & elem : _mesh.element_ptr_range())
140  elem->set_n_systems(n_sys);
141 
142  // And any new systems will need initialization
143  for (unsigned int i=0; i != n_sys; ++i)
144  if (!this->get_system(i).is_initialized())
145  this->get_system(i).init();
146  }
147 
148 
149  // We used to assert that all nodes and elements *already* had
150  // n_systems() properly set; however this is false in the case where
151  // user code has manually added nodes and/or elements to an
152  // already-initialized system.
153 
154  // Make sure all the \p DofObject entities know how many systems
155  // there are.
156  {
157  // All the nodes
158  for (auto & node : _mesh.node_ptr_range())
159  node->set_n_systems(this->n_systems());
160 
161  // All the elements
162  for (auto & elem : _mesh.element_ptr_range())
163  elem->set_n_systems(this->n_systems());
164  }
165 
166  // Localize each system's vectors
167  for (unsigned int i=0; i != this->n_systems(); ++i)
168  this->get_system(i).re_update();
169 
170 #ifdef LIBMESH_ENABLE_AMR
171 
172  bool dof_constraints_created = false;
173  bool mesh_changed = false;
174 
175  // FIXME: For backwards compatibility, assume
176  // refine_and_coarsen_elements or refine_uniformly have already
177  // been called
178  {
179  for (unsigned int i=0; i != this->n_systems(); ++i)
180  {
181  System & sys = this->get_system(i);
182 
183  // Even if the system doesn't have any variables in it we want
184  // consistent behavior; e.g. distribute_dofs should have the
185  // opportunity to count up zero dofs on each processor.
186  //
187  // Who's been adding zero-var systems anyway, outside of my
188  // unit tests? - RHS
189  // if (!sys.n_vars())
190  // continue;
191 
192  sys.get_dof_map().distribute_dofs(_mesh);
193 
194  // Recreate any user or internal constraints
195  sys.reinit_constraints();
196 
197  sys.prolong_vectors();
198  }
199  mesh_changed = true;
200  dof_constraints_created = true;
201  }
202 
203  if (this->_refine_in_reinit)
204  {
205  // Don't override any user refinement settings
206  MeshRefinement mesh_refine(_mesh);
207  mesh_refine.face_level_mismatch_limit() = 0; // unlimited
208  mesh_refine.overrefined_boundary_limit() = -1; // unlimited
209  mesh_refine.underrefined_boundary_limit() = -1; // unlimited
210 
211  // Try to coarsen the mesh, then restrict each system's vectors
212  // if necessary
213  if (mesh_refine.coarsen_elements())
214  {
215  for (unsigned int i=0; i != this->n_systems(); ++i)
216  {
217  System & sys = this->get_system(i);
218  if (!dof_constraints_created)
219  {
220  sys.get_dof_map().distribute_dofs(_mesh);
221  sys.reinit_constraints();
222  }
223  sys.restrict_vectors();
224  }
225  mesh_changed = true;
226  dof_constraints_created = true;
227  }
228 
229  // Once vectors are all restricted, we can delete
230  // children of coarsened elements
231  if (mesh_changed)
232  this->get_mesh().contract();
233 
234  // Try to refine the mesh, then prolong each system's vectors
235  // if necessary
236  if (mesh_refine.refine_elements())
237  {
238  for (unsigned int i=0; i != this->n_systems(); ++i)
239  {
240  System & sys = this->get_system(i);
241  if (!dof_constraints_created)
242  {
243  sys.get_dof_map().distribute_dofs(_mesh);
244  sys.reinit_constraints();
245  }
246  sys.prolong_vectors();
247  }
248  mesh_changed = true;
249  // dof_constraints_created = true;
250  }
251  }
252 
253  // If the mesh has changed, systems will need to create new dof
254  // constraints and update their global solution vectors
255  if (mesh_changed)
256  {
257  for (unsigned int i=0; i != this->n_systems(); ++i)
258  this->get_system(i).reinit();
259  }
260 #endif // #ifdef LIBMESH_ENABLE_AMR
261 }
ImplicitSystem & sys
MeshBase & _mesh
The mesh data structure.
virtual SimpleRange< element_iterator > element_ptr_range()=0
virtual SimpleRange< node_iterator > node_ptr_range()=0
bool _refine_in_reinit
Flag for whether to call coarsen/refine in reinit().
unsigned int n_systems() const
virtual bool contract()=0
Delete subactive (i.e.
const MeshBase & get_mesh() const
const T_sys & get_system(const std::string &name) const
void Biharmonic::run ( )

Definition at line 286 of file biharmonic.C.

References _dt, _t0, _t1, _verbose, libMesh::out, output(), libMesh::Real, and step().

Referenced by dt().

287 {
288  Real t = _t0, o_t = 0.0;
289  int timestep = 1;
290 
291  // Force-write the initial timestep
292  output(timestep, t, o_t, true);
293 
294  while (t < _t1)
295  {
296  ++timestep;
297 
298  // A pretty update message
299  if (_verbose)
300  libMesh::out << "Solving for state " << timestep << ", time " << t << "\n";
301 
302  // Move biharmonic one timestep forward
303  step();
304 
305  // Keep track of time and timestep
306  t += _dt;
307 
308  // Output
309  output(timestep, t, o_t);
310  } // while(t < _t1)
311 
312  // Force-write the final timestep
313  output(timestep, t, o_t, true);
314 }
bool _verbose
Definition: biharmonic.h:99
void output(int timestep, const Real &t, Real &o_t, bool force=false)
Definition: biharmonic.C:250
void step(const Real &dt=-1.0)
Definition: biharmonic.C:229
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
OStreamProxy out
void libMesh::EquationSystems::sensitivity_solve ( const ParameterVector parameters)
virtualinherited

Call sensitivity_solve on all the individual equation systems.

By default this function solves each sensitivity system once, in the order in which in which they were added. For more sophisticated decoupled problems the user may with to override this behavior in a derived class.

Definition at line 426 of file equation_systems.C.

References libMesh::EquationSystems::get_system(), libMesh::libmesh_assert(), and libMesh::EquationSystems::n_systems().

427 {
428  libmesh_assert (this->n_systems());
429 
430  for (unsigned int i=0; i != this->n_systems(); ++i)
431  this->get_system(i).sensitivity_solve(parameters_in);
432 }
libmesh_assert(j)
unsigned int n_systems() const
const T_sys & get_system(const std::string &name) const
void libMesh::EquationSystems::solve ( )
virtualinherited

Call solve on all the individual equation systems.

By default this function solves each equation system once, in the order they were added. For more sophisticated decoupled problems the user may with to override this behavior in a derived class.

Definition at line 416 of file equation_systems.C.

References libMesh::EquationSystems::get_system(), libMesh::libmesh_assert(), and libMesh::EquationSystems::n_systems().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error().

417 {
418  libmesh_assert (this->n_systems());
419 
420  for (unsigned int i=0; i != this->n_systems(); ++i)
421  this->get_system(i).solve();
422 }
libmesh_assert(j)
unsigned int n_systems() const
const T_sys & get_system(const std::string &name) const
void Biharmonic::step ( const Real &  dt = -1.0)

Definition at line 229 of file biharmonic.C.

References _dt, _dt0, and _jr.

Referenced by dt(), and run().

230 {
231  // We need to update the old solution vector.
232  // The old solution vector will be the current solution vector from the
233  // previous time step. We use vector assignment. Only TransientSystems
234  // (and systems derived from them) contain old solutions.
235  if (dt_in < 0)
236  _dt = _dt0;
237  else
238  _dt = dt_in;
239 
240  *(_jr->old_local_solution) = *(_jr->current_local_solution);
241 
242  // this will localize the current solution, resulting in a
243  // current_local_solution with correct ghost values
244  _jr->solve();
245 }
void libMesh::EquationSystems::update ( )
inherited

Updates local values for all the systems.

Definition at line 304 of file equation_systems.C.

References libMesh::EquationSystems::get_system(), and libMesh::EquationSystems::n_systems().

Referenced by libMesh::EquationSystems::_read_impl(), and main().

305 {
306  LOG_SCOPE("update()", "EquationSystems");
307 
308  // Localize each system's vectors
309  for (unsigned int i=0; i != this->n_systems(); ++i)
310  this->get_system(i).update();
311 }
unsigned int n_systems() const
const T_sys & get_system(const std::string &name) const
bool Biharmonic::verbose ( )

Definition at line 80 of file biharmonic.h.

References _verbose.

80 { return _verbose; }
bool _verbose
Definition: biharmonic.h:99
void Biharmonic::viewParameters ( )

Definition at line 165 of file biharmonic.C.

References _cahn_hillard, _cnWeight, _degenerate, _dim, _dt0, _energy, _growth, _initialCenter, _initialState, _initialWidth, _kappa, _log_truncation, _N, _netforce, _o_dt, _ofile_base, _T, _t0, _t1, _theta, _theta_c, _tol, _verbose, BALL, int, libMesh::out, ROD, and STRIP.

Referenced by dt().

166 {
167  libMesh::out << "Biharmonic parameters:\n";
168 
169  // Print verbosity status
170  if (_verbose)
171  libMesh::out << "verbose mode is on\n";
172  else
173  libMesh::out << "verbose mode is off\n";
174 
175  // Print parameters
176  libMesh::out << "mesh dimension = " << _dim << "\n";
177  libMesh::out << "initial linear mesh size = " << _N << "\n";
178  libMesh::out << "kappa = " << _kappa << "\n";
179  libMesh::out << "growth = " << (int)_growth << "\n";
180  libMesh::out << "degenerate = " << (int)_degenerate << "\n";
181  libMesh::out << "Cahn-Hillard = " << (int)_cahn_hillard << "\n";
182  libMesh::out << "netforce = " << (int)_netforce << "\n";
183  libMesh::out << "energy = " << _energy << "\n";
184  libMesh::out << "tol = " << _tol << "\n";
185  libMesh::out << "theta = " << _theta << "\n";
186  libMesh::out << "theta_c = " << _theta_c << "\n";
187  libMesh::out << "log truncation = " << _log_truncation << "\n";
188  libMesh::out << "initial timestep size = " << _dt0 << "\n";
189 
190  if (_initialState == STRIP)
191  libMesh::out << "initial state: strip\n";
192 
193  if (_initialState == ROD)
194  libMesh::out << "initial state: rod\n";
195 
196  if (_initialState == BALL)
197  libMesh::out << "initial state: ball\n";
198 
199  libMesh::out << "initial state center = " << _initialCenter(0) << "\n";
200  libMesh::out << "initial state width = " << _initialWidth << "\n";
201  libMesh::out << "initial time (min_time) = " << _t0 << "\n";
202  libMesh::out << "integration time = " << _T << "\n";
203  libMesh::out << "final time (max_time) = " << _t1 << "\n";
204  libMesh::out << "Crank-Nicholson weight = " << _cnWeight << "\n";
205  libMesh::out << "Output timestep = " << _o_dt << "\n";
206  libMesh::out << "Output filename base: " << _ofile_base << "\n";
207 }
bool _verbose
Definition: biharmonic.h:99
Real _cnWeight
Definition: biharmonic.h:104
Real _kappa
Definition: biharmonic.h:94
Real _theta_c
Definition: biharmonic.h:94
Point _initialCenter
Definition: biharmonic.h:101
Real _tol
Definition: biharmonic.h:95
bool _netforce
Definition: biharmonic.h:96
bool _cahn_hillard
Definition: biharmonic.h:96
FreeEnergyEnum _energy
Definition: biharmonic.h:97
int _log_truncation
Definition: biharmonic.h:98
unsigned int _dim
Definition: biharmonic.h:93
Real _initialWidth
Definition: biharmonic.h:102
OStreamProxy out
bool _growth
Definition: biharmonic.h:96
Real _o_dt
Definition: biharmonic.h:108
unsigned int _N
Definition: biharmonic.h:93
std::string _ofile_base
Definition: biharmonic.h:106
InitialStateEnum _initialState
Definition: biharmonic.h:100
void ErrorVector unsigned int
Definition: adjoints_ex3.C:360
Real _theta
Definition: biharmonic.h:94
bool _degenerate
Definition: biharmonic.h:96
void libMesh::EquationSystems::write ( const std::string &  name,
const XdrMODE  mode,
const unsigned int  write_flags = (WRITE_DATA),
bool  partition_agnostic = true 
) const
inherited

Write the systems to disk using the XDR data format.

This format allows for machine-independent binary output.

Set the writing properties using the EquationSystems::WriteFlags enumeration. Set which sections to write out by bitwise OR'ing the enumeration values. Write everything by setting write_flags to: (WRITE_DATA | WRITE_ADDITIONAL_DATA)

Note
The solution data can be omitted by calling this routine with WRITE_DATA omitted in the write_flags argument.

If XdrMODE is omitted, it will be inferred as WRITE for filenames containing .xda or as ENCODE for filenames containing .xdr

Parameters
nameName of the file to be read.
write_flagsSingle flag created by bitwise-OR'ing several flags together.
modeControls whether reading is done in binary or ascii mode.
partition_agnosticIf true then the mesh and degrees of freedom will be temporarily renumbered in a partition agnostic way so that files written using "n" mpi processes can be re-read on "m" mpi processes. This renumbering is not compatible with meshes that have two nodes in exactly the same position!

This program implements the output of an EquationSystems object. This warrants some documentation. The output file essentially consists of 11 sections:

1.) The version header.
2.) The number of individual equation systems (unsigned int)

for each system

3.)  The name of the system (string)
4.)  The type of the system (string)

handled through System::read():

+-------------------------------------------------------------+
|  5.) The number of variables in the system (unsigned int)   |
|                                                             |
|   for each variable in the system                           |
|                                                             |
|    6.) The name of the variable (string)                    |
|                                                             |
|    7.) Combined in an FEType:                               |
|         - The approximation order(s) of the variable (Order |
|           Enum, cast to int/s)                              |
|         - The finite element family/ies of the variable     |
|           (FEFamily Enum, cast to int/s)                    |
|                                                             |
|   end variable loop                                         |
|                                                             |
| 8.) The number of additional vectors (unsigned int),        |
|                                                             |
|    for each additional vector in the equation system object |
|                                                             |
|    9.) the name of the additional vector  (string)          |
+-------------------------------------------------------------+

end system loop


for each system, handled through System::write_{serialized,parallel}_data():

+--------------------------------------------------------------+
| 10.) The global solution vector, re-ordered to be node-major |
|     (More on this later.)                                    |
|                                                              |
|    for each additional vector in the equation system object  |
|                                                              |
|    11.) The global additional vector, re-ordered to be       |
|         node-major (More on this later.)                     |
+--------------------------------------------------------------+

end system loop

Note that the actual IO is handled through the Xdr class (to be renamed later?) which provides a uniform interface to both the XDR (eXternal Data Representation) interface and standard ASCII output. Thus this one section of code will write XDR or ASCII files with no changes.

Definition at line 381 of file equation_systems_io.C.

References libMesh::EquationSystems::_mesh, libMesh::EquationSystems::_systems, libMesh::Xdr::data(), libMesh::get_io_compatibility_version(), libMesh::EquationSystems::get_mesh(), libMesh::MeshTools::Private::globally_renumber_nodes_and_elements(), libMesh::libmesh_assert(), mesh, libMesh::Quality::name(), libMesh::ParallelObject::processor_id(), libMesh::Xdr::set_version(), libMesh::EquationSystems::WRITE_ADDITIONAL_DATA, libMesh::EquationSystems::WRITE_DATA, libMesh::EquationSystems::WRITE_PARALLEL_FILES, and libMesh::Xdr::writing().

Referenced by main(), libMesh::ErrorVector::plot_error(), libMesh::EquationSystems::read(), SlitMeshRefinedSystemTest::testRestart(), libMesh::EquationSystems::write(), libMesh::NameBasedIO::write_equation_systems(), and write_output().

385 {
449  // the EquationSystems::write() method should look constant,
450  // but we need to assign a temporary numbering to the nodes
451  // and elements in the mesh, which requires that we abuse const_cast
452  if (partition_agnostic)
453  {
454  MeshBase & mesh = const_cast<MeshBase &>(this->get_mesh());
456  }
457 
458  // set booleans from write_flags argument
459  const bool write_data = write_flags & EquationSystems::WRITE_DATA;
460  const bool write_additional_data = write_flags & EquationSystems::WRITE_ADDITIONAL_DATA;
461 
462  // always write parallel files if we're instructed to write in
463  // parallel
464  const bool write_parallel_files =
466  // Even if we're on a distributed mesh, we may or may not have a
467  // consistent way of reconstructing the same mesh partitioning
468  // later, but we need the same mesh partitioning if we want to
469  // reread the parallel solution safely, so let's write a serial file
470  // unless specifically requested not to.
471  // ||
472  // // but also write parallel files if we haven't been instructed to
473  // // write in serial and we're on a distributed mesh
474  // (!(write_flags & EquationSystems::WRITE_SERIAL_FILES) &&
475  // !this->get_mesh().is_serial())
476  ;
477 
478  // New scope so that io will close before we try to zip the file
479  {
480  Xdr io((this->processor_id()==0) ? name : "", mode);
481  libmesh_assert (io.writing());
482 
483  LOG_SCOPE("write()", "EquationSystems");
484 
485  const unsigned int proc_id = this->processor_id();
486 
487  unsigned int n_sys = 0;
488  for (std::map<std::string, System *>::const_iterator pos = _systems.begin();
489  pos != _systems.end(); ++pos)
490  {
491  if (! pos->second->hide_output()) n_sys++;
492  }
493 
494  // set the version number in the Xdr object
495  io.set_version(LIBMESH_VERSION_ID(LIBMESH_MAJOR_VERSION,
496  LIBMESH_MINOR_VERSION,
497  LIBMESH_MICRO_VERSION));
498 
499  // Only write the header information
500  // if we are processor 0.
501  if (proc_id == 0)
502  {
503  std::string comment;
504  char buf[256];
505 
506  // 1.)
507  // Write the version header
508  std::string version("libMesh-" + libMesh::get_io_compatibility_version());
509  if (write_parallel_files) version += " parallel";
510 
511 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
512  version += " with infinite elements";
513 #endif
514  io.data (version, "# File Format Identifier");
515 
516  // 2.)
517  // Write the number of equation systems
518  io.data (n_sys, "# No. of Equation Systems");
519 
520  for (std::map<std::string, System *>::const_iterator pos = _systems.begin();
521  pos != _systems.end(); ++pos)
522  {
523  // Ignore this system if it has been marked as hidden
524  if (pos->second->hide_output()) continue;
525 
526  // 3.)
527  // Write the name of the sys_num-th system
528  {
529  const unsigned int sys_num = pos->second->number();
530  std::string sys_name = pos->first;
531 
532  comment = "# Name, System No. ";
533  std::sprintf(buf, "%u", sys_num);
534  comment += buf;
535 
536  io.data (sys_name, comment.c_str());
537  }
538 
539  // 4.)
540  // Write the type of system handled
541  {
542  const unsigned int sys_num = pos->second->number();
543  std::string sys_type = pos->second->system_type();
544 
545  comment = "# Type, System No. ";
546  std::sprintf(buf, "%u", sys_num);
547  comment += buf;
548 
549  io.data (sys_type, comment.c_str());
550  }
551 
552  // 5.) - 9.)
553  // Let System::write_header() do the job
554  pos->second->write_header (io, version, write_additional_data);
555  }
556  }
557 
558  // Start from the first system, again,
559  // to write vectors to disk, if wanted
560  if (write_data)
561  {
562  // open a parallel buffer if warranted.
563  Xdr local_io (write_parallel_files ? local_file_name(this->processor_id(),name) : "", mode);
564 
565  for (std::map<std::string, System *>::const_iterator pos = _systems.begin();
566  pos != _systems.end(); ++pos)
567  {
568  // Ignore this system if it has been marked as hidden
569  if (pos->second->hide_output()) continue;
570 
571  // 10.) + 11.)
572  if (write_parallel_files)
573  pos->second->write_parallel_data (local_io,write_additional_data);
574  else
575  pos->second->write_serialized_data (io,write_additional_data);
576  }
577  }
578  }
579 
580  // the EquationSystems::write() method should look constant,
581  // but we need to undo the temporary numbering of the nodes
582  // and elements in the mesh, which requires that we abuse const_cast
583  if (partition_agnostic)
584  const_cast<MeshBase &>(_mesh).fix_broken_node_and_element_numbering();
585 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
MeshBase & mesh
MeshBase & _mesh
The mesh data structure.
libmesh_assert(j)
std::string get_io_compatibility_version()
Specifier for I/O file compatibility features.
void globally_renumber_nodes_and_elements(MeshBase &)
There is no reason for a user to ever call this function.
Definition: mesh_tools.C:1968
const MeshBase & get_mesh() const
processor_id_type processor_id() const
std::map< std::string, System * > _systems
Data structure holding the systems.
void libMesh::EquationSystems::write ( const std::string &  name,
const unsigned int  write_flags = (WRITE_DATA),
bool  partition_agnostic = true 
) const
inherited

Definition at line 369 of file equation_systems_io.C.

References libMesh::ENCODE, libMesh::WRITE, and libMesh::EquationSystems::write().

372 {
373  XdrMODE mode = WRITE;
374  if (name.find(".xdr") != std::string::npos)
375  mode = ENCODE;
376  this->write(name, mode, write_flags, partition_agnostic);
377 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
void write(const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
Write the systems to disk using the XDR data format.
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:32

Friends And Related Function Documentation

friend class JR
friend

Definition at line 111 of file biharmonic.h.

Member Data Documentation

bool Biharmonic::_cahn_hillard
private

Definition at line 96 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

Real Biharmonic::_cnWeight
private

Definition at line 104 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited
ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
bool Biharmonic::_degenerate
private

Definition at line 96 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

unsigned int Biharmonic::_dim
private
Real Biharmonic::_dt
private

Definition at line 103 of file biharmonic.h.

Referenced by dt(), init(), Biharmonic::JR::residual_and_jacobian(), run(), and step().

Real Biharmonic::_dt0
private

Definition at line 103 of file biharmonic.h.

Referenced by Biharmonic(), dt0(), step(), and viewParameters().

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

FreeEnergyEnum Biharmonic::_energy
private

Definition at line 97 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

UniquePtr<ExodusII_IO> Biharmonic::_exio
private

Definition at line 107 of file biharmonic.h.

Referenced by Biharmonic(), and output().

bool Biharmonic::_growth
private

Definition at line 96 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

Point Biharmonic::_initialCenter
private

Definition at line 101 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::initialize(), and viewParameters().

InitialStateEnum Biharmonic::_initialState
private

Definition at line 100 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::initialize(), and viewParameters().

Real Biharmonic::_initialWidth
private

Definition at line 102 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::initialize(), and viewParameters().

JR* Biharmonic::_jr
private

Definition at line 114 of file biharmonic.h.

Referenced by Biharmonic(), and step().

Real Biharmonic::_kappa
private

Definition at line 94 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

int Biharmonic::_log_truncation
private

Definition at line 98 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

ReplicatedMesh& Biharmonic::_mesh
private
Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

unsigned int Biharmonic::_N
private

Definition at line 93 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

bool Biharmonic::_netforce
private

Definition at line 96 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

int Biharmonic::_o_count
private

Definition at line 109 of file biharmonic.h.

Referenced by init(), and output().

Real Biharmonic::_o_dt
private

Definition at line 108 of file biharmonic.h.

Referenced by Biharmonic(), output(), and viewParameters().

std::string Biharmonic::_ofile
private

Definition at line 106 of file biharmonic.h.

Referenced by Biharmonic(), and output().

std::string Biharmonic::_ofile_base
private

Definition at line 106 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

bool libMesh::EquationSystems::_refine_in_reinit
protectedinherited
std::map<std::string, System *> libMesh::EquationSystems::_systems
protectedinherited
Real Biharmonic::_T
private

Definition at line 103 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

Real Biharmonic::_t0
private

Definition at line 103 of file biharmonic.h.

Referenced by Biharmonic(), run(), and viewParameters().

Real Biharmonic::_t1
private

Definition at line 103 of file biharmonic.h.

Referenced by Biharmonic(), run(), and viewParameters().

Real Biharmonic::_theta
private

Definition at line 94 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

Real Biharmonic::_theta_c
private

Definition at line 94 of file biharmonic.h.

Referenced by Biharmonic(), Biharmonic::JR::residual_and_jacobian(), and viewParameters().

Real Biharmonic::_tol
private

Definition at line 95 of file biharmonic.h.

Referenced by Biharmonic(), and viewParameters().

bool Biharmonic::_verbose
private
Parameters libMesh::EquationSystems::parameters
inherited

Data structure holding arbitrary parameters.

Definition at line 467 of file equation_systems.h.

Referenced by add_M_C_K_helmholtz(), assemble_biharmonic(), assemble_cd(), assemble_ellipticdg(), assemble_helmholtz(), assemble_laplace(), assemble_poisson(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::ExactSolution::attach_exact_deriv(), libMesh::ExactSolution::attach_exact_value(), libMesh::ExactSolution::attach_reference_solution(), libMesh::NewmarkSystem::clear(), libMesh::EquationSystems::clear(), libMesh::FrequencySystem::clear_all(), LinearElasticityWithContact::compute_stresses(), LargeDeformationElasticity::compute_stresses(), libMesh::EquationSystems::EquationSystems(), fill_dirichlet_bc(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::ImplicitSystem::get_linear_solve_parameters(), libMesh::FEComputeData::init(), init_cd(), HeatSystem::init_data(), libMesh::FrequencySystem::init_data(), init_sys(), Biharmonic::JR::initialize(), initialize(), LargeDeformationElasticity::jacobian(), main(), libMesh::FrequencySystem::n_frequencies(), libMesh::NewmarkSystem::NewmarkSystem(), libMesh::NonlinearImplicitSystem::NonlinearImplicitSystem(), LargeDeformationElasticity::residual(), LinearElasticityWithContact::residual_and_jacobian(), run_timestepping(), libMesh::FrequencySystem::set_current_frequency(), libMesh::FrequencySystem::set_frequencies(), libMesh::FrequencySystem::set_frequencies_by_range(), libMesh::FrequencySystem::set_frequencies_by_steps(), libMesh::NewmarkSystem::set_newmark_parameters(), libMesh::NonlinearImplicitSystem::set_solver_parameters(), setup(), FETest< order, family, elem_type >::setUp(), SolidSystem::side_time_derivative(), libMesh::EigenSystem::solve(), libMesh::CondensedEigenSystem::solve(), libMesh::FrequencySystem::solve(), libMesh::LinearImplicitSystem::solve(), libMesh::RBConstruction::solve_for_matrix_and_rhs(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), SystemsTest::testProjectCube(), SystemsTest::testProjectCubeWithMeshFunction(), SystemsTest::testProjectLine(), SystemsTest::testProjectSquare(), and libMesh::WrappedFunction< Output >::WrappedFunction().


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