Parallel Finite Element - General geometry Ewald-like Method
Part of Continuum-particle Simulation Suite under MICCOM
fix_rigid.h
Go to the documentation of this file.
1 // Parallel Finite Element-General Geometry Ewald-like Method.
2 // Copyright (C) 2015-2016 Xujun Zhao, Jiyuan Li, Xikai Jiang
3 
4 // This code is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 
10 // This code is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 
15 
16 // You should have received a copy of the GNU General Public
17 // License along with this code; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 
21 
22 #pragma once
23 
24 #include <stdio.h>
25 #include <map>
26 #include <cmath>
27 
28 #include "fix.h"
29 #include "../rigid_particle.h"
30 #include "../elasticity_system.h"
31 
32 namespace libMesh
33 {
34 
35  /*
36  * The class is designed for computing the force field
37  * of the system
38  */
39 
40 
41 class FixRigid: public Fix
42 {
43 public:
44 
47  ElasticitySystem& el_sys);
48 
51 
52  virtual ~FixRigid(){}
53 
58  void initParticleType();
59 
60  /*
61  * 1) check if a rigid particle is on a periodic boundary, if so, rebuild the particlemesh (fix me, is this necessary)
62  * 2) check if a particle is on or crosses a non-slip wall, if so, move the nodes that crosses the wall back
63  */
64  void check_walls();
65 
66  /*
67  * Not implemented yet
68  */
69  void check_walls_pbcCount();
70 
71  /*
72  * check if particle is on periodic boundary, if so, rebuild particle mesh
73  * this function is called once before all fix::compute(), no matter how many fixes we have
74  */
75  void check_pbc_pre_fix();
76 
77  /*
78  * restore particle mesh after fix::compute()
79  */
80  void check_pbc_post_fix();
81 
82  /*
83  * sync force from nodes to point mesh
84  */
86 
87 
88 protected:
89  // The elastic system for solids
90  // Use pointer instead of const Ref. to avoid explicit initialization!
92 
93  // partiticle mesh for finite size particle
95 
96  // rigid particles
97  std::vector<RigidParticle*> rigid_particles;
98 
99  // number of rigid particles
100  std::size_t num_rigid_particles;
101 
102 }; // end of class
103 
104 } // end of namespace
ElasticitySystem * elastic_system
Definition: fix_rigid.h:91
Definition: fix_rigid.h:41
void check_walls_pbcCount()
Definition: fix_rigid.C:127
void check_pbc_post_fix()
Definition: fix_rigid.C:155
FixRigid(PMLinearImplicitSystem &pm_sys, ElasticitySystem &el_sys)
Constructor for a system with elastic structures (finite size particles)
Definition: fix_rigid.C:3
Definition: brownian_system.h:58
std::size_t num_rigid_particles
Definition: fix_rigid.h:100
virtual ~FixRigid()
Definition: fix_rigid.h:52
Definition: fix.h:55
void sync_node_to_pointmesh()
Definition: fix_rigid.C:176
void initParticleType()
Definition: fix_rigid.C:23
ParticleMesh< 3 > * particle_mesh
Definition: fix_rigid.h:94
Definition: pm_linear_implicit_system.h:52
std::vector< RigidParticle * > rigid_particles
Definition: fix_rigid.h:97
void check_pbc_pre_fix()
Definition: fix_rigid.C:133
Definition: elasticity_system.h:57
void check_walls()
Definition: fix_rigid.C:36