2 #include "libmesh/mesh_generation.h" 3 #include "libmesh/numeric_vector.h" 4 #include "libmesh/replicated_mesh.h" 43 if (energy ==
"double_well")
45 else if (energy ==
"double_obstacle")
47 else if (energy ==
"log_double_well")
49 else if (energy ==
"log_double_obstacle")
52 libmesh_error_msg(
"Unknown energy type: " << energy);
62 libMesh::out <<
"WARNING: no truncation is being used for the logarithmic free energy term.\nWARNING: division by zero possible!\n";
68 libmesh_assert_msg((
_dim <= 3) && (
_dim > 0),
"Invalid mesh dimension");
73 libmesh_assert_msg(
_N > 0,
"Invalid mesh size");
84 MeshTools::Generation::build_cube(
_mesh,
_N,
_N,
_N, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
HEX8);
87 libmesh_assert_msg((
_dim <= 3) && (
_dim > 0),
"Invalid mesh dimension");
93 libmesh_assert_msg(
_dt0>=0,
"Negative initial timestep");
97 libmesh_assert_msg(
_t1 >=
_t0,
"Final time less than initial time");
101 libmesh_assert_msg(_cnWeight <= 1 && _cnWeight >= 0,
"Crank-Nicholson weight must be between 0 and 1");
107 if (initialState == std::string(
"ball"))
109 else if (initialState == std::string(
"strip"))
111 else if (initialState == std::string(
"rod"))
114 libmesh_error_msg(
"Unknown initial state: neither ball nor rod nor strip");
116 std::vector<Real> icenter;
120 if (icenter.size() >
_dim)
121 libmesh_assert_msg(icenter.size() >
_dim,
"Invalid dimension for the initial state center of mass");
125 for (std::size_t i = icenter.size(); i <
_dim; ++i)
128 for (
unsigned int i =
_dim; i < 3; ++i)
135 #ifdef LIBMESH_HAVE_EXODUS_API 160 #endif // #ifdef LIBMESH_HAVE_EXODUS_API 215 _jr = &(add_system<Biharmonic::JR>(std::string(
"Biharmonic::JR")));
243 *(
_jr->old_local_solution) = *(
_jr->current_local_solution);
252 #ifdef LIBMESH_HAVE_EXODUS_API 258 if (!force && t - o_t <
_o_dt)
270 <<
"; output a total of " 272 <<
" states so far\n";
285 #endif // #ifdef LIBMESH_HAVE_EXODUS_API 295 output(timestep, t, o_t,
true);
303 libMesh::out <<
"Solving for state " << timestep <<
", time " << t <<
"\n";
316 output(timestep, t, o_t,
true);
This is the EquationSystems class.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
std::unique_ptr< ExodusII_IO > _exio
Biharmonic(ReplicatedMesh &mesh)
Constructor retrieves command-line options, setting defaults, if necessary.
void init()
Initialize all the systems.
void output(int timestep, const Real &t, Real &o_t, bool force=false)
The libMesh namespace provides an interface to certain functionality in the library.
T command_line_value(const std::string &, T)
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
void step(const Real &dt=-1.0)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void command_line_vector(const std::string &, std::vector< T > &)
bool on_command_line(std::string arg)
A Point defines a location in LIBMESH_DIM dimensional Real space.
InitialStateEnum _initialState
void ErrorVector unsigned int