Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wu tong #11

Open
wants to merge 168 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
409bfca
compiled dambreak
spadaxsys-dev Apr 9, 2024
a0d79a8
all compiled
spadaxsys-dev Apr 10, 2024
e2e45e0
using transformation_matrix0_ for better expression
spadaxsys-dev Apr 11, 2024
9939ec3
a lot changed, to compile the entire solution
spadaxsys-dev Apr 11, 2024
97e1f0e
continue to compile
spadaxsys-dev Apr 11, 2024
cc0b30a
all compiled, to test
Xiangyu-Hu Apr 12, 2024
313ce5e
shock tube case ok
spadaxsys-dev Apr 12, 2024
a8cda56
double mach case ok
spadaxsys-dev Apr 12, 2024
051a944
eulerian taylor green ok
spadaxsys-dev Apr 12, 2024
cc052ad
euler flow around cylinder ok
spadaxsys-dev Apr 12, 2024
7871ea9
two cases ok
Xiangyu-Hu Apr 12, 2024
ace5eba
two cases ok
spadaxsys-dev Apr 12, 2024
1c35765
3 cases
Xiangyu-Hu Apr 12, 2024
80adf92
Merge branch 'fix/average_velocity_in_material' of https://github.com…
Xiangyu-Hu Apr 12, 2024
4933a63
one case ok
Xiangyu-Hu Apr 12, 2024
c39fbf5
4 cases ok
spadaxsys-dev Apr 12, 2024
9f598c4
Merge branch 'fix/average_velocity_in_material' of github.com:Xiangyu…
spadaxsys-dev Apr 12, 2024
096f361
ul oscillation beam ok
Xiangyu-Hu Apr 13, 2024
a05c112
add detailed instruction to initialization sequence
spadaxsys-dev Apr 13, 2024
27ecbcb
Merge branch 'fix/average_velocity_in_material' of github.com:Xiangyu…
spadaxsys-dev Apr 13, 2024
f01969a
revise owsc case, delete non-used object
Xiangyu-Hu Apr 13, 2024
d73f3c4
3 cases ok
spadaxsys-dev Apr 13, 2024
ba3ce56
Merge branch 'fix/average_velocity_in_material' of github.com:Xiangyu…
spadaxsys-dev Apr 13, 2024
97f2755
0ne 2d case ok
Xiangyu-Hu Apr 13, 2024
5938be4
Merge branch 'fix/average_velocity_in_material' of https://github.com…
Xiangyu-Hu Apr 13, 2024
66430fd
3 3d cases ok
spadaxsys-dev Apr 13, 2024
ec0d41d
Merge branch 'fix/average_velocity_in_material' of github.com:Xiangyu…
spadaxsys-dev Apr 13, 2024
def367e
5 2d cases ok
Xiangyu-Hu Apr 13, 2024
177e321
Merge branch 'fix/average_velocity_in_material' of https://github.com…
Xiangyu-Hu Apr 13, 2024
adeb407
throat case revised
Xiangyu-Hu Apr 13, 2024
7451ba4
two phase dambreak to test
Xiangyu-Hu Apr 13, 2024
8a099c6
3 cases ok
spadaxsys-dev Apr 13, 2024
ccff77a
Merge branch 'fix/average_velocity_in_material' of github.com:Xiangyu…
spadaxsys-dev Apr 13, 2024
d102e82
typo
spadaxsys-dev Apr 13, 2024
8bfbb82
all cases passed
spadaxsys-dev Apr 13, 2024
1e9f191
usingbigger small number
spadaxsys-dev Apr 14, 2024
d93d9ab
use stable normalized
spadaxsys-dev Apr 14, 2024
eaa820c
update oscillation beam UL data as fluid dynamics code changed slightly.
spadaxsys-dev Apr 14, 2024
3558bc6
non-linear fsi ok, revise average velocity and acceleration
spadaxsys-dev Apr 15, 2024
c255931
all compiled. to test
spadaxsys-dev Apr 15, 2024
dd4d06c
two 2d cases ok
spadaxsys-dev Apr 16, 2024
c16f57e
2d collision
spadaxsys-dev Apr 16, 2024
bd90404
to test fish case
spadaxsys-dev Apr 16, 2024
d9d47b1
2d fsi ok
spadaxsys-dev Apr 16, 2024
cac8c49
several cases ok
spadaxsys-dev Apr 16, 2024
537210a
add acceleration into constraint by simbody
spadaxsys-dev Apr 16, 2024
7e55ea0
2d cases ok
spadaxsys-dev Apr 16, 2024
bfa6acc
to check dambreak interaction with shell case
spadaxsys-dev Apr 17, 2024
7c9d920
still missing the python script to generate data
spadaxsys-dev Apr 17, 2024
8000f5f
cmake error
Xiangyu-Hu Apr 17, 2024
5066cfd
Merge branch 'refactory/retry_on_force_and_force_prior' of https://gi…
Xiangyu-Hu Apr 17, 2024
1d93d75
several cases ok
spadaxsys-dev Apr 17, 2024
826388b
several cases done
Xiangyu-Hu Apr 17, 2024
266ee0f
Merge branch 'refactory/retry_on_force_and_force_prior' of https://gi…
Xiangyu-Hu Apr 17, 2024
5a1d7b4
merge conflict solved
Xiangyu-Hu Apr 17, 2024
5f126d6
normal rotation still use polar decomposition
Xiangyu-Hu Apr 17, 2024
8cce11e
delete unused object
spadaxsys-dev Apr 18, 2024
7e50d8d
position and VolumetricMeasure in methods
spadaxsys-dev Apr 18, 2024
1b66a25
to solve the problem that shell must be elastic solid
spadaxsys-dev Apr 24, 2024
fb067f8
all compiled
spadaxsys-dev Apr 25, 2024
62beddf
some cases not passed yet
Xiangyu-Hu Apr 27, 2024
cb0068d
to text locally for throat case
Xiangyu-Hu Apr 27, 2024
97d5a56
delete unused file
Xiangyu-Hu Apr 27, 2024
d4cfc81
still define particle density and mass in base particles
Xiangyu-Hu Apr 28, 2024
eada854
velocity can be registered in initial condition
Xiangyu-Hu Apr 28, 2024
b775f31
compile error
Xiangyu-Hu Apr 28, 2024
ffbc0a5
indicator registration
Xiangyu-Hu Apr 28, 2024
015a37d
all compiled
Xiangyu-Hu Apr 28, 2024
6b9c921
to more variables
Xiangyu-Hu Apr 30, 2024
3457c1c
progressing with cases on sequence dependence of particle dynamics
Xiangyu-Hu May 1, 2024
e8ea3bf
compile error
Xiangyu-Hu May 1, 2024
5929347
dambreak
Xiangyu-Hu May 1, 2024
9a35de7
a bug in eulerian flow around cylinder case
Xiangyu-Hu May 1, 2024
623afae
shell correction configuration
Xiangyu-Hu May 1, 2024
473ae48
2d done
Xiangyu-Hu May 3, 2024
fadc795
a bug in fiber diffusion
Xiangyu-Hu May 3, 2024
2a662b7
only throat to check
Xiangyu-Hu May 3, 2024
f44e099
class SolidParticles deleted
Xiangyu-Hu May 4, 2024
16b084b
ElasticSolidParticles class deleted
Xiangyu-Hu May 4, 2024
d2bb448
all compiled, to test
Xiangyu-Hu May 4, 2024
f2d7f70
using 2d and 3d for dimensional cpps
Xiangyu-Hu May 4, 2024
16533bb
use type trait
spadaxsys-dev May 4, 2024
fd1e9e2
done
spadaxsys-dev May 4, 2024
3839b07
all compiled, to test
spadaxsys-dev May 4, 2024
ff658d7
seems ok
spadaxsys-dev May 5, 2024
4ff90ad
clean linear particles, all compiled
spadaxsys-dev May 5, 2024
c552275
all compiled
spadaxsys-dev May 5, 2024
e271cb6
done
spadaxsys-dev May 5, 2024
fdcdee2
brief done, to compile
Xiangyu-Hu May 9, 2024
dbe4fc0
simplify the constructor args
Xiangyu-Hu May 9, 2024
c9477e6
small change
Xiangyu-Hu May 10, 2024
d3e9bb7
revise runge kutta
Xiangyu-Hu May 10, 2024
933acbd
compile diffusion reaction
Xiangyu-Hu May 10, 2024
40a9151
compiled physiology
Xiangyu-Hu May 10, 2024
4dad3d2
move to another device
Xiangyu-Hu May 12, 2024
5be7a37
compiled to debug
Xiangyu-Hu May 12, 2024
c64534d
2d diffusion case ok
Xiangyu-Hu May 12, 2024
2845ce9
using defineMaterial
Xiangyu-Hu May 12, 2024
26f8c10
Neumann case compiled to debug
Xiangyu-Hu May 12, 2024
1795c9c
robin case ok
Xiangyu-Hu May 12, 2024
6d322ad
regression test case ok
Xiangyu-Hu May 12, 2024
c467603
revise diffusion reaction
Xiangyu-Hu May 16, 2024
7cbbaf4
single diffusion
Xiangyu-Hu May 17, 2024
b595732
change diffusion dynamics constructor
Xiangyu-Hu May 24, 2024
253e417
using diffusion pointer
Xiangyu-Hu May 25, 2024
4224448
until depolarization
Xiangyu-Hu May 25, 2024
7a48c64
batch changes
Xiangyu-Hu May 25, 2024
ddfec15
batch replace
Xiangyu-Hu May 25, 2024
1e7c7da
diffusion variable sortable
Xiangyu-Hu May 25, 2024
8387492
until rotate plate
Xiangyu-Hu May 25, 2024
0aeecba
batch replace
Xiangyu-Hu May 26, 2024
b8d148a
batch replace
Xiangyu-Hu May 26, 2024
1bd0e6d
batch replace
Xiangyu-Hu May 26, 2024
6c348d8
batch replace
Xiangyu-Hu May 26, 2024
7aea97e
2d cases compiled
Xiangyu-Hu May 26, 2024
7ce7afb
heart contract case have bug bus passed
Xiangyu-Hu May 26, 2024
fd6df41
to check the bug in heart contraction reload
Xiangyu-Hu May 26, 2024
dde90ec
Merge branch 'bugfix/xml_assert_error' into refactory/revise_base_par…
Xiangyu-Hu May 27, 2024
c939185
seems a old bug to find from master branch
Xiangyu-Hu May 30, 2024
aad0532
Merge branch 'bugfix/wrong_interpolation' into refactory/revise_base_…
Xiangyu-Hu May 30, 2024
a4e2f48
heart contraction case
Xiangyu-Hu May 30, 2024
f17b4a3
until muscle soft contact
Xiangyu-Hu May 30, 2024
670515a
several 3 cases done
Xiangyu-Hu May 30, 2024
04ab452
pkj case ok
Xiangyu-Hu May 30, 2024
60fef45
several 3d cases done
Xiangyu-Hu May 30, 2024
86a8a87
three cases done
Xiangyu-Hu May 30, 2024
8acf207
one missing case
Xiangyu-Hu May 30, 2024
2fc4691
dambreak
Xiangyu-Hu May 30, 2024
3d4471c
another case
Xiangyu-Hu May 30, 2024
14eca13
dambreak plate
Xiangyu-Hu May 30, 2024
8ea9e93
extra source compiled
Xiangyu-Hu May 31, 2024
d19063d
unit tests
Xiangyu-Hu May 31, 2024
759f835
begin to revise optimization, steady case done
Xiangyu-Hu May 31, 2024
5e8048a
second case pass
Xiangyu-Hu May 31, 2024
4952981
to revise flux optimization case
Xiangyu-Hu May 31, 2024
504d6a4
two optimization case pass, but I would revise it a bit to use more m…
Xiangyu-Hu Jun 1, 2024
b4e7d0e
add two todo for future revision
Xiangyu-Hu Jun 1, 2024
3fa0a83
compiled all, to run ctest
Xiangyu-Hu Jun 1, 2024
33e4248
all cases passed to update new pull requests
Xiangyu-Hu Jun 1, 2024
f79e520
delete diffusion particles
Xiangyu-Hu Jun 1, 2024
e705f41
Merge branch 'master' into refactory/geometric_particles_only
Xiangyu-Hu Jun 1, 2024
bf5a259
rearrange unstructured mesh files
Xiangyu-Hu Jun 1, 2024
dbc3a31
revising window case
Xiangyu-Hu Jun 1, 2024
8d8caae
add contact heart transfer to robin boundary
Xiangyu-Hu Jun 2, 2024
852f2dd
first windows case done
Xiangyu-Hu Jun 2, 2024
2da6052
naming
Xiangyu-Hu Jun 2, 2024
386985a
continue on another device
Xiangyu-Hu Jun 2, 2024
696eb21
teh second window frame case
spadaxsys-dev Jun 2, 2024
945d866
using shared variable for temporary position
Xiangyu-Hu Jun 2, 2024
0ab8a6f
finally, compile by clang
spadaxsys-dev Jun 3, 2024
99b1de4
2 bugs
Xiangyu-Hu Jun 3, 2024
6eeafe9
id not used in local dynamics class
spadaxsys-dev Jun 4, 2024
73a5e7f
base dynamics revised
spadaxsys-dev Jun 4, 2024
2d7e8df
relax dynamics
spadaxsys-dev Jun 4, 2024
42f8376
fluid dynamics revised
spadaxsys-dev Jun 4, 2024
4fbac2d
solid dynamics
spadaxsys-dev Jun 4, 2024
7b9b8d9
all revised, to compile
spadaxsys-dev Jun 4, 2024
2592d25
fluid dynamics finished
spadaxsys-dev Jun 4, 2024
8cec478
bounding done
spadaxsys-dev Jun 4, 2024
2e2ff09
to continue on another device
spadaxsys-dev Jun 4, 2024
9bd875d
all compiled
spadaxsys-dev Jun 4, 2024
a7ae566
add timeout to ctest
spadaxsys-dev Jun 5, 2024
2f8f8c6
bug on Vecd initialization
spadaxsys-dev Jun 5, 2024
1f2f466
Merge pull request #582 from Xiangyu-Hu/refactory/geometric_particles…
Lisu-lisa Jun 7, 2024
b9ddb14
first_try
TongWu602 Jun 11, 2024
e5c52ee
carotid_1
TongWu602 Jun 12, 2024
6068c84
modified_T_flow
TongWu602 Jun 15, 2024
3a0f8ec
Update modified_T_flow.cpp
TongWu602 Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,38 +213,38 @@ jobs:
id: first-try
run: |
cd build
ctest --output-on-failure
ctest --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the second try for failed cases
id: second-try
if: ${{ steps.first-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the third try for failed cases
id: third-try
if: ${{ steps.second-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the fourth try for failed cases
id: fourth-try
if: ${{ steps.third-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the last try for failed cases
if: ${{ steps.fourth-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000

###############################################################################

Expand Down Expand Up @@ -358,38 +358,38 @@ jobs:
id: first-try
run: |
cd C:\build
ctest.exe --output-on-failure
ctest.exe --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the second try for failed cases
id: second-try
if: ${{ steps.first-try.outcome == 'failure' }}
run: |
cd C:\build
ctest.exe --rerun-failed --output-on-failure
ctest.exe --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the third try for failed cases
id: third-try
if: ${{ steps.second-try.outcome == 'failure' }}
run: |
cd C:\build
ctest.exe --rerun-failed --output-on-failure
ctest.exe --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the fourth try for failed cases
id: fourth-try
if: ${{ steps.third-try.outcome == 'failure' }}
run: |
cd C:\build
ctest.exe --rerun-failed --output-on-failure
ctest.exe --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the last try for failed cases
if: ${{ steps.fourth-try.outcome == 'failure' }}
run: |
cd C:\build
ctest.exe --rerun-failed --output-on-failure
ctest.exe --rerun-failed --output-on-failure --timeout 1000

###############################################################################

Expand Down Expand Up @@ -509,35 +509,35 @@ jobs:
id: first-try
run: |
cd build
ctest --output-on-failure
ctest --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the second try for failed cases
id: second-try
if: ${{ steps.first-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the third try for failed cases
id: third-try
if: ${{ steps.second-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the fourth try for failed cases
id: fourth-try
if: ${{ steps.third-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
continue-on-error: true

- name: Test with the last try for failed cases
if: ${{ steps.fourth-try.outcome == 'failure' }}
run: |
cd build
ctest --rerun-failed --output-on-failure
ctest --rerun-failed --output-on-failure --timeout 1000
22 changes: 5 additions & 17 deletions modules/opencascade/opencascade/relax_dynamics_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

namespace SPH
{
//=====================================================================================================//
namespace relax_dynamics
{
//=================================================================================================//
ShapeSurfaceBounding2::ShapeSurfaceBounding2(RealBody &real_body_)
: LocalDynamics(real_body_), RelaxDataDelegateSimple(real_body_), pos_(particles_->pos_)
: LocalDynamics(real_body_), DataDelegateSimple(real_body_),
pos_(*particles_->getVariableByName<Vecd>("Position"))
{
shape_ = &real_body_.getInitialShape();
}
Expand Down Expand Up @@ -52,9 +52,10 @@ void RelaxationStepInnerSecondHalf::exec(Real dt)

//=================================================================================================//
SurfaceNormalDirection::SurfaceNormalDirection(SPHBody &sph_body)
: RelaxDataDelegateSimple(sph_body), LocalDynamics(sph_body),
: DataDelegateSimple(sph_body), LocalDynamics(sph_body),
surface_shape_(DynamicCast<SurfaceShape>(this, &sph_body.getInitialShape())),
pos_(particles_->pos_), n_(*particles_->getVariableByName<Vecd>("NormalDirection")) {}
pos_(*particles_->getVariableByName<Vecd>("Position")),
n_(*particles_->registerSharedVariable<Vecd>("NormalDirection")) {}

//=================================================================================================//
void SurfaceNormalDirection::update(size_t index_i, Real dt)
Expand All @@ -79,18 +80,5 @@ void SurfaceNormalDirection::update(size_t index_i, Real dt)
n_[index_i] = normal_direction_.normalized();
}
//=================================================================================================//
ConstrainSurfaceBodyRegion::
ConstrainSurfaceBodyRegion(BodyPartByParticle &body_part)
: BaseLocalDynamics<BodyPartByParticle>(body_part), RelaxDataDelegateSimple(sph_body_),
force_(particles_->force_)
{
}
//=================================================================================================//
void ConstrainSurfaceBodyRegion::update(size_t index_i, Real dt)
{
force_[index_i] = Vecd::Zero();
}
//=================================================================================================//
} // namespace relax_dynamics
//=================================================================================================//
} // namespace SPH
18 changes: 2 additions & 16 deletions modules/opencascade/opencascade/relax_dynamics_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SurfaceShape;
namespace relax_dynamics
{
class ShapeSurfaceBounding2 : public LocalDynamics,
public RelaxDataDelegateSimple
public DataDelegateSimple
{
public:
ShapeSurfaceBounding2(RealBody &real_body_);
Expand Down Expand Up @@ -86,7 +86,7 @@ class RelaxationStepInnerSecondHalf : public BaseDynamics<void>
* @class SurfaceNormalDirection
* @brief get the normal direction of surface particles.
*/
class SurfaceNormalDirection : public RelaxDataDelegateSimple, public LocalDynamics
class SurfaceNormalDirection : public DataDelegateSimple, public LocalDynamics
{
public:
explicit SurfaceNormalDirection(SPHBody &sph_body);
Expand All @@ -98,20 +98,6 @@ class SurfaceNormalDirection : public RelaxDataDelegateSimple, public LocalDynam
StdLargeVec<Vecd> &pos_, &n_;
};

/**@class ConstrainSuefaceBodyRegion
* @brief Fix the position surafce body part.
*/
class ConstrainSurfaceBodyRegion : public BaseLocalDynamics<BodyPartByParticle>, public RelaxDataDelegateSimple
{
public:
ConstrainSurfaceBodyRegion(BodyPartByParticle &body_part);
virtual ~ConstrainSurfaceBodyRegion(){};
void update(size_t index_i, Real dt = 0.0);

protected:
StdLargeVec<Vecd> &force_;
};

} // namespace relax_dynamics
} // namespace SPH
#endif // RELAX_DYNAMICS_H
17 changes: 10 additions & 7 deletions modules/opencascade/tests/test_3d_aortic_valve/aortic_valve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Vec3d domain_upper_bound(15.0, 15.0, 26.0);
// Domain bounds of the system.
//----------------------------------------------------------------------
BoundingBox system_domain_bounds(domain_lower_bound, domain_upper_bound);

namespace SPH
{
/** Define the boundary geometry. */
class BoundaryGeometry : public BodyPartByParticle
{
Expand All @@ -51,10 +54,12 @@ class BoundaryGeometry : public BodyPartByParticle
};
};

class LeafletParticleGenerator : public ParticleGenerator<Surface>
class Leaflet;
template <>
class ParticleGenerator<Leaflet> : public ParticleGenerator<Surface>
{
public:
explicit LeafletParticleGenerator(SPHBody &sph_body)
explicit ParticleGenerator(SPHBody &sph_body)
: ParticleGenerator<Surface>(sph_body), sph_body_(sph_body){};
virtual void initializeGeometricVariables() override
{
Expand Down Expand Up @@ -112,6 +117,7 @@ class LeafletParticleGenerator : public ParticleGenerator<Surface>
}
SPHBody &sph_body_;
};
} // namespace SPH

//--------------------------------------------------------------------------
// Main program starts here.
Expand All @@ -128,9 +134,8 @@ int main(int ac, char *av[])
//----------------------------------------------------------------------
SolidBody leaflet(sph_system, makeShared<SurfaceShapeSTEP>(full_path_to_geometry, "Leaflet"));
// here dummy linear elastic solid is use because no solid dynamics in particle relaxation
leaflet.defineParticlesAndMaterial<ShellParticles, SaintVenantKirchhoffSolid>(1.0, 1.0, 0.0);
LeafletParticleGenerator leaflet_particle_generator(leaflet);
leaflet.generateParticles(leaflet_particle_generator);
leaflet.defineMaterial<Solid>();
leaflet.generateParticles<SurfaceParticles, Leaflet>();
//----------------------------------------------------------------------
// Define simple file input and outputs functions.
//----------------------------------------------------------------------
Expand All @@ -153,7 +158,6 @@ int main(int ac, char *av[])
RelaxationStepInnerSecondHalf leaflet_relaxation_second_half(leaflet_inner);
/** Constrain the boundary. */
BoundaryGeometry boundary_geometry(leaflet, "BoundaryGeometry");
SimpleDynamics<ConstrainSurfaceBodyRegion> constrain_holder(boundary_geometry);
SimpleDynamics<SurfaceNormalDirection> surface_normal_direction(leaflet);
//----------------------------------------------------------------------
// Particle relaxation starts here.
Expand All @@ -169,7 +173,6 @@ int main(int ac, char *av[])
while (ite < relax_step)
{
leaflet_relaxation_first_half.exec();
constrain_holder.exec();
leaflet_relaxation_second_half.exec();
ite += 1;
if (ite % 100 == 0)
Expand Down
30 changes: 10 additions & 20 deletions modules/structural_simulation/structural_simulation_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ SolidBodyFromMesh::SolidBodyFromMesh(
{
defineAdaptationRatios(1.15, system.resolution_ref_ / resolution);
defineBodyLevelSetShape()->cleanLevelSet();
defineParticlesWithMaterial<ElasticSolidParticles>(material_model.get());
generateParticles<Lattice>();
assignMaterial(material_model.get());
generateParticles<BaseParticles, Lattice>();
}

SolidBodyForSimulation::SolidBodyForSimulation(
Expand Down Expand Up @@ -110,8 +110,8 @@ std::tuple<StdLargeVec<Vecd>, StdLargeVec<Real>> generateAndRelaxParticlesFromMe
SPHSystem system(bb, resolution);
SolidBody model(system, triangle_mesh_shape);
model.defineBodyLevelSetShape()->cleanLevelSet();
model.defineParticlesAndMaterial<SolidParticles, Solid>();
model.generateParticles<Lattice>();
model.defineMaterial<Solid>();
model.generateParticles<BaseParticles, Lattice>();

if (particle_relaxation)
{
Expand All @@ -120,7 +120,7 @@ std::tuple<StdLargeVec<Vecd>, StdLargeVec<Real>> generateAndRelaxParticlesFromMe
relaxParticlesSingleResolution(write_particle_relaxation_data, model, inner_relation);
}

return std::tuple<StdLargeVec<Vecd>, StdLargeVec<Real>>(model.getBaseParticles().pos_, model.getBaseParticles().Vol_);
return std::tuple<StdLargeVec<Vecd>, StdLargeVec<Real>>(model.getBaseParticles().ParticlePositions(), model.getBaseParticles().VolumetricMeasures());
}

BodyPartByParticle *createBodyPartFromMesh(SPHBody &body, const StlList &stl_list, size_t body_index, SharedPtr<TriangleMeshShape> tmesh)
Expand Down Expand Up @@ -215,12 +215,7 @@ StructuralSimulation::StructuralSimulation(const StructuralSimulationInput &inpu
translation_solid_body_part_tuple_(input.translation_solid_body_part_tuple_),

// iterators
iteration_(0),

// data storage
von_mises_stress_max_({}),
von_mises_stress_particles_({})

iteration_(0)
{
// scaling of translation and resolution
scaleTranslationAndResolution();
Expand Down Expand Up @@ -906,12 +901,7 @@ void StructuralSimulation::runSimulation(Real end_time)
runSimulationStep(dt, integration_time);
}
TickCount t2 = TickCount::now();
// record data for test
von_mises_stress_max_.push_back(solid_body_list_[0].get()->getElasticSolidParticles()->getVonMisesStressMax());
von_mises_stress_particles_.push_back(solid_body_list_[0].get()->getElasticSolidParticles()->getVonMisesStressVector());

von_mises_strain_max_.push_back(solid_body_list_[0].get()->getElasticSolidParticles()->getVonMisesStrainMax());
von_mises_strain_particles_.push_back(solid_body_list_[0].get()->getElasticSolidParticles()->getVonMisesStrainVector());
// write data to file
write_states.writeToFile();
TickCount t3 = TickCount::now();
Expand Down Expand Up @@ -957,12 +947,12 @@ double StructuralSimulation::runSimulationFixedDurationJS(int number_of_steps)

Real StructuralSimulation::getMaxDisplacement(int body_index)
{
StdLargeVec<Vecd> &pos_0 = solid_body_list_[body_index].get()->getElasticSolidParticles()->pos0_;
StdLargeVec<Vecd> &pos_n = solid_body_list_[body_index].get()->getElasticSolidParticles()->pos_;
StdLargeVec<Vecd> &pos = solid_body_list_[body_index].get()->getElasticSolidParticles()->ParticlePositions();
StdLargeVec<Vecd> &pos0 = *solid_body_list_[body_index].get()->getElasticSolidParticles()->registerSharedVariableFrom<Vecd>("InitialPosition", "Position");
Real displ_max = 0;
for (size_t i = 0; i < pos_0.size(); i++)
for (size_t i = 0; i < pos0.size(); i++)
{
Real displ = (pos_n[i] - pos_0[i]).norm();
Real displ = (pos[i] - pos0[i]).norm();
if (displ > displ_max)
displ_max = displ;
}
Expand Down
11 changes: 2 additions & 9 deletions modules/structural_simulation/structural_simulation_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class SolidBodyForSimulation
~SolidBodyForSimulation(){};

SolidBodyFromMesh *getSolidBodyFromMesh() { return &solid_body_from_mesh_; };
ElasticSolidParticles *getElasticSolidParticles() { return DynamicCast<ElasticSolidParticles>(this, &solid_body_from_mesh_.getBaseParticles()); };
BaseParticles *getElasticSolidParticles() { return DynamicCast<BaseParticles>(this, &solid_body_from_mesh_.getBaseParticles()); };
InnerRelation *getInnerBodyRelation() { return &inner_body_relation_; };

SimpleDynamics<NormalDirectionFromBodyShape> *getInitialNormalDirection() { return &initial_normal_direction_; };
Expand All @@ -118,7 +118,7 @@ void expandBoundingBox(BoundingBox *original, BoundingBox *additional);

void relaxParticlesSingleResolution(bool write_particles_to_file,
SolidBodyFromMesh &solid_body_from_mesh,
ElasticSolidParticles &solid_body_from_mesh_particles,
BaseParticles &solid_body_from_mesh_particles,
InnerRelation &solid_body_from_mesh_inner);

static inline Real getPhysicalViscosityGeneral(Real rho, Real youngs_modulus, Real length_scale, Real shape_constant = 1.0)
Expand Down Expand Up @@ -249,13 +249,6 @@ class StructuralSimulation
// iterators
int iteration_;

// data storage
StdVec<Real> von_mises_stress_max_;
StdLargeVec<StdLargeVec<Real>> von_mises_stress_particles_;

StdVec<Real> von_mises_strain_max_;
StdLargeVec<StdLargeVec<Real>> von_mises_strain_particles_;

// for constructor, the order is important
void scaleTranslationAndResolution();
void setSystemResolutionMax();
Expand Down
Loading