25 for (
int i = 0; i < 8; i++)
31 for (
int i = 0; i < center.
Size(); i++)
51 for (
int i = 4; i < 8; i++)
53 add(1.0, v[i-4], 2.0, v_s_z, v[i]);
56 for (
int i = 0; i < 8; i++)
62 for (
int i = 0; i < 8; i++)
64 vi[i] = i + (m.
GetNE())*8;
74 for (
int i = 0; i < 4; i++)
80 for (
int i = 0; i < center.
Size(); i++)
97 for (
int i = 0; i < 4; i++)
103 for (
int i = 0; i < 4; i++)
105 vi[i] = i + (m.
GetNE())*4;
114 const char* title,
int x,
int y,
int w,
int h,
const char* keys)
117 MFEM_VERIFY(
dim == 2 ||
dim == 3,
118 "ParticleSet dimension must be 2 or 3 for visualization.");
119 const int nv =
dim == 2 ? 4 : 8;
145 for (
int j = 0; j < nv; j++)
147 gf[j+i*nv] = scalar_field[i];
153 x, y, w, h, keys,
false);
155 VisualizeField(sock,
vishost, visport, gf, title, x, y, w, h, keys,
false);
161 int tail_size_,
const char *vishost_,
162 int visport_,
const char *title_,
163 int x_,
int y_,
int w_,
int h_,
165 : pset(particles), tail_size(tail_size_),
166 x(x_), y(y_), w(w_), h(h_), title(title_), keys(keys_),
167 vishost(vishost_), visport(visport_)
169 ,comm(particles.GetComm())
209 for (
int i = 0; i < num_start; i++)
240 std::vector<Mesh*> all_meshes;
243 all_meshes.push_back(&m);
247 all_meshes.push_back(
mesh);
250 Mesh trajectories(all_meshes.data(), all_meshes.size());
int Size() const
Return the logical size of the array.
int Find(const T &el) const
Return the first index where 'el' is found; return -1 if not found.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Class for grid function - Vector with associated FE space.
Arbitrary order "L2-conforming" discontinuous finite elements.
void FinalizeMesh(int refine=0, bool fix_orientation=true)
Finalize the construction of any type of Mesh.
int AddQuad(int v1, int v2, int v3, int v4, int attr=1)
Adds a quadrilateral to the mesh given by 4 vertices v1 through v4.
int AddVertex(real_t x, real_t y=0.0, real_t z=0.0)
int GetNE() const
Returns number of elements.
int AddHex(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, int attr=1)
Adds a hexahedron to the mesh given by 8 vertices v1 through v8.
ParticleSet initializes and manages data associated with particles.
MPI_Comm GetComm() const
Get the MPI communicator for this ParticleSet.
ParticleVector & Coords()
Get a reference to the coordinates ParticleVector.
const Array< IDType > & GetIDs() const
Get the global IDs of the active particles owned by this ParticleSet.
int GetDim() const
Get the spatial dimension.
int GetNParticles() const
Get the number of active particles currently held by this ParticleSet.
void GetValues(int i, Vector &nvals) const
Get a copy of particle i 's data.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
void Visualize()
Visualize the particle trajectories (and mesh if provided).
std::list< Array< ParticleSet::IDType > > segment_ids
Track particle IDs that exist at the segment start.
ParticleTrajectories(const ParticleSet &particles, int tail_size_, const char *vishost_, int visport_, const char *title_, int x_=0, int y_=0, int w_=400, int h_=400, const char *keys_=nullptr)
Setup up the particle trajectory for visualization.
std::list< Mesh > segment_meshes
Each segment is stored as a Mesh snapshot.
void Add2DPoint(const Vector ¢er, Mesh &m, real_t scale)
Add a point to a given Mesh, represented as a quad sized scale.
void VisualizeMesh(socketstream &sock, const char *vishost, int visport, Mesh &mesh, const char *title, int x, int y, int w, int h, const char *keys)
void Add3DPoint(const Vector ¢er, Mesh &m, real_t scale)
Add a point to a given Mesh, represented as a hex sized scale.
void VisualizeParticles(socketstream &sock, const char *vishost, int visport, const ParticleSet &pset, const Vector &scalar_field, real_t psize, const char *title, int x, int y, int w, int h, const char *keys)
Plot particles in ParticleSet pset, represented as quads/hexes of size psize and colored by scalar_fi...
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
void add(const Vector &v1, const Vector &v2, Vector &v)