52 PackageData<Vecd> phi_gradient_;
53 PackageDataAddress<Vecd> phi_gradient_addrs_;
54 PackageData<Real> kernel_weight_;
55 PackageDataAddress<Real> kernel_weight_addrs_;
56 PackageData<Vecd> kernel_gradient_;
57 PackageDataAddress<Vecd> kernel_gradient_addrs_;
64 PackageDataAddress<int> near_interface_id_addrs_;
70 void registerAllVariables();
71 void initializeSingularData(Real far_field_level_set);
72 void initializeBasicData(
Shape &shape);
73 void computeKernelIntegrals(
LevelSet &level_set);
74 void computeLevelSetGradient();
75 void stepReinitialization();
76 void markNearInterface(Real small_shift_factor);
89 virtual void cleanInterface(Real small_shift_factor) = 0;
90 virtual bool probeIsWithinMeshBound(
const Vecd &position) = 0;
91 virtual Real probeSignedDistance(
const Vecd &position) = 0;
92 virtual Vecd probeNormalDirection(
const Vecd &position) = 0;
93 virtual Vecd probeLevelSetGradient(
const Vecd& position) = 0;
94 virtual Real probeKernelIntegral(
const Vecd &position, Real h_ratio = 1.0) = 0;
95 virtual Vecd probeKernelGradientIntegral(
const Vecd &position, Real h_ratio = 1.0) = 0;
117 Real global_h_ratio_;
127 virtual void cleanInterface(Real small_shift_factor)
override;
128 virtual bool probeIsWithinMeshBound(
const Vecd &position)
override;
129 virtual Real probeSignedDistance(
const Vecd &position)
override;
130 virtual Vecd probeNormalDirection(
const Vecd &position)
override;
131 virtual Vecd probeLevelSetGradient(
const Vecd& position)
override;
132 virtual Real probeKernelIntegral(
const Vecd &position, Real h_ratio = 1.0)
override;
133 virtual Vecd probeKernelGradientIntegral(
const Vecd &position, Real h_ratio = 1.0)
override;
135 bool isWithinCorePackage(Vecd position);
136 Real computeKernelIntegral(
const Vecd &position);
137 Vecd computeKernelGradientIntegral(
const Vecd &position);
142 void finishDataPackages();
143 void reinitializeLevelSet();
144 void markNearInterface(Real small_shift_factor);
145 void redistanceInterface();
146 void updateLevelSetGradient();
147 void updateLevelSetGradientForAPackage(
LevelSetDataPackage* inner_data_pkg, Real dt = 0.0);
148 void updateKernelIntegrals();
153 bool isInnerPackage(
const Vecu &cell_index);
155 void initializeDataInACell(
const Vecu &cell_index, Real dt);
156 void initializeAddressesInACell(
const Vecu &cell_index, Real dt);
157 void tagACellIsInnerPackage(
const Vecu &cell_index, Real dt);
172 void initializeDataInACellFromCoarse(
const Vecu &cell_index, Real dt);
186 virtual void cleanInterface(Real small_shift_factor)
override;
187 virtual bool probeIsWithinMeshBound(
const Vecd &position)
override;
188 virtual Real probeSignedDistance(
const Vecd &position)
override;
189 virtual Vecd probeNormalDirection(
const Vecd &position)
override;
190 virtual Vecd probeLevelSetGradient(
const Vecd &position)
override;
191 virtual Real probeKernelIntegral(
const Vecd &position, Real h_ratio = 1.0)
override;
192 virtual Vecd probeKernelGradientIntegral(
const Vecd &position, Real h_ratio = 1.0)
override;
195 inline size_t getProbeLevel(
const Vecd &position);
196 inline size_t getMeshLevel(Real h_ratio);
PackageDataAddress< Real > phi_addrs_
Definition: level_set.h:51
Base class for all adaptations. The base class defines essential global parameters. It is also used for single-resolution method. In the constructor parameter, system_refinement_ratio defines the relation between present resolution to the system reference resolution. The derived classes are defined for more complex adaptations.
Definition: adaptation.h:55
Definition: base_data_type.h:43
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
This class is designed to save memory and increase computational efficiency on mesh. //TODO: the connection between successive meshes in refined mesh should enhanced.
Adaptation defines the parameters for single or multi-resolution computations.
LevelSetDataPackage()
Definition: level_set.cpp:14
Fixed memory level set data packed in a package. Level set is the signed distance to an interface...
Definition: level_set.h:46
Abstract base class of a general SPH kernel function which is a smoothed Dirac delta function...
Definition: base_kernel.h:63
Abstract base class for the field data saved on a mesh.
Definition: base_mesh.h:128
Real computeHeaviside(Real phi, Real half_width)
Definition: level_set.cpp:42
Definition: level_set.h:179
PackageData< Real > phi_
Definition: level_set.h:50
A abstract describes a level set field defined on a mesh.
Definition: level_set.h:83
Multi-level Meshes with successively double the resolution.
Definition: base_mesh.h:166
ConcurrentVector< LevelSetDataPackage * > core_data_pkgs_
Definition: level_set.h:116
bool is_core_pkg_
Definition: level_set.h:49
Abstract class for mesh with data packages.
Definition: mesh_with_data_packages.h:236
Shape is the base class for all geometries.
Abstract base class derived from the coarse mesh but has double resolution. Currently, the design is simple but can be extending for more inter-mesh operations.
Definition: base_mesh.h:148
virtual void writeMeshFieldToPlt(std::ofstream &output_file) override
Definition: level_set_supplementary.cpp:246
Shape & shape_
Definition: level_set.h:98
Abstract base class for a data package whose data are defined on the grids of a small mesh patch...
Definition: mesh_with_data_packages.h:133
level set which has double resolution of a coarse level set.
Definition: level_set.h:164
PackageData< int > near_interface_id_
Definition: level_set.h:63
Mesh with level set data as packages. Note that the mesh containing the data packages are cell-based ...
Definition: level_set.h:112
Definition: solid_body_supplementary.cpp:9