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
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";
295 output(timestep, t, o_t,
true);
303 libMesh::out <<
"Solving for state " << timestep <<
", time " << t <<
"\n";
316 output(timestep, t, o_t,
true);
void ErrorVector unsigned int
std::unique_ptr< ExodusII_IO > _exio
InitialStateEnum _initialState
void output(int timestep, const Real &t, Real &o_t, bool force=false)
void init()
Initialize all the systems.
void step(const Real &dt=-1.0)
Biharmonic(ReplicatedMesh &mesh)
Constructor retrieves command-line options, setting defaults, if necessary.
This is the EquationSystems class.
virtual void init()
Initialize all the systems.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
The libMesh namespace provides an interface to certain functionality in the library.
void command_line_vector(const std::string &, std::vector< T > &)
T command_line_value(const std::string &, T)
bool on_command_line(std::string arg)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real